Android build gradle failing, Error app:transformClassesWithMultidexlistForDebug' - java

Error Log
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
java.io.IOException: Can't write [D:\Android\testapp\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\Code Nemesis.gradle\caches\transforms-1\files-1.1\support-core-ui-27.1.0.aar\5ded4fc43c89c2e4a62253c7f0400fc3\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]))
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.codenemesis.testapp"
multiDexEnabled true
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.android.gms:play-services:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.android.support:recyclerview-v7:26.+'
implementation 'com.android.support:cardview-v7:26.+'
implementation 'com.firebaseui:firebase-ui-database:0.4.0'
// Photo dependencies
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.android.support:support-v4:26.1.0'
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'
}
apply plugin: 'com.google.gms.google-services'
Already tried: cleaning and rebuilding.

What I have found out is gms:play-services:11.8.0 has conflicts with support:appcompat-v7:26.1.0
disabling any one will work.
I suggest using a specific module of play services. You can check the list here
https://developers.google.com/android/guides/setup
Also use com.theartofdev.edmodo:android-image-cropper:2.5.1 as the 2.6.0 uses sdk v27

Related

ERROR: Failed to resolve: androidx.appcompat:design:1.1.0

when i implementation 'androidx.appcompat:design:1.1.0' code in build gradle(module app)
it says ERROR: Failed to resolve: androidx.appcompat:design:1.1.0
i have try to change the implementation 'androidx.appcompat:appcompat:1.1.0'
in appscompact version it again shows error
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.bottomnavigation"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:design:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
ERROR: Failed to resolve: androidx.appcompat:design:1.1.0
Show in Project Structure dialog
Affected Modules: app
To you Design Support Library for androidx you need to use
Use this
implementation 'com.google.android.material:material:1.0.0'
Instead of
implementation 'androidx.appcompat:design:1.1.0'
The library androidx.appcompat:design doesn't exist.
Check the artifact mapping:
com.android.support:design -> com.google.android.material:material:1.0.0
You can find here the documentation of the Material components library.
To eliminate error,
Instead of this:
implementation 'androidx.appcompat:design:1.1.0'
Write this:
implementation 'com.google.android.material:material:1.2.1'

Failed to resolve Firestore Android Studio

I was following a tutorial for Firestore but then this error occured, I have all the necessary things in my project level Gradle file, I checked the other questions similar to mine, and mine isn't the same scenario. Could you please help?
ERROR: Failed to resolve: com.google.firebase:firebase-firestore:16.0.1
App lvl Gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.blindnews.kimh2.blindnews"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-firestore:16.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
}
apply plugin: 'com.google.gms.google-services'
To solve this, please change the following lines of code:
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-firestore:16.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
to
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-firestore:18.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
In your top level build.gradle file please be sure to have the latest version of Google Service plugin:
classpath 'com.google.gms:google-services:4.2.0'

Program type already present after updating from sdk 27 to 28

After I changed my sdk from 27 to 28 and changed some of the dependencies in my gradle to overcome the problem of manifest merger I faced the error of
Program type already present:android.support.v4.app.INotificationSideChannel
Here is my build.gradle
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.facebook.android:facebook-android-sdk:4.39.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'com.facebook.fresco:fresco:1.10.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
implementation group: 'com.squareup.picasso', name: 'picasso', version: '2.5.2'
implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-perf:16.2.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'joda-time:joda-time:2.9.4'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '27.1.0'
}
}
}
}
I finally found the answer.The issue was with the following dependency
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
I changed it to the following
implementation 'com.commit451:PhotoView:1.2.4'
And it gave me the required zooming properties

Could not resolve com.google.firebase:firebase-database:11.8.0

while adding Firebase database dependency in the file I am having these errors:
Gradle file code is here:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.mymate.myownidea.fawad.my_mate"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-database:11.8.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:27.1.0'
compile 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.2'
compile 'com.google.firebase:firebase-auth:16.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
To solve this, please change the following lines of code:
implementation 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-core:16.0.0'
to
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
And remove this line of code:
compile 'com.google.firebase:firebase-auth:16.0.2'
Don't also forget to add in your top level build.gradle file the latest version of Google Play Services:
classpath 'com.google.gms:google-services:4.0.1'
Please see here more informations.
Do the following things:
Update com.google.gms:google-services from 3.1.1 to 3.2.0:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Change compile to implementation:
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.2'

Error Program type already present: android.support.design.widget.CoordinatorLayout$Behavior

I have error at this line showing
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 26.1.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:customtabs:26.1.0
implementation 'com.android.support:appcompat-v7:26.1.0'
its my
app.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.akhilkumar.chitchat"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:customtabs:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.android.gms:play-services-location:9.2.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-messaging:10.2.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
}
apply plugin: 'com.google.gms.google-services'
This error comes because you can use older version so simply update your version dependencies.
Change :
compileSdkVersion 26 or targetSdkVersion 26
TO
compileSdkVersion 27 or targetSdkVersion 27
Also Change :
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:design:27.1.1'
Sync.. and Clean & ReBuild
I solved this by doing this by simply changing
implementation 'com.android.support:design:26.1.0'
To
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
I hope this helps... also do a gradle update
specifically for react native navigation v2
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.akhilkumar.chitchat"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.android.gms:play-services-location:9.2.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-messaging:10.2.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
}
apply plugin: 'com.google.gms.google-services'

Categories