Glide java.lang.NoSuchMethodError: No virtual method - android

I'm facing an issue regarding Glide library.
I used couple of multiimagepicker API's from github
but whenever i click for selecting image
it crashes.
every API crash because of this error
java.lang.NoSuchMethodError: No virtual method
load(Ljava/lang/String;)Lcom/bumptech/glide/DrawableTypeRequest; in
class Lcom/bumptech/glide/RequestManager; or its super classes
(declaration of 'com.bumptech.glide.RequestManager' appears ...)
I'm badly stuck due to this error.
i searched on glide forum but still no proper answer found. many looking for answer of this error
Build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.mikepenz:aboutlibraries:5.9.7#aar') {
transitive = true
exclude group: 'com.android.support'
}
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:cardview-v7:26.0.+'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.lolucosmin:PermissionsWrapper:version_1.2'
compile 'com.github.javiersantos:BottomDialogs:1.2.1'
compile 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
compile 'com.appyvet:materialrangebar:1.4'
compile 'com.github.vivchar:ViewPagerIndicator:v1.0.1'
compile 'com.github.bumptech.glide:glide:4.2.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
compile 'com.github.chathuralakmal:AndroidImagePopup:1.2'
compile 'com.ss.bannerslider:bannerslider:1.8.0'
compile 'org.aviran.cookiebar2:cookiebar2:1.0.5'
compile 'com.github.hamsaadev:RTLMaterialSpinner:V1.0.1'
compile 'com.github.darsh2:MultipleImageSelect:v0.0.4'
}

I got the same error using the currently latest version: 4.7.1
The error is likely to cause because of your dependencies, to me, downgrading the Glide version to 4.3.1 worked fine.
implementation'com.github.bumptech.glide:glide:4.3.1'
By the way, use the term implementation, rather than compile as it will be removed this year.
This solution might not work for you, because your version is already 4.2.0
But anyway, Hope it works!

after migrating android to androidx
and upgrading the gradle to newer version I had some problems with glide..
after trying version one by one... this version was the only one that works for me..
recommending on glide 4.8.0
with the newer and with the elders i had some problems.. maybe this version will works for you too..
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.android.support:support-annotations:28.0.0'
annotationProcessor 'com.android.support:support-annotations:28.0.0'
maybe you will find here some info that might help..
https://github.com/bumptech/glide/releases

You are facing this error because MultipleImageSelect:v0.0.4 using old glide version and your project using newer version. When Gradle builds your project, It uses a newer version of Gradle and MultipleImageSelect:v0.0.4 will crash internally. You can confirm this in External libraries of project in android studio. Use same version of glide will solve this problem. Either downgrade your project's version of check latest version of MultipleImageSelect.

Related

Integrate FirebaseUI to app/build.gradle cause crash at runtime

Adding
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
into dependencies of the app/build.grandle File, cause an Error every Time I call FirebaseAuth.getInstance(). Before I added the new gradle Dependency, every FirebaseAuth.getInstance() Call works fine and also I was able to load Data from FirebaseDatabase.
Iam doing this Tutorial: FirebaseUI for Android — Auth. What did I wrong?
Update 1: Put the calls into an Try/Catch Block doesnt work. The Debbuger does not step into the catch Part.
UPDATE 2:
What is the Error? Answer: I dont get an Error. The Logcat Box do not print any Error Message. Also I cant figgure out the error via debugging, becaus the Catch-Block dont get reached.
My app/build.gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.android.support:cardview-v7:26.0.1'
testCompile 'junit:junit:4.12'
//Firebase
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
//FirebaseUI
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile('com.facebook.android:facebook-android-sdk:4.22.1') // Required only if Facebook login support is required
}
apply plugin: 'com.google.gms.google-services'
To solve this, change this lines of code:
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
with
compile 'com.firebaseui:firebase-ui-auth:1.2.0'
Make sure to using right version number for firebase-ui-auth at gradle. You can read the official document: https://firebase.google.com/docs/android/setup
Just check the compatibility:
FirebaseUI Version Firebase/Play Services Version
2.3.0 11.0.4
If you want to use the firebase-ui 2.3.0 you have to use firebase 11.0.4.
Use:
//Firebase
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
//FirebaseUI
compile 'com.firebaseui:firebase-ui-auth:2.3.0'

getAdapterPosition() is not found as a method

I recently uprated to Android Studio 2.3 and not the getAdapterPosition (RecyclerView) cannot be found. I saw on the web that the reason for that is the support library version. But I am not sure how to solve it still. My support:appcompat-v7:25.2.0' version is the latest possible (e.g. above 21). I don't understand why the method is not found. Any advice, please?
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/wekaSTRIPPED.jar')
compile('com.mikepenz:materialdrawer:5.8.1#aar') { // Material Drawer
transitive = true
}
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.google.dagger:dagger:2.9'
compile 'com.github.wendykierp:JTransforms:3.1'
compile 'com.afollestad.material-dialogs:commons:0.9.3.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.github.paolorotolo:appintro:4.1.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.borax12.materialdaterangepicker:library:1.9'
compile 'com.evernote:android-job:1.1.7' // Scheduling library
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
Can you please check you are using this method in ViewHolder Class?
getAdapterPostion() is the method of RecyclerView.ViewHolder.
You need to make sure you are using this method inside the class extending RecyclerView.ViewHolder
compile 'com.android.support:recyclerview-v7:25.2.0'
may be missing that line ???
Please add this dependency:
compile 'com.android.support:recyclerview-v7:23.3.0'
Probably you have to use buildToolsVersion 25.2.0 too, and in my case the gradle showed me and error:
All com.android.support libraries must use the exact same version
specification (mixing versions can lead to runtime crashes). Found
versions 25.2.0, 25.0.0. Examples include
com.android.support:animated-vector-drawable:25.2.0 and
com.android.support:customtabs:25.0.0
To solve this I have had to add this line compile 'com.android.support:customtabs:25.2.0' forcing to use this version for customtabs.
Before:
// android support
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
After:
// android support
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:customtabs:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
If you have an error like this, I recommend you to add the library that shows the error with the version you want.

Migrate from RxAndroid 1.x to 2.x (RxJava included)

I have a project running RxAndroid 1.x (everythings works).
I am trying to migrate to 2.x version.
My gradle file:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
//compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5#aar') {
transitive = true;
}
//compile 'io.reactivex:rxandroid:1.2.1'
//compile 'io.reactivex:rxjava:1.2.1'
compile 'com.jakewharton.rxbinding:rxbinding:0.4.0'
compile 'com.jakewharton.rxbinding:rxbinding-support-v4:0.4.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'io.reactivex.rxjava2:rxjava:2.0.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.0-RC1'
}
I have this error:
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
File1: /Users/agustin/.gradle/caches/modules-2/files-2.1/io.reactivex.rxjava2/rxjava/2.0.0/5151c737c01616c372c3d00ab145868ede10e826/rxjava-2.0.0.jar
File2: /Users/agustin/.gradle/caches/modules-2/files-2.1/io.reactivex/rxjava/1.1.0/748f0546d5c3c27f1aef07270ffea0c45f0c42a4/rxjava-1.1.0.jar
Why RxJava 1.1.0 is added?
I can exclude the rxjava.properties but I would like to understand the error. I have cleaned the project and invalidated the cache but the error persists.
Look the picture:
Thanks
Just wanted to follow-up with a solution to this problem. RxBinding 1.0.0 has been released and from this point on it should be compatible with RxJava2, however it still imports an older version of RxJava which results in the same issue this question asks about. In order to fix the problem simply add the following to your gradle build scrip under android.
android {
...
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
}
To fix this, now you can update the RxBinding and Retrofit Adapter to version to 2.
compile 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
compile 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.0.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
You can find out what libraries may be including RxJava 1.1.0 by running the command ./gradlew :app:dependencies in the root of your project where app is the name of the module you are including these dependencies from.
In your case I'd suggest the offending item is: com.jakewharton.rxbinding:rxbinding:0.4.0

Failed to resolve firebase-ui:0.4.0

Trying to update my firebaseui. But Why doesn't this work in my gradle file?
compile 'com.firebaseui:firebase-ui:0.4.0'
UPDATE
Still same problem.
My other dependicies ar also updated:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.1'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.maps:google-maps-services:0.1.12'
compile 'com.google.maps.android:android-maps-utils:0.4.3'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.firebase:firebase-simple-login:1.4.2'
compile "com.google.firebase:firebase-database:9.0.0"
compile 'com.firebaseui:firebase-ui:0.4.0'
Update:
The bug has been fixed and the new build is already pushed. Here's the last official reply from the bug post.
Ok I just pushed a fix for this. There will be some propagation delay.
If you can try it in >= 1hr and let me know if it works that
would be great. Just build your project with the gradle flag
--refresh-dependencies to make sure it re-downloads deps and does not use the cached copy.
FirebaseUI is moved to jCenter in 0.4.0, thus it can't be found in mavenCentral. If it's still giving error, try to add Database and Auth dependencies separately, like this
compile 'com.firebaseui:firebase-ui-database:0.4.0'
compile 'com.firebaseui:firebase-ui-auth:0.4.0'
This has been marked as a bug already here. You can read the bug post to read more about this issue.
Here's the official reply on the bug
Ok I'm glad that solved your problem. For what it's worth,
com.firebaseui:firebase-ui:0.4.0 is just an empty library that
declares dependencies on those libraries for convenience.
I will leave this issue open until I can figure out what's going on
with my jCenter configuration, thanks for the report!
For some reason 0.4.0 is not avaible through bintray or mavencentral..
0.3.1 works though, so try that for now. I will look into it later.
'com.firebaseui:firebase-ui:0.3.1'
maoke sure you are using Jcenter.
if compile 'com.firebaseui:firebase-ui-database:0.4.0' and
compile 'com.firebaseui:firebase-ui-auth:0.4.0' still not work for you, try to go to Settings-> Build,execution, Deployment -> and disable offline Work

Android Studio cannot resolve symbol 'TabLayout'

Cannot resolve symbol TabLayout ? How to clear this error? Please help me. I already imported import android.support.design.widget.TabLayout;
Had a similar problem, to fix this in Android Studio (AS) I went Build->Clean Project and AS sorted everything out. Make sure in your build.gradle file under dependencies that you have:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:your_api_version_number.0.0'
compile 'com.android.support:design:+'
}
I solved the issue Manually by adding the following two lines:
implementation 'com.android.support:support-v4:22.2.0'
implementation 'com.android.support:design:22.2.0'
under dependencies in \app\build.gradle worked for me.
Note: Your all the support libraries have to be the same version i.e. appcompat-v7 and support-v4 to same version e.g. 23.0.1; otherwise you can get this error
java.lang.NoClassDefFoundError: android.support.v7.internal.widget.TintManager`
after code build
Under Gradle Scripts,
Open build.gradle (Module: app)
Inside of dependencies add
compile 'com.android.support:design:25.3.1'
There may be a newer version of the library available, the android studio lint check may detect that.
The full dependencies area may look like this for reference. The above line is the only one I manually added.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.3.1'
}
An above answer suggested adding
compile 'com.android.support:design:+'
Which is kind of dangerous because it always uses the latest library, you may have trouble isolating bugs with automatic library updates happening in the background.
Android Studio no longer uses "compile", they use "implementation".
Be sure to include the code below when you go to Build Gradle>dependencies{
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
For Android API Level 29+, add the following dependency in build.gradle (Module:app):
dependencies {
implementation 'com.google.android.material:material:1.0.0'
}
If there is a newer version available, Android Studio will prompt you to use the newest one.
I solve it by Open build.gradle (Module: app) and add
implementation 'com.android.support:design:+'

Categories

Resources