java - com.google.android.material:material:1.1.0-alpha08 fails but 1.0.0 works fine
问题描述
I am looking into the new android material stuff and it looks fine but in order to properly utilise the colour options I need to use com.google.android.material:material:1.1.0 (the latest of which is alpha08) clearly there is a dependency issue because when I build in android studio it says all ok but when I run it is is missing
android material com.android.builder.dexing.DexArchiveBuilderException
at run time (like this).
this is my app.build.gradle
dependencies {
implementation 'androidx.core:core:1.0.2'
implementation 'androidx.media:media:1.0.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
implementation 'com.google.android.material:material:1.0.0' // fails if I switch to implementation 'com.google.android.material:material:1.1.0-alpha08'
api 'com.google.guava:guava:28.0-android'
implementation files('libs/acra-4.5.0.jar')
implementation files('libs/commons-collections-3.2.1.jar')
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
}
as far as I can tell everything us in tip top shape so what is the issue do you think?
解决方案
我发现这是原因,将其添加到build.gradle [Module.app]
文件中
android {
[.YOUR.OTHER.STUFF.HERE.]
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
推荐阅读
- java - Selenium:在字符串中存储时 XPATH 无效
- cloud-foundry - 为什么云代工从 DEA 转移到 diego
- android - 在将数据添加到 recyclerview 时添加(或重新输入)片段时,片段事务滞后
- javascript - 如何使用“$(this)”删除表中的类
- .htaccess - 仅 HTTPS 的 301 问题
- apache - 使用 index.php 将 htaccess 旧文件夹重定向到新文件夹
- haskell - 不确定如何使用给定的数据类型
- java - 将 Spark SQL 与 Spark 流结合使用
- javascript - FormArray 无效但不包含错误
- python - Python:在创建字典时用作字典值时调用方法