Gradle Manifest Merger failed after adding compile RecyclerView - android

This error message popped up after being able to import RecyclerView. I can't find the source, or a fix. The error message seems pretty hard to follow as well.
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:recyclerview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:25:5-27:34 to override.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.me.listviewprojektfuerapp">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".ui.ListActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
build.gradle(module:app) :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.me.listviewprojektfuerapp"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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:recyclerview-v7:26.0.0-alpha1'
}

You are using com.android.support:appcompat-v7:25.3.1 and also com.android.support:recyclerview-v7:26.0.0-alpha1, recycler view is a part of appcompact library and hence the clash and also it is advisable to use same library versions
for more reference - https://developer.android.com/topic/libraries/support-library/features.html

You need to compile with this version of recyclerView
compile 'com.android.support:recyclerview-v7:25.3.1'

tools:replace="android:value"<==== put it on your in application attributes or you can make 2 version of both library to same version.

Related

Manifest merger failed when importing tableview

I wanted to use table view in my android application but i get the following error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application#label value=(Curtain Club) from AndroidManifest.xml:13:9-37
is also present at [de.codecrafters.tableview:tableview:2.8.0] AndroidManifest.xml:11:18-50 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:10:5-139:19 to override.
Here is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "Calculator.curtainclub"
minSdkVersion 23
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 {
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'de.codecrafters.tableview:tableview:2.8.0'
implementation 'com.android.support:wear:26.1.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testCompile 'junit:junit:4.12'
compile project(':jtds-1.3.1')
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestCompile 'com.android.support.test:runner:1.0.2'
androidTestCompile 'com.android.support:support-annotations:27.1.1'
compile files('libs/mail.jar')
compile files('libs/additionnal.jar')
compile files('libs/activation.jar')
}
if i remove the table view library, my gradle syncs perfectly with no errors
Here is my manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="Curtain Club"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".LoginLogout.login">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Employees.AdminLogin" />
<activity android:name=".Calculator.Calc_140_pattern"></activity>
</application>
Please note i have opted out some activity files because there is a lot and it wouldn't allow me to add the question because of too much code
In your manifest file replace this
android:label="Curtain Club"
with
#string/curtain_club
Now Go to your strings.xml file and write this
<string name="curtain_club">Curtain Club</string>
After that rebuild your project

Android studio gives me an error when I try to add the Google Play Services Maps function

I've been having a lot of issue with my dependencies on this project. I was trying to add Google Maps to my app, but when I do I receive this error:
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta data#android.support.VERSION#value value=(26.0.1) from
AndroidManifest.xml:16: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:14:9-16:38 to override.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
lintOptions {
abortOnError false
}
defaultConfig {
applicationId "com.example.leoconnelly.connexus"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildToolsVersion '26.0.1'
//buildToolsVersion "26.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '26.0.2'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
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'
implementation 'com.android.support:design:26.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
//Helpshift
// use version 26.1.0 instead of 26.0.2
implementation 'com.android.support:recyclerview-v7:26.0.1'
implementation 'com.android.support:cardview-v7:26.0.1'
implementation('com.helpshift:android-helpshift-en-aar:6.4.2') {
exclude group: 'com.android.support'
exclude module: 'design'
exclude module: 'recyclerview'
exclude module: 'cardview-v7'
}
implementation 'com.google.android.gms:play-services-maps:15.0.0'
}
and here is my manifest:
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.leoconnelly.connexus">
<application android:allowBackup="true" android:icon="#mipmap/ic_launcher"
android:label="#string/app_name" android:roundIcon="#mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HealthCenterListActivity" />
<activity android:name=".HealthCenterSelectedActivity" />
<activity android:name=".MoreInfoActivity" />
<meta-data
android:name="android.support.VERSION"
android:value="26.0.1" />
</application>
This issue only occurs when google play services are added. This is difficult because when I added helpshift yesterday, I had to change a lot of dependencies. Any advice on how to get this to work?
Try adding exclude module:support-v4 to helpshift and add support-v4 library to override another support library:
implementation 'com.android.support:support-v4:26.0.1'
implementation('com.helpshift:android-helpshift-en-aar:6.4.2') {
exclude group: 'com.android.support'
exclude module: 'design'
exclude module: 'recyclerview'
exclude module: 'cardview-v7'
exclude module:support-v4
}

Android, Getting an error, Execution failed for task ':app:processDebugManifest'. > Manifest merger failed, when trying to integrate Helpshift plugin

I'm getting this error with my code when I try and implement a plugin called Helpshift.
Error:Execution failed for task ':app:processDebugManifest'.>
Manifest merger failed : Attribute
meta-data#android.support.VERSION#value value=(26.0.1) from
AndroidManifest.xml:16:13-35 is also present at
[com.android.support:design:26.1.0] AndroidManifest.xml:28:13-35
value=(26.1.0). Suggestion: add 'tools:replace="android:value"' to
element at AndroidManifest.xml:14:9-16:38 to override.
I think it has something to do with the versions of the app.
Here's my manifest file:
<?xml version="1.0" encoding="UTF-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.leoconnelly.connexus">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26" android:compileSDKVersion="26" android:buildToolsVersion="26" />
<application android:allowBackup="true" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" android:roundIcon="#mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HealthCenterListActivity" />
<activity android:name=".HealthCenterSelectedActivity" />
<activity android:name=".MoreInfoActivity" />
<meta-data
android:name="android.support.VERSION"
android:value="26.0.1" />
</application>
and here is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
lintOptions {
abortOnError false
}
defaultConfig {
applicationId "com.example.leoconnelly.connexus"
minSdkVersion 23
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.constraint:constraint-layout:1.0.2'
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'
implementation 'com.android.support:design:26.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
//Helpshift
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
compile 'com.helpshift:android-helpshift-en-aar:6.4.2'
}
I beleive I'm doing something wrong with the versions, but when I change them I get a whole other error. Any help is apperciated.
remove this line in the manifest file:
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26" android:compileSDKVersion="26" android:buildToolsVersion="26" />
and in your build.gradle add this line in defaultConfig section:
buildToolsVersion '26.1.0'
do what #prem said above
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
Instead of this
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
In case the support library is a hard dependency in Helpshift sdk, you can exclude it and using your selected support library version with something like this:
//Helpshift
// use version 26.1.0 instead of 26.0.2
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
// exclude the support library
implementation ('com.helpshift:android-helpshift-en-aar:6.4.2') {
exclude group: 'com.android.support'
exclude module: 'design'
exclude module: 'recyclerview'
exclude module: 'cardview-v7'
}

Could not find method complie() for arguments whilst adding recyclerView dependency

I am trying to add a dependency so I can use RecyclerView.
In andriod studio I went to build > edit libraries and dependencies. Then searched for Recycler in the choose library dependency. I found the library below.
com.android.support:recyclerview-v7 (com.android.support:recyclerview-v7:26.0.0-alpha1)
After adding this though the gradle could not build. I read on here that it was due to the version and that is should be changed to 'com.android.support:recyclerview-v7:25.3.1'.
However now I am getting a different error message which I don't follow,
Error:(30, 1) A problem occurred evaluating project ':app'.
Could not find method complie() for arguments [com.android.support:recyclerview-v7:25.3.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.xxx.yyyyyyyyy"
minSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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'
complie 'com.android.support:recyclerview-v7:25.3.1'
}
manifest
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
You have complie instead of compile.
Could not find method complie()
There is a small typo in your dependencies
Change:
complie 'com.android.support:recyclerview-v7:25.3.1'
with:
compile 'com.android.support:recyclerview-v7:25.3.1'

Android Studio Multiple Dex file dependencies defined error

I have been trying for a week and have never tried solutions in sites.
Error Current.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException: com.android.dex.DexException:
Multiple dex files define
Lcom/google/android/gms/internal/zzaac$zza;
Gradle codes
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
//multiDexEnabled true
}
defaultConfig {
applicationId "com.oyunlar.dortislem"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
//multiDexEnabled = true
}
buildTypes {
release {
//multiDexKeepProguard 'multidex-config.pro'
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
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:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.google.firebase:firebase-database:10.2.0'
//compile 'com.google.firebase:firebase-core:10.0.1'
//compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
//compile 'com.google.firebase:firebase-crash:10.0.1'
//compile 'com.google.firebase:firebase-ads:10.0.1'
testCompile 'junit:junit:4.12'
//compile 'com.google.android.gms:play-services:10.2.1'
//compile 'com.google.android.gms:play-services-maps:10.2.1'
}
apply plugin: 'com.google.gms.google-services'
AndroidManifest codes:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.oyunlar.dortislem">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme1"
>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DortislemOyunu"></activity>
<activity android:name=".DortislemOyunuSonuc"></activity>
<activity android:name=".TopList"></activity>
<activity android:name=".NtGirisGiris"></activity>
<activity android:name=".Admin"></activity>
</application>
</manifest>
Thank you
Thanks a lot. But now the bottom error is coming out.
enter image description here
You are including all Play services in your project. Only add those you want. For example, if you are using only maps, then change
compile 'com.google.android.gms:play-services:8.1.0'
to
compile 'com.google.android.gms:play-services-maps:8.1.0'
From the doc:
In versions of Google Play services prior to 6.5, you had to compile
the entire package of APIs into your app. In some cases, doing so made
it more difficult to keep the number of methods in your app (including
framework APIs, library methods, and your own code) under the 65,536
limit.
From version 6.5, you can instead selectively compile Google Play
service APIs into your app. For example, to include only the Google
Fit and Android Wear APIs, replace the following line in your
build.gradle file:
compile 'com.google.android.gms:play-services:8.3.0'
with these lines:
compile 'com.google.android.gms:play-services-fitness:8.3.0'
compile 'com.google.android.gms:play-services-wearable:8.3.0'
Or you can try like this in app build.gradle:
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 25
...
// Enabling multidex support.
multiDexEnabled true
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
In your manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.multidex.myapplication">
<application
...
android:name="android.support.multidex.MultiDexApplication">

Categories

Resources