For avro, you need to download and include spark-avro provided by databricks in packages list. You can use this version:
com.databricks:spark-avro_2.11:3.2.0
After including use the code as shown below.
val df=spark.read.format("com.databricks.spark.avro").option("header","true").load("file")