Merge manifest error - support: appcompat-v7: 26. +
Error: Execution completed for task ': app: processDebugManifest'. Failed to merge manifest: meta-data attribute # android.support.VERSION@value value = (25.3.1) from [com.android.support:cardview-v7:25.3.1] AndroidManifest.xml: 24: 9-31 also present in [com.android.support:appcompat-v7:26.0.0-alpha1] AndroidManifest.xml: 27: 9-38 value = (26.0.0-alpha1). Suggestion: Add "tools: replace =" android: value "" to item in AndroidManifest.xml: 22: 5-24: 34 to override.
I am trying to build an app with a target SDK of 26. The app needs the Facebook SDK (the latter according to Facebook SDK version 4.25.0.
Volley - Version 1.0.0 ( Android Volley Dev Page )
I can only assume from error that some of these SDKs are sharing libraries, but one downloads a different version to another ... so I need to add some form of "download this, not this" like in my Gradle file? Or am I just missing something?
The above error occurs with my Gradle Build files shown below.
Gradle Project Build:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Gradle build app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.johnny.fibre"
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 {
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.facebook.android:facebook-android-sdk:4.25.0'
compile 'com.android.support:appcompat-v7:26.+'
//compile "com.android.support:support-core-utils:25.+"
compile 'com.android.volley:volley:1.0.0'
//compile 'com.android.support:support-v4:26.0.0'
testCompile 'junit:junit:4.12'
}
My AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.johnny.fibre">
<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/Theme.AppCompat.DayNight.NoActionBar">
<uses-permission android:name="android.permission.INTERNET"/>
<activity android:name=".Home">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks for any help! I comment and change SDK versions and all sorts of ...
source to share
I solved the problem by further browsing the forum:
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:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:customtabs:26.0.0-alpha1'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
}
Dependencies
com.android.support:cardview-v7:26.0.0-alpha1
compile 'com.android.support:customtabs:26.0.0-alpha1'
seems to solve the problem.
source to share
facebook sdk
uses 'com.android.support:appcompat-v7:25.3.1'
also 'com.android.support:support-v4:25.3.1'
in its dependencies.
This error will be resolved if you exclude support-v4
depend on facebook like below:
compile (‘com.facebook.android:facebook-android-sdk:4.25.0’){
exclude group: 'com.android.support', module: 'support-annotations'
}
or exclude it from compile 'com.android.support:appcompat-v7:26.+'
in your dependencies.
source to share
Eliminate dependencies on libraries causing problems :-) Let's see an example:
implementation("com.jakewharton.rxbinding2:rxbinding:1.0.2") {
exclude group: 'com.android.support'
}
You can more accurately add the module you want to exclude and also:
exclude group: 'com.android.support', module: 'appcompat-v7'
source to share
I solved this problem by changing the following compile files in build.gradle in my app folder. I am now using these compilation files.
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:customtabs:26.+'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:26.+'
before changing i use these files
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:customtabs:26.0.0-alpha1'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
Just change the compilation version of the files. Use "26. +" instead of "26.0.0-alpha1"
thank
source to share