Gradle: error: package com.xyz.ClassName does not exist
Gradle: error: cannot find symbol class ClassNameSo whenever you want to import any library in your project, try following steps to fix above error.
- Put your library file (jar) in "libs" directory.
- Right click that jar file and select "Add as library"
- Now, open your build.gradle file as shown in below image
it will have following line inside.
dependencies {
compile files('libs/android-support-v4.jar')
}
Ensure that your jar has been listed in this tab. If not, just add it like below.
dependencies {
compile files('libs/android-support-v4.jar', 'libs/your_jar_file_name.jar')
}
You can add as many library names in above tag you want. Use "," to differentiate it.
Now, build your project. This will let you now third party library import and will not display any type of error in import section.

Join the conversation! Your thoughts help the community grow.