Manifest Merger Failed issue in the project - java

Following are the error popping up in the output console. Always poping up new error. While opening any of class file there's error coming on the R. Cannot Resolve the symbol R. Please help me out.
Manifest merger failed : Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0-alpha3] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-74:19 to override.
Following the app:Gradle of the project
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.example.lenovo.skanda"
minSdkVersion 18
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:28.0.0'
implementation "androidx.constraintlayout:constraintlayout:2.0.0-alpha1"
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.android.support:cardview-v7:28.0.0'
implementation 'com.github.msayan:tutorial-view:v1.0.6'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.bignerdranch.android:expandablerecyclerview:1.0.3'
implementation 'com.firebaseui:firebase-ui-database:0.4.0'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.firebaseui:firebase-ui-auth:4.2.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'org.greenrobot:eventbus:3.0.0'
//Library for Expendable Text View
implementation 'com.ms-square:expandableTextView:0.1.4'
implementation 'me.biubiubiu.justifytext:library:1.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.airbnb.android:lottie:2.0.0'
implementation 'com.android.support:design:28.0.0'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Thank you very much for your time and assistance in this matter.

This is because your following dependency:
implementation "androidx.constraintlayout:constraintlayout:2.0.0-alpha1"
is clashing with:
implementation 'com.android.support:appcompat-v7:28.0.0'
because both of them have the same attribute:
Attribute application#appComponentFactory
You can fix the problem by using support version of ConstraintLayout with:
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
Or change all of your support library with AndroidX library.

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'

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'

Android build gradle failing, Error app:transformClassesWithMultidexlistForDebug'

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

Categories