简体   繁体   中英

Gradle: Cannot resolve symbol RequestQueue

I have added

implementation 'com.android.volley:volley:1.1.1'

I have also used

compile 'com.android.volley:volley:1.1.1'`

I did it in my build.gradle (Module:app) file.

I have added internet permissions in my Manifest.

Also, I have tried this solution ( Cannot resolve symbol 'RequestQueue' ), but it is not working.

There are a few things you should check.


Wrong :

import com.android.volley.Volley;

Correct :

import com.android.volley.toolbox.Volley;

( more info )


Wrong :

RequestQueue queue = new Volley.newRequestQueue(this);

Correct :

RequestQueue queue = Volley.newRequestQueue(this);

( more info )


Deprecated :

compile 'com.android.volley:volley:1.1.1'`

Recommended :

implementation 'com.android.volley:volley:1.1.1'

( more info )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM