美文网首页
迁移AndroidX问题记录

迁移AndroidX问题记录

作者: HanlyJiang | 来源:发表于2019-12-12 16:37 被阅读0次

    参考

    迁移过程简单记录

    更改 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
    

    相关文章

      网友评论

          本文标题:迁移AndroidX问题记录

          本文链接:https://www.haomeiwen.com/subject/fukupqtx.html