我正在阅读关于Android的房间库.我看到他们改变包装android来androidx.我不明白.请有人解释一下.
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
Run Code Online (Sandbox Code Playgroud)
即使这也适用于android包装.
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
Run Code Online (Sandbox Code Playgroud)
androidx而不是android.android android-architecture-components android-jetpack androidx
使用Google所谓的Material Design 2.0需要您添加
implementation 'com.google.android.material:material:1.0.0-rc01'
Run Code Online (Sandbox Code Playgroud)
在应用程序Gradle中也包括
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
Run Code Online (Sandbox Code Playgroud)
这显示了冲突
这是日志所说的内容
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0-rc02] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0-rc01] 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.
Run Code Online (Sandbox Code Playgroud)
即使在将其添加到Manifest之后,它也显示Manifest Merger因多次错误而失败
以下是我得到的错误
C:\Users\Dell\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\51cd62c84e9404bd66ab4daf252c48a1\res\values-v28\values-v28.xml
Error:(9, 5) error: resource android:attr/dialogCornerRadius not found.
C:\Users\Dell\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\51cd62c84e9404bd66ab4daf252c48a1\res\values\values.xml
Error:(252, 5) error: resource android:attr/fontVariationSettings not found.
Error:(252, 5) error: resource android:attr/ttcIndex not found.
E:\20thJune2017_7PM\trunk\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml
Error:(11) error: resource android:attr/dialogCornerRadius not found.
Error:(7) resource android:attr/dialogCornerRadius not found.
Error:(11) resource android:attr/dialogCornerRadius not found.
E:\20thJune2017_7PM\trunk\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Error:(486) resource android:attr/fontVariationSettings not found.
Error:(486) resource android:attr/ttcIndex not found.
Error:failed linking references.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution …Run Code Online (Sandbox Code Playgroud)