Include Native *.so Library in APK With Android Studio
Originally posted on:http://www.kylethielk.com/blog/include-native-so-library-in-apk-with-android-studio/
Using the Android NDK is well documented throughout the internet if you are still using Eclipse. The process is basically the same with Android Studio until the time comes to build your APK. The APK will build fine, but your library *.so file will be missing from the APK and when you attempt to load it with System.loadLibrary(“mylibrary”) you will get:
1 |
|
You can view the contents of your APK with the following command to verify libmylibrary.so is not in the APK:
1 |
|
Android Studio’s build tool will not look in the usual place:
1 |
|
The trick (thanks to this thread: https://groups.google.com/forum/#!msg/adt-dev/nQobKd2Gl_8/Z5yWAvCh4h4J) is to move libmylibrary.so to:
1 |
|
Voila, your native code is now compiled into your APK. This should work with build tools 0.8+
Include Native *.so Library in APK With Android Studio的更多相关文章
- Support Library官方教程(3)android studio中导入支援包
Support Library Setup How you setup the Android Support Libraries in your development project depend ...
- 使用Android design support library在Eclipse和Android Studio
背景:为了在低版本号下使用Android 5.0的一些新特新 Eclipse篇: 1.将Android Manager中的Android support library升级到最新,我的为22.2.1' ...
- APK在Android Studio下如何签名
apk签名的意义 Android系统要求每一个Android应用程序必须要经过数字签名才能够安装到系统中,也就是说如果一个Android应用程序没有经过数字签名,是没有办法安装到系统中的! Andro ...
- 【转】如何使用Android Studio把自己的Android library分发到jCenter和Maven Central
转自:http://www.devtf.cn/?p=760&utm_source=tuicool 如何使用Android Studio把自己的Android library分发到jCenter ...
- 如何通过Android Studio发布library到jCenter和Maven Central
http://www.jianshu.com/p/3c63ae866e52# 在Android Studio里,如果你想引入任何library到自己的项目中,只需要很简单的在module的build. ...
- Android Studio将引用第三方jar包的library打包成jar包
在该module的build.gradle中添加 task makeJar(type: Jar) { archiveName 'mysdk.jar' from('build/intermediates ...
- (转载) android studio library生成jar包和aar的方法总结
android studio library生成jar包和aar的方法总结 标签: android学习文档jar和aar的使用与生成gradle 2016-11-25 10:39 1782人阅读 评论 ...
- Android Studio编译好的apk放在哪里?
Eclipse中编译好的apk文件时在bin文件中面的,可是在Android Studio有一个比較大的修改了,编译好的apk在android studio里面是直接看不到了,并且apk文件所在文件夹 ...
- 【Android Studio安装部署系列】十、Android studio打包发布apk安装包
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 使用Android studio发布apk安装包的操作步骤. 开始打包发布apk Build > Generate Signe ...
随机推荐
- js贪吃蛇
function init() { w = 40; m = 20; d = w * m / 2; food = null; dm = new ht.DataModel(); g3d = new ht. ...
- mysql TRUNCATE
保留小数点 select truncate(field1,2) from table1 field3 字段类型为decimal(20,3)
- Redis 在windows环境下安装
一.下载适合自己的windows版本 下载地址:https://github.com/dmajkic/redis/downloads 当你解压后,就拥有了全套的应用文件
- 不变性、协变性和逆变性(Invariance, Covariance & Contravariance)
源码下载 一.里氏替换原则(Liskov Substitution Principle LSP) 我们要讲的不是协变性和逆变性(Covariance & Contravariance)吗?是的 ...
- 微软职位内部推荐-SDE II
微软近期Open的职位: Senior Software Development Engineer Job Title: Senior Development Engineer Division: V ...
- 在Eclipse中怎样写Java注释
java中的注释分为实现注释和文档注释 实现注释就是那些/……../和//……的注释,是注释程序用的,文档注释是/*……./的注释,是用来生成javadoc的.设置方法如下: 1.打开Eclipse的 ...
- iOS基础问答面试
<简书社区 — Timhbw>iOS基础问答面试题连载(一)-附答案:http://www.jianshu.com/p/1ebf7333808d <简书社区 — Timhbw> ...
- DataTable分组归类
我们在做项目的时候,经常需要根据表或DataTable中某些字段来归类,为此就写出以下方法,帮组需要的人. #region 对DataTable进行分组 + public void GroupData ...
- 【Roman To Integer】cpp
题目: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from ...
- linux下在某行的前一行或后一行添加内容
linux的sed工具是十分强大的,能很容易的实现在某关键词的前一行或后一行增加内容.今天在批量修改tomcat的日志时就用到了该功能. 一.在某行的前一行或后一行添加内容 具休操作如下: #匹配行前 ...