问题描述
我正在为Android开发一个C ++共享库.我使用Android Studio创建了新项目并启用了C ++.
I am making a C++ share library for Android. I created new project with Android Studio and enabled C++.
我还启用了C ++ 11 ans异常支持.
I also enabled C++ 11 ans Exception support.
创建了新项目,并生成了build.gradle
和CMakeLists.text
文件.问题在于,Adnroid Studio仅生成* .so库的调试版本.我也需要生成发行版本.
New project was created and the build.gradle
and CMakeLists.text
files were generated. The problem is that Adnroid Studio is only generating a Debug version of the *.so library. I need the release version to be generated too.
正在通过
我注意到
但是它是空的.它没有该库的发行版.
but it is empty. It does not have the release version of the library.
如何强制Android Studio构建/编译* .so库的发行版.我把这些图像放起来,以确保我不会错过任何一步.
How can I force Android Studio to build/compile the release version of the *.so library. I put those images up to make sure that I didn't miss any step.
使用 Android Studio 2.3 .
推荐答案
在Android Studio中玩转,发现可以通过选择要进入 Build 的项目(应用)的Root来更改此设置- -> 选择Build Variant ... ,然后将 Build Variant 从 Debug 更改为 Release .
Played around with Android Studio and discovered that this can be changed by selecting the Root of your project (app) going to Build --> Select Build Variant... then change the Build Variant from Debug to Release.
这篇关于使用Android Studio构建共享* .so库的发行版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!