androidx P上的AAR链接参考失败

时间:2018-08-17 21:17:45

标签: android android-library androidx

我的应用正在使用BinTray中的库-AAR。 AAR使用android X并基于P.

使用中的应用程序还针对P。当我尝试构建该应用程序时,出现以下错误:

error: resource style/TextAppearance.Design.Error (aka com.x.x/TextAppearance.Design.Error) not found.  TextAppearance.Design.Error is defined in androidX material design library and is used by the library 

库中的依赖项定义:

implementation "com.google.android.material:material:$android_x_version"

消费者应用程序中的依赖项

 implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    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'
    implementation 'x.x.x.x:mylibrary:0.1.10'

如果我将使用者项目更改为将库用作模块,则会收到另一个错误。我需要图书馆以AAR的形式工作-但这也许可以说明问题!

 implementation project (":mylibrary")

该错误是清单合并错误

Caused by: java.lang.RuntimeException: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0-rc01] AndroidManifest.xml:22:18-91
    is also present at [androidx.core:core:1.0.0-beta01] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-19:19 to override.

消费者应用程序中的清单只是android studio创建的默认清单,因为我想创建一个小型测试项目。该库的清单如下:

<manifest package="x.x.x.mylibrary" />

0 个答案:

没有答案