问题
So, I followed this tutorial to create a ListView with images using Volley but I am having this issue with the com.android.volley.xxxx import statements in LruBitmapCache.java, AppController.java, CustomListAdapter.java, and MainActivity.java. It shows as Unused import statements and its extension are in red saying Cannot resolve symbol xxxx. Volley.jar is already aded to app -> libs section.
Would appreciate any help.
回答1:
I'd double check to make sure your build.gradle includes:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
...
}
And also make sure you've ran a sync.
回答2:
Add
compile 'com.mcxiaoke.volley:library:1.0.6@aar'
to your Gradle dependencies...
回答3:
Add this in your build.gradle of your app
https://developer.android.com/training/volley/
implementation 'com.android.volley:volley:1.1.1'
来源:https://stackoverflow.com/questions/28842997/android-studio-import-com-android-volley-xxxx-cannot-resolve-symbol-xxxx