LoginSignup
0
0

More than 5 years have passed since last update.

[Android]ビルド時の"Duplicate files copied in APK META-INF/LICENSE"対策

Posted at

各種ライブラリをアップデートしたりすると、ビルド時に以下のようなエラーが出てくることがあります。

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > 
com.android.build.api.transform.TransformException: 
com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE

対策方法として、appフォルダ以下のbuild.gradleファイルに以下を追加編集することで解決できます。

android {
    ~(中略)

    packagingOptions {
        exclude 'META-INF/LICENSE'
    }

    ~(中略)
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0