React Native打包Android APK安装包出错: Original is here. The version qualifier may be implied.

React Native项目,用命令打包Android APK安装包,执行命令gradlew assembleRelease后,总是报如下错误:

/Users/liujin/Downloads/xxx/android/app/build/intermediates/res/merged/release/drawable-mdpi-v4/androidjs_imagebag_pageonei_wkt1.jpg: error: Duplicate file.

/Users/liujin/Downloads/xxx/android/app/build/intermediates/res/merged/release/drawable-mdpi/androidjs_imagebag_pageonei_wkt1.jpg: Original is here. The version qualifier may be implied.

解决办法:

用Android Studio打开android目录,找到res/drawable目录,把里面的图片文件都删掉(因为这些图片都是React Native自动生成的,所以删除即可)。再次重新执行gradlew assembleRelease命令就不会报错了。

 

附:《React Native安卓项目打包APK》



发表评论

电子邮件地址不会被公开。