【问题标题】:Error : More than one file was found with OS independent path 'META-INF/LICENSE'错误:发现多个文件具有独立于操作系统的路径 'META-INF/LICENSE'
【发布时间】:2018-01-20 10:56:04
【问题描述】:

我有 android 应用程序,我正在使用谷歌翻译 API 当我构建时,我得到了错误: 错误:任务“:app:transformResourcesWithMergeJavaResForDebug”执行失败。发现多个文件具有独立于操作系统的路径“META-INF/LICENSE”

【问题讨论】:

    标签: java android google-translate


    【解决方案1】:

    尝试添加

    packagingOptions {
    
            pickFirst "**"
        }
    

    packagingOptions {
       pickFirst  'META-INF/LICENSE'
    }
    

    packagingOptions{
        exclude 'META-INF/LICENSE'
     }
    

    【讨论】:

      【解决方案2】:

      尝试在您的应用级 gradle 文件中添加这些行

      packagingOptions {
        exclude 'project.properties'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/INDEX.LIST'
      }
      

      【讨论】:

        猜你喜欢
        • 2018-08-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-02-02
        • 1970-01-01
        相关资源
        最近更新 更多