Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.4.0) from

项目接入第三方IM时出现的错误:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.4.0) from [com.android.support:design:25.4.0] AndroidManifest.xml:27:9-31
 is also present at [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 element at AndroidManifest.xml:25:5-27:34 to override.
 

解决方法:

其实这里是依赖的版本和app的版本不一致导致的

 compile 'com.android.support:support-compat:25.4.0'

比如,你导入的依赖的build.gradle里的包是26.0.0的,但是你需要的不是这个版本的,所以你需要降低版本,从而解决版本兼容性的问题

android {
    compileSdkVersion 26
    buildToolsVersion '27'
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 2018090421
        versionName "2.9.6 Stable"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    sourceSets {
        main {
            manifest.srcFile 'src/main/AndroidManifest.xml'
            java.srcDirs = ['src/main/java']
            resources.srcDirs = ['src/main/java']
            renderscript.srcDirs = ['src/main/java']
            res.srcDirs = ['src/main/res']
            assets.srcDirs = ['src/main/assets']
            jni.srcDirs = []
            jniLibs.srcDirs = ['src/main/libs']
        }
    }
}

dependencies {
    compile fileTree(dir: 'src/main/libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:25.4.0'
    compile project (':IMLib')
}

repositories {
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }

 

你可能感兴趣的:(Android常用的技术)