Android Studio上首次使用cocos2d-android出现Duplicate files copied in APK assets/fps_images.png

今天尝试cocos2d,不料才开始就碰见编译问题。
具体报问题如此下。
Error:duplicate files during packaging of APK E:\Project\Android_Studio\Studying\game\build\outputs\apk\game-debug-unaligned.apk
Path in archive: assets/fps_images.png
Origin 1: E:\Project\Android_Studio\Studying\game\build\intermediates\res\resources-debug.ap_
Origin 2: E:\Project\Android_Studio\Studying\game\build\intermediates\transforms\mergeJavaRes\debug\jars\2\1f\main.jar
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'assets/fps_images.png'
}
}
Error:Execution failed for task ':game:packageDebug'.

Duplicate files copied in APK assets/fps_images.png
File1: E:\Project\Android_Studio\Studying\game\build\intermediates\res\resources-debug.ap_
File2: E:\Project\Android_Studio\Studying\game\build\intermediates\transforms\mergeJavaRes\debug\jars\2\1f\main.jar

其实在log中我们可以看到,提示我们添加

packagingOptions {
    exclude 'assets/fps_images.png'
  }

添加后clean下就好了

你可能感兴趣的:(Android Studio上首次使用cocos2d-android出现Duplicate files copied in APK assets/fps_images.png)