android manifest merger failed, gms play services / firebase - android

I am trying to add firebase to my app using the firebaseUI. As the documentations says, I have used the corresponding gms:play-services (11.0.4) with the firebaseUI version (2.2.0)
When I sync the gradle files, I receive following error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(26.0.0) from [com.android.support:support-v13:26.0.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:customtabs:25.4.0] AndroidManifest.xml:25:13-35 value=(25.4.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
This is my gradle file:
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.test.test"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:26.0.0'
compile 'com.android.support:support-v13:26.0.0'
compile 'com.android.support:design:26.0.0'
compile 'com.android.support:recyclerview-v7:26.0.0'
//firebase
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.firebaseui:firebase-ui:2.2.0'
testCompile 'junit:junit:4.12'
}
//firebase
apply plugin: 'com.google.gms.google-services'
I've made sure that all the versions are up to date and that they are all the same. Can't figure out what the problem is?

I solved the problem by adding:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.0.0'
}
}
}
}
from here.
The tooltip recommended adding tools:replace="android:value"' to meta-data but this throws another error, so im going with the solution above

I solved it by adding this in AndroidManifest.xml within the <application> tag at the very bottom:
<meta-data
tools:node="replace"
android:name="android.support.VERSION"
android:value="26.1.0" // <- The max version you see in the error message. For me it was 26.1.0
/>
Then add these two attributes to the <manifest ... > tag:
xmlns:tools="http://schemas.android.com/tools"
tools:node="replace"

It's happening because two versions of support libraries are clashing. On top, you have declared
buildToolsVersion "26.0.1"
and in dependencies, the version is 26.0.0
compile 'com.android.support:design:26.0.0'
Just change the support library version to 26.0.1 and it will work fine. I did the same, worked flawlessly in my case.

add this line at the end of app level gradle file
apply plugin: 'com.google.gms.google-services'

I was able to solve by hoovering over
compile 'com.android.support:appcompat-v7:26.0.0' and adding the libraries manually that it said was wrong such as
compile 'com.android.support:cardview-v7:26.0.0'
compile 'com.android.support:animated-vector-drawable:26.0.0'
compile 'com.android.support:customtabs:26.0.0'

add this line to your manifest
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"
tools:replace="android:value" />
exactly as shown inside the "application" tag.

This type of error has come up because of different libraries added by you.
While adding libraries make sure that all of them are of the same version and work flawlessly with one another.

It occurs when you use different versions of the same library for implementation in the build.gradle of app module. You can solve this by implementing same versions of a library.
If the problem still persists then add the following code at the end of build.gradle(app module)
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.0'
}
}
}
}

Related

AndroidX suddenly causing build failure for NativeScript

All of a sudden, with no changes to my dependencies, I am now getting the following error:
Execution failed for task ':app:processDebugManifest'.
> 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] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:18:2-31:16 to override.
I have tried applying the suggestion (along with the relevant namespace XML attribute), but unfortunately this yields a message along the lines of multiple errors, see logs, but I don't know where the logs are.
I've read and read into this, and I understand it's a problem with attempting to have AndroidX and the now deprecated support libraries at the same time. However, I have not changed any of my dependencies before this suddenly stopped building - only cleared my platforms to force a full rebuild.
I do not know which plugins are conflicting, and I also understand that Jetifier should remedy this, except NativeScript seems to not give me the ability to modify gradle.properties in any persistent way (that I am aware of), and currently the latest version of NativeScript (which is confusing because NativeScript is 5.4.1, TNS core modules is 5.4.2 and the platform added in my package.json seems to be 5.4.0) seems to not utilise Jetifier and the latest AndroidX build on NPM seems to be a bit out of date.
So, how can I get my app back up and running now? Help!
So I fixed this by moving my support dependencies into before-plugins.gradle, which now looks like this:
project.ext {
googlePlayServicesVersion = "15.0.0"
}
dependencies {
compile 'com.squareup.picasso:picasso:2.71828'
def googlePlayServicesVersion = project.googlePlayServicesVersion
compile "com.google.android.gms:play-services-base:$googlePlayServicesVersion"
compile "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
def supportVer = "28.0.0"
compile "com.android.support:support-v4:$supportVer"
compile "com.android.support:appcompat-v7:$supportVer"
compile "com.android.support:design:$supportVer"
}
And for good measure, here's my app.gradle:
android {
defaultConfig {
// Fix for: The number of method references in a .dex file cannot exceed 64K.
// (see: https://developer.android.com/tools/building/multidex.html)
multiDexEnabled true
minSdkVersion 17
generatedDensities = []
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
def settingsGradlePath
if(project.hasProperty("appResourcesPath")){
settingsGradlePath = "$project.appResourcesPath/Android/settings.gradle";
} else {
settingsGradlePath = "$rootDir/../../app/App_Resources/Android/settings.gradle";
}
def settingsGradleFile = new File(settingsGradlePath);
if(settingsGradleFile.exists())
{
apply from: settingsGradleFile;
}
Forcing the following dependencies did it for me.
dependencies {
compile 'com.google.android.gms:play-services-analytics:16.0.4'
implementation('com.google.android.gms:play-services-analytics:16.0.6'){
force = true
}
implementation('com.google.android.gms:play-services-base:16.1.0'){
force = true
}
}
I fixed this by taking a look to ./gradlew app:dependencies and i fixed any package that appeared to be using an updated dependency that uses androidx to a previous version.
So you can see here that tagmanager was resolving as 17 because the dependency uses '+', so instead i fixed this one to 16.0.8
implementation (project(':react-native-device-info')) {
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
}
implementation (project(':react-native-google-analytics-bridge')){
exclude group: 'com.google.android.gms', module: 'play-services-analytics'
exclude group: 'com.google.android.gms', module: 'play-services-tagmanager-v4-impl'
}
implementation (project(':react-native-admob')) {
exclude group: 'com.google.android.gms', module: 'play-services-ads'
}
implementation ('com.google.android.gms:play-services-gcm:16.1.0') {
force = true
}
implementation ('com.google.android.gms:play-services-ads:17.2.0') {
force = true
}
implementation ('com.google.android.gms:play-services-analytics:16.0.8') {
force = true
}
implementation ('com.google.android.gms:play-services-tagmanager-v4-impl:16.0.8') {
force = true
}
I only updated GooglePlayservices to 15.0.0 and added this to the AndroidManifest inside <application>.
<application>
...
<uses-library android:name="org.apache.http.legacy"
android:required="false"/>
...
<application/>
Got same error, check libraries version, for me, Firebase was the problem.
before-plugins.gradle
project.ext {
googlePlayServicesVersion = "15.0.1"
googleFirebaseServicesVersion = "18.0.0"
}
dependencies {
def googlePlayServicesVersion = project.googlePlayServicesVersion
compile "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
compile "com.google.firebase:firebase-messaging:$googleFirebaseServicesVersion"
}

How to solve Manifest merger failed? [duplicate]

This question already has answers here:
Manifest merger failed : Attribute application#appComponentFactory - Androidx
(14 answers)
Closed 7 months ago.
after I set my target and compile sdk versions to 28, I keep seeing this error:
Manifest merger failed : Attribute application#appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:8:5-41:19 to override.
Here is the app:gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
lintOptions {
abortOnError false
}
defaultConfig {
applicationId "com.tawkon.data.lib.indooroutdoor"
minSdkVersion 14
targetSdkVersion 28
versionCode 3
versionName "1.6.4"
}
buildTypes {
release {
debuggable false
}
debug {
debuggable true
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0-rc01'
implementation 'de.greenrobot:eventbus:2.4.1'
implementation 'com.splunk.mint:mint:4.2.1'
implementation 'joda-time:joda-time:2.3'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation project(':library')
}
I tried adding tools:replace="android:appComponentFactory" to application tag in the manifest, but it keep showing the error:
Manifest merger failed with multiple errors, see logs
What can be done to fix this?
Hi if you used androidx then please check your library project all dependency is androidx or not..
and change this dependency
implementation 'com.google.android.material:material:1.0.0'
Go to manifest file. And click on Merged Manifest. There you can find the suggestions just click on replace the error will be solved.
Please change this dependency implementation 'androidx.appcompat:appcompat:1.0.0' to implementation 'com.android.support:appcompat-v7:28.0.0' hopefully it will be of help to you.
follow these steps :-
add these two lines in grade.properties
android.useAndroidX=true
android.enableJetifier=true
Replace implementation 'com.android.support:appcompat-v7:28.0.0' with
implementation 'androidx.appcompat:appcompat:1.1.0'
sync your projects.
After sync project u need to change package name from import android.support.v7.app.AppCompatActivity to import androidx.appcompat.app.AppCompatActivity in Each activity

Can not resolve import LocalBroadcastManager on statement android.support.v4.content.LocalBroadcastManager;

I got this error while importing an eclipse project to Android studio. It shows a suggestion Add library Gradle: com.android.support:support-core-utils-27.1.1 to classpath. I have added the library in my build.gradle file.
Here is my gradle file.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "28.0.0"
defaultConfig {
applicationId "com.example.tracking"
minSdkVersion 17
targetSdkVersion 27
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
allprojects {
repositories {
google()
}
}
dependencies {
implementation project(':asciiProtocol')
implementation project(':deviceList')
implementation project(':captureActivity')
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation "com.android.support:support-core-utils:27.1.1"
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation files('libs/opencsv-2.3.jar')
implementation files('libs/rfid.reader.api.jar')
implementation files('libs/scannercontrol.jar')
implementation files('libs/Zebra.jar')
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.1'
}
}
}
}
}
I googled it but I could not find a proper solution for this. However, I tried the solution from this that isn't the right solution. Any help is appreciated?
I faced the same problem, then I noticed Google divided the v4 support library to multiple packages.
Note: Prior to Support Library revision 24.2.0, there was a single v4 support library. That library was divided into multiple modules to improve efficiency. For backwards compatibility, if you list support-v4 in your Gradle script, your APK will include all of the v4 modules. However, to reduce APK size, we recommend that you just list the specific modules your app needs.
https://developer.android.com/topic/libraries/support-library/packages#v4
Then I checked LocalBroadcast page.
https://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager
At the page top, there is description
belongs to Maven artifact com.android.support:localbroadcastmanager:28.0.0-alpha1
When I faced this problem, the v28.0.0 (not alpha) has been available.
In the end, I changed settings in my build.gradle.
before
implementation 'com.android.support:support-v4:28.0.0'
after
implementation 'com.android.support:localbroadcastmanager:28.0.0'
AndroidX
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
This happened to me while migrating for AndroidX and the solution was to replace "import androidx.core.content.LocalBroadcastManager;" with import androidx.localbroadcastmanager.content.LocalBroadcastManager;
Edited, as required to include the implementation, please don't forget dependency:
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
Noting that Target & Build version are:
compileSdkVersion 29
buildToolsVersion '29.0.2'
Use this
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
instead of
import androidx.core.content.LocalBroadcastManager;
For newer Android version, you should try to add this to gradle.properties
android.enableJetifier=true
and then add this dependency to build.gradle
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
After lot of searching and R&D i found some solution. This is working for me i hope this is helping you.
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'

Android: Getting "Manifest merger failed" error after updating to a new version of gradle

After accepting to update the project to new version of gradle I get this error:
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(26.0.0-alpha1) from [com.android.support:cardview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38
is also present at [com.android.support:design:25.3.1] AndroidManifest.xml:27:9-31 value=(25.3.1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:22:5-24:41 to override.
How can I solve this problem?
This is my app's build.gradle file:
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.sample.bookReader"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
...
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:+'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:design:25+'
compile 'com.jakewharton:butterknife:8.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
...
}
And this is the project's build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://www.jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
How do I fix this error while maintaining the changes made by updating the gradle version?
Put this at the end of your app module build.gradle:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.0'
}
}
}
}
Credit to Eugen Pechanec
You are using multiple versions of the Android Support Libraries:
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:design:25+'
Two are 26.0.0-alpha1, and one is using 25+.
Pick one concrete version and use it for all three of these. Since your compileSdkVersion is not O, use 25.3.1 for all three of these libraries, resulting in:
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
I changed all support library versions to 25.3.1 and worked like a charm:
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
You also need to change compileSdkVersion and targetSdkVersion to 25:
compileSdkVersion 25
targetSdkVersion 25
You can find out what library depends on a wrong version of the support library and exclude it like this:
compile ('com.stripe:stripe-android:5.1.1') {
exclude group: 'com.android.support'
}
stripe-android in my case.
I'm not using different versions of libraries and got the same error, it's happened after remove buildToolsVersion in AS RC 1, but adding tools:node="replace" did the trick, just add this into your manifest.xml inside <application ..../> block:
<meta-data
tools:node="replace"
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
It happen the same thing to me. See on Gradle -> Build Gradle -> and make sure that the compatibility matches in both compile "app compat" and "support design" lines, they should have the same version.
Then to be super sure, that it will launch with no problem, go to File -> Project Structure ->app and check on tab propertie the build Tools version, it should be the same as your support compile line, just in case i put the target SDK version as 25 as well on the tab Flavors.
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.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'*
}
Thats what I did and worked. Good luck!
Update your support library to last version
Open Manifest File , and add it into Manifest File
<uses-sdk tools:overrideLibrary="android.support.v17.leanback"/>
And add for recyclerview in >> build.gradle Module app :
compile 'com.android.support:recyclerview-v7:25.3.1'
And click : Sync Now
I solve that with putting this at the end of my app module build.gradle:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.0.0'
}
}
}
}
The answer are accepted but one thing you could also do is to define the libraries from your project structure. What you can do is :
Comment all the libraries in which problem is coming
Goto your project structure
Add libraries from there and it'll sync automatically and the problem goes off.
If problem persists try looking from the error log that what library is it demanding after following all the above 3 steps.
What happens is the predefined libraries as off now now I'm taking the appcompat:26.0.0-alpha1 it uses the older version of the things when you add something new and tries to resolve it with the old stuffs. When you add it from your project structure, it'll add the same thing but with the new stuffs to resolve it. Your problem would be resolved.
The error for me was:
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(26.0.2) from [com.android.support:percent:26.0.2] AndroidManifest.xml:25:13-35
is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:23:9-25:38 to override.
The solution for me was in my project Gradle file I needed to bump my com.google.gms:google-services version.
I was using version 3.1.1:
classpath 'com.google.gms:google-services:3.1.1
And the error resolved after I bumped it to version 3.2.1:
classpath 'com.google.gms:google-services:3.2.1
I had just upgraded all my libraries to the latest including v27.1.1 of all the support libraries and v15.0.0 of all the Firebase libraries when I saw the error.
I have updated old android project for the Wear OS. I have got this error message while build the project:
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(26.0.2) from [com.android.support:percent:26.0.2] AndroidManifest.xml:25:13-35
is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:23:9-25:38 to override.
My build.gradle for Wear app contains these dependencies:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.support:wearable:2.4.0'
implementation 'com.google.android.gms:play-services-wearable:16.0.1'
compileOnly 'com.google.android.wearable:wearable:2.4.0'}
SOLUTION:
Adding implementation 'com.android.support:support-v4:28.0.0' into the dependencies solved my problem.
Try deleting the meta data and rebuild project.
you try read link this
Error:Execution failed for task ‘:app:processDevDebugManifest’. Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(25.3.0) then usd VERSION 26.0.0
: https://medium.com/#PongPloyAppDev/error-execution-failed-for-task-app-processdevdebugmanifest-48576be751

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'

Good day.
After updating google repository in AndroidStudio, I have an issue
> Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry:
> android/support/v7/cardview/BuildConfig.class
I'm trying to exclude group android.support from play-services, it did not help.
When I started my project on another PC I have:
> Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry:
> android/support/annotation/AnimRes.class
my build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "ru.alexeyk.myevents"
minSdkVersion 14
targetSdkVersion 23
versionCode 16
versionName "1.121"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.github.nkzawa:socket.io-client:0.4.2') {
exclude group: 'org.json', module: 'json'
}
compile files('libs/sentry-1.1.4.jar')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:support-annotations:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:support-v4:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.github.machinarius:preferencefragment:0.1.2'
compile 'com.edmodo:cropper:1.0.1'
compile 'com.makeramen:roundedimageview:2.1.1'
compile 'org.ocpsoft.prettytime:prettytime:4.0.0.Final'
compile 'com.yandex.android:mobmetricalib:2.00#aar'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
}
In terminal execute in root project folder:
./gradlew clean
It helped me.
AndroidStudio Menu:
Build/Clean Project
Update old dependencies
All the above not working for me.. Because I am using Facebook Ad dependency..
Incase If anybody using this dependency compile 'com.facebook.android:audience-network-sdk:4.16.0'
Try this code instead of above
compile ('com.facebook.android:audience-network-sdk:4.16.0'){
exclude group: 'com.google.android.gms'
}
Open your system command prompt/terminal -> Go to your Project folder path (root project folder ) -> Execute following command : command :- gradlew clean or ./gradlew clean
Make sure that all your gradle dependencies are of same version. -> Example :- your appcompat and recyclerview dependencies should have same version.
-> Change your gradle dependencies to same version like :-
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
-> Rebuild your project and it will work fine.
Use project root in terminal like this:-/Users/rajnish/Desktop/RankProjects/ProjectCloud
After that enter this command ./gradlew clean
It will work.
There may be different reason for reported issue, few days back also face this issue 'duplicate jar', after upgrading studio. From all stackoverflow I tried all the suggestion but nothing worked for me.
But this is for sure some duplicate jar is there, For me it was present in one library libs folder as well as project libs folder. So I removed from project libs folder as it was not required here. So be careful while updating the studio, and try to understand all the gradle error.
I got this error because I did not have the correct line in my build.gradle. I am using the org.apache.http.legacy.jar library, which requires this:
android{
useLibrary 'org.apache.http.legacy'
...
}
So check that you have everything in your gradle file that is required.
I resolved the issue by double checking the "libs" directory and removing redundant jars, even though those jars were not manually added in the dependencies.
see if their duplicate jars or dependencies your adding remove it and your error will be gone:
Eg:
if you add android:supportv4 jar and also dependency you will get the error so remove the jar error will be gone
I resolve this is by changing the version no of recyleview to recyclerview-v7:24.2.1.
Please check your dependencies and use the proper version number.
For me the issue was caused by com.google.android.exoplayer conflicting with com.facebook.android:audience-network-sdk.
I fixed the problem by excluding the exoplayer library from the audience-network-sdk :
compile ('com.facebook.android:audience-network-sdk:4.24.0') {
exclude group: 'com.google.android.exoplayer'
}

Categories

Resources