相关疑难解决方法(0)

Android:更新到新版本的gradle后出现"Manifest merger failed"错误

在接受将项目更新为新版本的gradle后,我收到此错误:

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.
Run Code Online (Sandbox Code Playgroud)

我怎么解决这个问题?这是我的应用程序build.gradle文件:

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'
    ...
}
Run Code Online (Sandbox Code Playgroud)

这是项目的build.gradle …

android

107
推荐指数
6
解决办法
13万
查看次数

AndroidManifest:找不到资源整数/google_play_services_version

我有一个 android Studio (3.2.1) 应用程序,带有基本模块和instantApp功能,目标 API 是28。自从我添加 Firebase 以来,我开始在标题中出现这个明显的合并错误,我解决了添加:

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
Run Code Online (Sandbox Code Playgroud)

基本应用程序清单中,正如有关此主题的许多答案中提到的那样。

应用程序运行正常并且 firebase 的东西可以工作,但是集成测试(和即时应用程序)因错误而中断:

resource integer/google_play_services_version (aka it.future.futureandroid.app:integer/google_play_services_version) not found.

请注意,我apply plugin: 'com.google.gms.google-services'也在基本应用程序 gradle 中添加了,而云消息传递依赖项仅在功能模块内指定:

implementation 'com.google.firebase:firebase-messaging:17.3.4'

在项目级别的 build.gradle 中我添加了:

classpath 'com.google.gms:google-services:4.2.0'
Run Code Online (Sandbox Code Playgroud)

我已经尝试添加类似configurations.all问题中所报告的内容,但没有成功。看来,仅使用 instantApp 和集成测试的清单合并无法解决该 integer/google_play_services_version

android firebase

5
推荐指数
0
解决办法
2220
查看次数

标签 统计

android ×2

firebase ×1