今天遇到这个问题,折腾老半天。查了很多资料,都没解决。后来看到一篇类似文章。调试了一下,果然解决了。在这里做个笔记。

参考资料: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

更多相关文章

  1. Android(安卓)Studio 安装虚拟机,报错:emulator: ERROR: x86 emula
  2. 我的Android(安卓)NDK之旅(二),使用ndk-build构建Jni
  3. Android(安卓)assets目录资源读取
  4. [置顶] Android应用程序的debug属性
  5. android文件下载进度条实现
  6. android asmack 注册 登陆 聊天 多人聊天室 文件传输
  7. android中的数据存取 之 File
  8. 安卓SDK接入Unity
  9. Android(安卓)SearchView

随机推荐

  1. EditText
  2. Android(安卓)Studio第六期 - 横向GridVi
  3. Android(安卓)layout_weight案例分析总结
  4. Android--遍历SQLite数据库下的所有表名
  5. android实现回车键的监听
  6. Android取得系统信息和分辨率内存信息
  7. Android--取得布局中指定控件的宽高
  8. Android(安卓)按键驱动
  9. Android(安卓)ListView二三事
  10. 删除android ScrollView边界阴影方法