How to set NDK Build path in OSX for Android studio

前端 未结 4 1345
走了就别回头了
走了就别回头了 2020-12-29 05:56

I had set the ANDROID_NDK_HOME as /Users/Shajilshocker/Documents/Android/NDK/android-ndk-r10b using a mac osx application called Enviro

4条回答
  •  灰色年华
    2020-12-29 06:00

    For mac use this: Open your .bash_profile file with a text editor. .bash_profile is by default found in home directory. Eg /Users/john

    the assumption is: you have downloaded the android sdk and ndk to /User/john/Android or you can find the path from Android Studio by going to

    Project Structure > SDK Location, pay attention to Android SDK location & Android NDK location

    export ANDROID_SDK=/Users/john/Android/sdk
    export ANDROID_NDK=/Users/john/Android/sdk/ndk-bundle
    export PATH="$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK"
    

    Then save the above lines to your .bash_profile file. Close it and try typing this on your terminal

    ndk-build
    

    if the response is like below, you are good to go

    Android NDK: Could not find application project directory !    
    Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.    
    /Users/john/Android/sdk/ndk-bundle/build/core/build-local.mk:143: ***   Android NDK: Aborting    .  Stop.
    

    The assumption here is you have downloaded your android sdk to /Users/john/Android

提交回复
热议问题