使用cocos compile -p android -m release 报错
今天遇到这个问题,折腾老半天。查了很多资料,都没解决。后来看到一篇类似文章。调试了一下,果然解决了。在这里做个笔记。
参考资料:http://www.cppblog.com/colorful/archive/2014/12/25/209298.aspx
错误如下图:但是使用eclipse生成apk包时不受影响。
BUILD FAILED
D:\AndroidSDK\tools\ant\build.xml:958: The following error occurred while executing this line:
D:\AndroidSDK\tools\ant\build.xml:969: The following error occurred while executing this line:
D:\AndroidSDK\tools\ant\build.xml:312: com.android.sdklib.build.DuplicateFileException: Duplicate files at the same path inside the APK
—— 分析:出现如上错误的原因是在使用“cocos compile”脚本时,库文件被重复添加了
我们在用Eclipse 接SDK的时候,会引用 is librarys 作为参考 库文件
但在命令行下,使用“cocos compile”编译脚本(主要是因为该脚本会将这个/is librarys/ 的文件和资源拷贝的android项目里)这就引起了冲突。而在使用Eclipse打包APK时则不会出现这种情况。
—— 解决:所以,如果你是用命令行打包的话,在project.properties 注释掉你引用的那个工程的代码就OK啦。
#android.library.reference.1=ugpsdk-integration
更多相关文章
- Android(安卓)Studio 安装虚拟机,报错:emulator: ERROR: x86 emula
- 我的Android(安卓)NDK之旅(二),使用ndk-build构建Jni
- Android(安卓)assets目录资源读取
- [置顶] Android应用程序的debug属性
- android文件下载进度条实现
- android asmack 注册 登陆 聊天 多人聊天室 文件传输
- android中的数据存取 之 File
- 安卓SDK接入Unity
- Android(安卓)SearchView