使用Android Studio构建共享* .so库的发行版本 [英] Build release version of shared *.so library with Android Studio

查看:204
本文介绍了使用Android Studio构建共享* .so库的发行版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为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.gradleCMakeLists.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.

正在通过

\ app \ build \ intermediates \ cmake \ debug \ obj \\ libnative-lib.so

\app\build\intermediates\cmake\debug\obj\\libnative-lib.so

我注意到

\ app \ build \ intermediates \ cmake \ debug \ obj \

\app\build\intermediates\cmake\debug\obj\

但是它是空的.它没有该库的发行版.

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库的发行版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆