我已经成功配置了android-P SDK环境。当我尝试使用android设计支持库时,我遇到项目构建错误。项目配置为:IDE:3.2 Canary 17目标API:28编译API:28apply plugin: 'com.android.application'apply plugin: 'kotlin-android'apply plugin: 'kotlin-android-extensions'android { compileSdkVersion 28 defaultConfig { applicationId "com.app.navigationpoc" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.0.0-alpha3' implementation 'androidx.constraintlayout:constraintlayout:1.1.1' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.0-alpha3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3' implementation 'com.android.support:design:28.0.0-alpha3' implementation 'com.android.support:cardview-v7:28.0.0-alpha3'}而构建失败的错误是:清单合并失败:[com.android]中还存在[androidx.core:core:1.0.0-alpha3]中的属性application @ appComponentFactory value =(androidx.core.app.CoreComponentFactory) .support:support-compat:28.0.0-alpha3] AndroidManifest.xml:22:18-91 value =(android.support.v4.app.CoreComponentFactory)。建议:在AndroidManifest.xml:6:5-40:19的元素上添加'tools:replace =“ android:appComponentFactory”'以进行覆盖。
3 回答
ibeautiful
TA贡献1993条经验 获得超5个赞
添加:
tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString"
到清单应用程序
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString">
希望能帮助到你
- 3 回答
- 0 关注
- 735 浏览
添加回答
举报
0/150
提交
取消