编译报错
问题1: 引入新库后报错
Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> More than one file was found with OS independent path 'META-INF/proguard/coroutines.pro'
原因:
因为多个依赖库都拥有 META-INF/proguard/coroutines.pro
导致
问题2: 正常代码导入新项目中报错
> Failed to notify project evaluation listener.
> com.android.build.gradle.internal.crash.ExternalApiUsageException: java.util.NoSuchElementException: Collection contains no element matching the predicate.
> kotlin.KotlinNullPointerException (no error message)
原因:
gradle版本的问题
解决方案:
更换 classpath
对应的 gradle
版本
我的版本:
classpath "com.android.tools.build:gradle:4.0.0"