Android NDK 產生多重cpu類型的so包

來源:互聯網
上載者:User

標籤:android jni   android ndk   android   x86   jni   

1、請參考我的部落格 http://blog.csdn.net/changcsw/article/details/41491257  安裝上 cygwin 環境

2、請參考我的部落格 http://write.blog.csdn.net/postedit/8983907 完成基本的ndk 簡單的產生僅支援 armeabi 的 so包

3、產生 支援多重cpu類型的 so包

     在ndk 目錄對應的目錄下android-ndk-r9d\samples\hello-jni\jni 找到 Application.mk  檔案 將其拷貝到你工程中 jni 目錄下

 開啟 Application.mk檔案 可以看到 APP_ABI := all

若不更改,則 在lib目錄下會產生 armeabi、 armeabi-v7a 、x86、mips 四種類型的so檔案。 若發現有警告:

WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml

 

只需在 Application.mk 檔案中添加一句:APP_PLATFORM := android-8 即可

當然,有的時候可能只需要 armeabi、 armeabi-v7a 這兩中cpu類型的支援,沒必要產生其他的,這時只要 將

Application.mk 檔案中的 APP_ABI := all  改為: APP_ABI := armeabi armeabi-v7a  即可。

Android NDK 產生多重cpu類型的so包

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.