I have been developing and working on my App, I then decided to build the APK I then got duplicate file error specifically talking about firebase zzc.class? which I could not find. I have seen duplicate file error before and sorted it out but this Firebase error has really slowed down my work because I have seen no specific answer to my issue.
Below are my dependencies
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:25.+'
compile 'com.android.support:support-v4:25.+'
compile 'com.android.support:design:25.+'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.firebaseui:firebase-ui:2.0.1'
compile 'org.apache.pdfbox:pdfbox:2.0.0'
compile 'net.igenius:customcheckbox:1.3'
compile 'com.roger.catloadinglibrary:catloadinglibrary:1.0.1'
testCompile 'junit:junit:4.12'
}
Then the error:
You are using different versions of the same libraries:
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.firebaseui:firebase-ui:2.0.1'
As you can read here there is a dependency between firebaseui and firebase libraries:
FirebaseUI Version Firebase/Play Services Version
2.3.0 11.0.4
2.2.0 11.0.4
2.1.1 11.0.2
2.0.1 11.0.1
Use the same version to avoid these issue.
Also there is no reason to use the old:
compile 'com.firebase:firebase-client-android:x.x.x'
Check the migration guide and use:
compile "com.google.firebase:firebase-database:X.X.X"
Keep in mind that the latest version requires the google maven repo:
allprojects {
// ...
dependencies {
// ...
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
This is happening because you have a duplicate in your build.gradle file. To solve this, you need to remove the following line of code:
compile 'com.firebase:firebase-client-android:2.3.1'
You cannot mix the old version of dependency with the new one.
Make sure to update firebase version to latest available version in your build(app) configuration exactly mentioned in the firebase documentation.
[https://firebase.google.com/docs/android/setup/]
If you are using play services make sure that the version of firebase library should be exactly same as of play services version.
compile 'com.google.android.gms:play-services:11.2.0'
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-messaging:11.2.0'
If there is a library conflict then add gradle as:
defaultConfig {
multiDexEnabled true
}
and in your baseapplication
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Related
I made following upgrades today
Android Studio 3.0 -> 3.1
In build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1' -> 3.1.0
}
In gradle/wrapper/gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-4.5-all.zip -> gradle-4.6-all.zip
And I am now getting following error with my firebase modules (random module at a time when I build)
Failed to find byte code for
com/google/firebase/storage/StreamDownloadTask$StreamProcessor
or sometimes
Failed to find byte code for
com/google/firebase/database/ChildEventListener
My project implements
dependencies {
compile 'com.google.android.gms:play-services-base:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-firestore:11.8.0'
compile 'com.google.firebase:firebase-invites:11.8.0'
compile "com.google.firebase:firebase-messaging:11.8.0"
compile 'com.google.android.gms:play-services-auth:11.8.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:26.1.0'
}
I have the same error
Failed to find byte code for com/google/firebase/database/Transaction$Handler
(although i don't use firebase/database).
Have found that disabling instant run in AndroidStudio settings resolve this issue.
This is addressed in the latest react-native-firebase v4 release candidate, available here: https://github.com/invertase/react-native-firebase/releases/tag/v4.0.0-rc.3
The fix was ultimately to update the react-native-firebase build.gradle to use compileOnly instead of compile statements.
In the dependencies add:
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-storage:11.8.0'
to be able to use ChildEventListener and StreamDownloadTask$StreamProcessor
Also you may have to write the other firebase dependencies
I am using adobe creative sdk library in my photo editing application. When I add dependencies of this library in my application, it adds its necessary libraries in my project. It adds google play services base library version 9.4.0 which is not the latest version.So, problem is that when I add a google ads dependency in my project, it shows error as below:
Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.8.0.
So how can I update the play services base library version? it is not showing in my Gradle file but its showing in my external libraries of the project as shown below.
Build.gradle dependencies:
implementation 'com.google.firebase:firebase-core:11.8.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
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'
})
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
testCompile 'junit:junit:4.12'
/* Add the CSDK framework dependencies (Make sure these version numbers are correct) */
// compile 'com.aviary.android.feather.sdk:aviary-sdk:3.6.3'
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.adobe.creativesdk.foundation:auth:0.9.1251'
compile 'com.adobe.creativesdk:image:4.8.4'
compile 'com.localytics.android:library:4.0.1'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.intuit.sdp:sdp-android:1.0.4'
compile 'com.github.bumptech.glide:glide:4.3.1'
compile 'com.google.android.gms:play-services-ads:11.8.0'
implementation 'com.android.support:support-v4:25.4.0'
External Libraries Directory
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'
Im trying chat application using firebase. Im getting following error which could nit resolve myself,
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzble.class
I have mentioned below my gradle file
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.google.firebase:firebase-core:10.2.4'
compile 'com.android.support:design:25.3.1'
compile 'com.firebaseui:firebase-ui:1.1.1'
compile 'com.google.firebase:firebase-auth:10.2.4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
FirebaseUI has transitive dependencies on a number of the Firebase libraries. You must specify a version of FirebaseUI that is compatible with the Firebase libraries you are using. The table of compatible versions is listed in the FirebaseUI documentation. The most recent FirebaseUI version is 1.2.0, which works with library version 10.2.0. A version of FirebaseUI for Firebase libs 10.2.4 and 10.2.6 has not been released.
The safe change is:
compile 'com.firebaseui:firebase-ui:1.2.0'
compile 'com.google.firebase:firebase-auth:10.2.0'
You could try 1.2.0 with 10.2.4 or 10.2.6, but may encounter the same problem you are seeing now.
I'm trying to build my Android Studio project with gradle. I added a compile rule as follows:
compile 'com.google.android.gms:play-services:6.5.87'
However it gives the following error:
Error:Module version com.google.android.gms:play-services:6.5.87 depends on libraries but is not a library itself
I have tried changing version and excluding support-v4 module, as mentioned here:
Crouton depends on libraries but is not a library itself
But I cannot solve the error.
Any help would be appreciated.
EDIT: Here is my dependency list from my build.gradle file:
dependencies {
// compile project(':library')
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.android.support:recyclerview-v7:21.0.2'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
compile('org.apache.httpcomponents:httpmime:4.3.5') {
exclude module: 'org.apache.httpcomponents:httpclient'
}
}