ndk-build and command not found using Eclipse mac

前端 未结 2 1527
栀梦
栀梦 2021-01-25 08:18

I am developing and android application in mac using Eclipse for android-ndk. I have already given NDK path in Eclipse. At the end when I am giving this command to build my appl

相关标签:
2条回答
  • 2021-01-25 08:53

    Instead of ndk-build command, simply type ~/Desktop/AndroidNDK/android-ndk-r10d/ndk-build in your terminal.

    0 讨论(0)
  • 2021-01-25 08:54

    I didn't give any explicit values for ANDROID_NDK_ROOT and ANDROID_SDK_ROOT, i just give the location of my NDK in my eclipse preferences. Can you please guide me in this thing

    According to the Android folks on the Android NDK group (see Recommended NDK Directory?), uou should always provide values for ANDROID_NDK_ROOT, ANDROID_SDK_ROOT and ANDROID_SDK_HOME. Here is what they are used for:

    • ANDROID_NDK_ROOT → installation dirctory of NDK
    • ANDROID_SDK_ROOT → installation dirctory of SDK
    • ANDROID_SDK_HOME → location of SDK-related user files, defaults to ~/.android/ on Unix.

    Put the tools on-path and export the env vars. Here's my .bash_profile for OS X.

    $ cat ~/.bash_profile 
    export PS1="\h::\W$ "
    
    # Android
    export ANDROID_NDK_ROOT=/opt/android-ndk-r10d
    export ANDROID_SDK_ROOT=/opt/android-sdk-macosx
    export ANDROID_SDK_HOME=~/.android
    
    export JAVA_HOME=`/usr/libexec/java_home`
    
    export PATH="$ANDROID_SDK_ROOT/tools/":"$ANDROID_SDK_ROOT/platform-tools/":"$PATH"
    

    Then, source your profile changes (or log-off and then log-in).

    0 讨论(0)
提交回复
热议问题