Android Studio: import com.android.volley.xxxx Cannot Resolve Symbol 'xxxx'

China☆狼群 提交于 2019-12-08 09:12:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!