迁移AndroidX问题记录
2019-12-12 本文已影响0人
HanlyJiang
参考
迁移过程简单记录
更改 compileSDKVerion 和 gradle plugin 版本
compileSdkVersion 28
classpath 'com.android.tools.build:gradle:3.2.0'
迁移
image.png若干问题记录
迁移完成后 gradle sync 失败 duplicate entry: META-INF/NOTICE.txt
Could not resolve all files for configuration ':app:nskst_test_wuhan_fixedDebugCompileClasspath'.
> Failed to transform file 'utils.jar' to match attributes {artifactType=processed-jar} using transform JetifyTransform
> Failed to transform '/app/libs/utils.jar' using Jetifier. Reason: duplicate entry: META-INF/NOTICE.txt. (Run with --stacktrace for more details.) To disable Jetifier, set android.enableJetifier=false in your gradle.properties file.
解决
找到对应的jar,发现有重复文件,使用zip命令删除
$ zip utils.jar -d META-INF/LICENSE.txt
deleting: META-INF/LICENSE.txt
deleting: META-INF/LICENSE.txt
deleting: META-INF/LICENSE.txt
deleting: META-INF/LICENSE.txt
$ zip utils.jar -d META-INF/NOTICE.txt
deleting: META-INF/NOTICE.txt
deleting: META-INF/NOTICE.txt