使用gnustl_shared的Android NDK构建问题

时间:2013-08-14 12:04:06

标签: android c++ c build android-ndk

我的Android NDK项目存在问题。

我的项目包括两个项目:一个库和一个应用程序。

我想使用gnustl_shared并在生成的.apk文件中使用gnustl_shared.so。

所以我的两个Application.mk文件中都有APP_STL:= gnustl_shared。

问题是,如果我这样做,它会给我以下错误:

Error generating final archive: Found duplicate file for APK: lib/armeabi/libgnustl_shared.so
Origin 1: /Volumes/STUFF/repos/trunk/android/MainActivity/libs/armeabi/libgnustl_shared.so
Origin 2: /Volumes/STUFF/repos/trunk/android/MyLib/libs/armeabi/libgnustl_shared.so

如果我只为一个项目使用APP_STL:= gnustl_shared,那么它会构建,但会链接到静态库(实际应该如此)。

有谁知道如何在库和应用程序中再次链接gnustl_shared并避免此错误?任何帮助甚至是线索都非常感激。

1 个答案:

答案 0 :(得分:1)

问题解决了。

  1. 选择图书馆计划
  2. 导航至:Project-> Properties-> Java Build Path
  3. 选择“订购和导出”标签
  4. 取消选中“Android私有库”和“Android依赖关系”
  5. 无论如何,它们将通过应用程序配置添加到最终的.apk中。

相关问题