簡體   English   中英

Android:清單合並失敗

[英]Android: Manifest merger failed

我似乎收到以下錯誤:

錯誤:任務':app:processDebugManifest'的執行失敗。>清單合並失敗:來自[com.android.support:appcompat-v7的屬性元數據#android.support.VERSION@value value =(26.0.0-alpha1) :26.0.0-alpha1] AndroidManifest.xml:27:9-38也出現在[com.android.support:exifinterface:25.3.1] AndroidManifest.xml:24:9-31 value =(25.3.1)。 建議:在AndroidManifest.xml:25:5-27:41的元素上添加'tools:replace =“ android:value”'以進行覆蓋。

當我包括以下圖像裁剪庫時,似乎是導致了此錯誤:編譯'com.theartofdev.edmodo:android-image-cropper:2.4。+'

Gradle構建

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"

    defaultConfig {
        applicationId "com.myproj.blogapp"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.android.support:cardview-v7:26.0.+'
    compile 'com.android.support:recyclerview-v7:26.0.+'
    compile 'com.squareup.picasso:picasso:2.5.2'


    compile 'com.google.firebase:firebase-core:11.0.4'
    compile 'com.google.firebase:firebase-database:11.0.4'
    compile 'com.google.firebase:firebase-appindexing:11.0.4'
    compile 'com.google.firebase:firebase-storage:11.0.4'
    compile 'com.google.firebase:firebase-crash:11.0.4'
    compile 'com.google.firebase:firebase-auth:11.0.4'
    compile 'com.firebase:firebase-client-android:2.3.1'
    compile 'com.squareup.okhttp:okhttp:2.7.5'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+' //This dependency causing error

    // FirebaseUI Database only
    compile 'com.firebaseui:firebase-ui-database:2.1.1'

}
apply plugin: 'com.google.gms.google-services'

Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.myproj.blogapp"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        tools:node="replace"
        android:name=".SimpleBlog"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="PT Mosque"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:label="Feed">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
            android:theme="@style/Base.Theme.AppCompat" />
        <activity
            android:name=".PostActivity"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name=".timetable"
            android:label="Salah Times"
            android:windowSoftInputMode="adjustResize" />
        <activity android:name=".RegisterActivity" />
        <activity android:name=".LoginActivity" />
        <activity android:name=".SetupActivity"></activity>
    </application>

</manifest>

更改

 compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
 compile 'com.android.support:design:26.0.0-alpha1'
 compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'

 compile 'com.android.support:appcompat-v7:26.+'
 compile 'com.android.support:support-v4:26.+'
 compile ('com.theartofdev.edmodo:android-image-cropper:2.4.+'){

        exclude group: 'com.android.support'  
}

將此添加到

xmlns:tools =“ http://schemas.android.com/tools”將此添加到

工具:節點=“替換”

圖像裁剪器庫需要比您的應用程序更舊的支持庫。 該庫的問題已經有一個新的錯誤,但尚未修復。

您可以將應用程序使用的支持庫版本降級(至25.3.1),然后等待修復。

編輯:您需要相應地降低構建目標。 github上還有一個構建目標錯誤

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM