Cannot resolve symbol 'RequestQueue' - android

I am new to android studio and volley library so please bear with me.
I've added volley library by GitHub and then and added this line to build gradle file:
compile 'com.android.support:appcompat-v7:23.0.1'
And now I am trying some tutorials about request and response from api, but for some reason I cannot make an instance of RequestQueue why?
I am using Android 4.0.3 IceCreamSandwish
Thank you

add following to your build.gradle file
compile 'com.mcxiaoke.volley:library:1.0.19'

Google have added it to their own documentation pages and GitHub https://developer.android.com/training/volley/index.html
The dependency can be added using:
dependencies {
...
implementation 'com.android.volley:volley:1.1.0'
}

Add this volley repo clone to your gradle dependencies:
compile 'com.mcxiaoke.volley:library:1.0.19'
https://github.com/mcxiaoke/android-volley

Add the Volley library as a dependency in the module build.gradle file.
dependencies {
compile 'com.he5ed.lib:volley:android-cts-5.1_r4'
}
This is another mirror of the Google Volley library https://github.com/he5ed/volley

I would add it in the build.gradle:
compile 'com.mcxiaoke.volley:library:1.0.19'
you were adding
compile 'com.android.support:appcompat-v7:23.0.1'
which is a completely different thing (a backwards COMPATibility library for older API levels).

Related

Android aar file with dependencies

Currently I need to build an Android library .aar file. In the library have network request so that I have to add Retrofit as library's dependencies.
My library build.gradle file look like:
dependencies {
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
}
But when using aar file by
compile(name:'sdk-release', ext:'aar'){transitive=true}
It's throw exception:
java.lang.NoClassDefFoundError
After research, I figured out that the Problem is "transitive dependencies".
Do we have any solution to fix this problem?
Many thanks.

Latest version of Glide giving dependency error

I have upgraded the version of Glide from 4.0.0-RC0 to 4.4.0. But it is giving me an error saying
Error:Module 'com.github.bumptech.glide:glide:4.4.0' depends on one or more Android Libraries but is a jar
It is not saying which jar or any other information.
Does anybody know how to fix this? I am also attaching the entries for Glide in my build.gradle
compile 'com.github.bumptech.glide:glide:4.4.0'
compile 'com.github.bumptech.glide:okhttp3-integration:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
compile 'com.github.bumptech.glide:annotations:4.4.0'
EDIT : I am using the support library version 27.0.1
I faced the same issue, but using this solved it :
compile('com.github.bumptech.glide:glide:4.4.0#aar') {
transitive = true;
}
To pull in the annotations module which contains #GlideModule, you have to use transitive = true
This is may be glide issue so, I will prefer to don't update glide to com.github.bumptech.glide:glide:4.4.0 till now. you can use older version like com.github.bumptech.glide:glide:4.3.1 or com.github.bumptech.glide:glide:4.3.0 or com.github.bumptech.glide:glide:4.2.0
you can read more about these issues on
issue 2318
issue 2319
Just use this in app.gradle and you are done :
compile 'com.github.bumptech.glide:glide:3.7.0'
Just need to do these steps to avoid this error:
1 - update your sdk version to 27
2 - In your dependencies in build.gradle:
implementation('com.github.bumptech.glide:glide:4.6.1') {
exclude group: "com.android.support"
}
And you are good to go as this one resolved my issue.
implementation 'com.github.bumptech.glide:glide:4.0.0-RC0'
Once check with this dependencies for latest android studio 3.0.2 this dependencies build proper gradle.
You can use it like this in your build. Simply:
dependencies {
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
}

cannot resolve floatinbuttonAction and snackbar

I'm very new to the android development. I imported my friend's project in my android studio and I'm having this trouble right now that I'm unable to sort out on my own. Please help me fix it.
You have to add the design support library in your build.gradle :
implementation 'com.android.support:design:25.3.1'
Package android.support.design.widget.FloatingActionButton and android.support.design.widget.Snackbar lies under design-support library. You have to add design-support library into your project.
Add below dependencies into your app modules build.gradle file and Sync .
dependencies {
............
................
compile 'com.android.support:design:25.3.1'
}
Hope this will help
FloatingActionButton and snackbar are components of design LIB
Add this in your app gradle file
compile 'com.android.support:design:23.1.1'

Android .aar dependencies aren’t resolving in app project that depends on .aar

i have created an android library AAR in android studio 2.1.3 in which i use the following dependencies:
compile 'com.google.android.gms:play-services-vision:9.4.0+'
compile 'com.google.android.gms:play-services-wearable:9.4.0+'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.3'
now i am using this aar in an application but those dependencies were failing unless i add them to the dependencies of the new app.
i search here and i found that i need to add the following line:
compile (project(':LIBNAME-release')) {transitive = true}
but this didn't work. is there something i missed? or is it related to the obfuscation i did to the aar file? or is it a must to add these dependencies to the app?
Try to compile you project first:
dependencies {
compile project(':Name-Of-Your-Project')
}
This is Ashton Engberg's suggestion from that post

Android Studio Can't Fetch Library

I have recently started getting this issue with Android Studio and it has been driving me up the wall. I keep getting the error "Failed to resolve: com.squareup.okio:okio:1.8.0". These are the dependencies I have:
dependencies {
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile files('libs/okio-1.8.0.jar')
compile files('libs/retrofit-2.1.0 (1).jar')
}
As you can see, I have the retrofit and gson libraries simply compile (I'm assuming this downloads them from the internet), I tried doing the same with Okio however it didn't resolve, so I have speicifcally downloaded the 1.8.0 Okio JAR however it still fails to resolve. Why could this be? Any answer would be greatly appreciated. Thank you
Don't put dependencies as a Gradle dependency:
compile 'com.squareup.retrofit2:retrofit:2.1.0'
And as a .jar file in src/libs:
compile files('libs/retrofit-2.1.0 (1).jar')
at one time. Choose only one method. I advise you to choose Gradle dependencies, because they are automatically fetched.
In you case, the dependencies section should look like:
dependencies {
compile `com.google.code.gson:gson:2.7`
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
}

Categories

Resources