【发布时间】:2019-03-12 07:22:52
【问题描述】:
我在编译时收到以下错误。
清单合并失败:属性 application@appComponentFactory 值=(android.support.v4.app.CoreComponentFactory)来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 也出现在 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 值=(androidx.core.app.CoreComponentFactory)。建议:加 'tools:replace="android:appComponentFactory"' 到元素 在 AndroidManifest.xml:5:5-27:19 处进行覆盖。
谁能帮我解决这个问题。
build.gradle
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//additional android libs
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
// third-party libs
implementation 'com.jakewharton:butterknife:10.1.0' // butter-knife
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0' // butter-knife
implementation 'com.stepstone.stepper:material-stepper:4.3.1' // registration stepper
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example">
<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=".RegisterTravelerActivity"></activity>
<activity
android:name=".LoginActivity"
android:theme="@style/AuthTheme" />
<activity
android:name=".SplashActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:theme="@style/SplashScreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
【问题讨论】:
-
它不工作。给出另一个错误
Android Material and appcompat Manifest merger failed我发现原因是ButterKnife库。有什么想法吗? -
迁移到 Android X 并在 gradle 文件中添加 Java 8 的编译选项。
标签: android