Compiling JNI with the NDK that comes with Android studio

Source: Internet
Author: User

/********************************************************************************** * using Android Stu Dio's own NDK compiled JNI * Description: * Save yourself the additional download NDK, compile Jni, trouble. * 2017-4-30 Shenzhen Longhua gen Zengjianfeng ************************************** *******************************************/First, reference documents:1. NDK Environment Building-Windows article http://Www.jianshu.com/p/708e6bf68ae9    2. MistakeinchDocumentation/error message?https://github.com/android-ndk/ndk/issues/264    3. Undefined reference to ' __android_log_print appears when compiling a module'http//bbs.csdn.net/topics/360020076Second, error:1. Error 1:1. Error symptom: D:\zengjf\SourceCode\Android\android_app\Test>ndk-Build C:/users/zengjf/appdata/local/android/sdk/ndk-bundle/build//.. /build/core/build-binary.mk:687:android ndk:module ZENGJF depends on undefined modules:android_runtime nativehelper cu TILs utils LogC:/users/zengjf/appdata/local/android/sdk/ndk-bundle/build//.. /build/core/build-binary.mk:701: * * * Android ndk:aborting (set App_allow_missing_deps=true to allow MISSING  dependencies). Stop.D:\zengjf\SourceCode\Android\android_app\Test>2. Workaround1. C:\Users\zengjf\AppData\Local\Android\Sdk\ndk-bundle\build\core\build-binary.mk2. Modify content: ... ifdef undefined_libs $ (call __ndk_warning,module $ (local_ MODULE) depends on undefined modules: $ (undefined_libs)) # https://github.com/android-ndk/ndk/issues/208# Ndk-build didn'T used to fail the build for a missing dependency. this# seems to all been the behavior, so there's a good chance that# there is builds outThere that depend on ThisBehavior ( asof right now, # anythingusingLibc++ on ARM have Thisproblem because of Libunwind). # # bydefaultWe'll abortinch  ThisSituation because This  isSo completely # broken. A user may define App_allow_missing_deps to"true" inchtheir # application.mk or on the command line to revert to the old, broken # is                    Havior. App_allow_missing_deps=true    //Add this lineIfneq ($ (app_allow_missing_deps),true) $ (Call __ndk_error,aborting (Setapp_allow_missing_deps=trueTo allow missing dependencies)) endif endif ...2. Error 2:1. Error symptom: Undefined references to ' __android_log_print'Follow        2. Workaround: Add local_ldlibs to the Android.mk file+ =-llog can be

Compiling JNI with the NDK that comes with Android studio

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.