简体   繁体   English

Android Studio 1.3,为什么我的APK中未包含.so文件

[英]Android Studio 1.3, why aren't .so files included in my APK

I am new to Android Studio. 我是Android Studio的新手。 I am using Android Studio 1.3 because it has built in NDK support. 我使用的是Android Studio 1.3,因为它内置了NDK支持。 I have a project that can be used as an application or as a library project. 我有一个可用作应用程序或库项目的项目。 When I imported it to Android Studio as an application (and modified the gradle scipts as documented), it built the .so files and included them in the .apk output. 当我将其作为应用程序导入到Android Studio(并按照文档所述修改了gradle scipts)时,它生成了.so文件并将其包含在.apk输出中。 When I modified it to be a library project, it is building the .so files, but not including them in the .aar output and hence they are missing in the final .apk. 当我将其修改为图书馆项目时,它正在构建.so文件,但不将它们包括在.aar输出中,因此最终的.apk中将丢失它们。 Should I have to do anything to inform it to put the .so files into the .aar? 我是否需要做任何事情通知它将.so文件放入.aar? If so, what should I do? 如果是这样,我该怎么办?

Are you building your .so files by calling ndk-build or by using the gradle or gradle-experimental plugin ? 您是通过调用ndk-build还是使用gradle或gradle-experimental插件来构建.so文件?

If your .so files are already built, you can just drop them inside src/main/jniLibs/ folders and they should get included into the .aar as well as the APK. 如果您的.so文件已经构建,则可以将其放入src / main / jniLibs /文件夹中,并且它们应同时包含在.aar和APK中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM