NDK can't find the application directory

后端 未结 11 1856
余生分开走
余生分开走 2020-12-12 15:03

When running the ndk-build command I get the following error:

Android NDK: Could not find application project directory !    
Android NDK: Please define the          


        
相关标签:
11条回答
  • 2020-12-12 15:13

    Follow Below steps:

    1)Right on your project
    2)Go to properties
    3)Go to C/C++ Build
    4)Go to Builder Settings
    5)Go to Build Location
      Add build directory
    6)Click on Workspace
    7)Select your project folder
    

    you should see something like

    ${workspace_loc:/[Your Project_Name]}
    

    Done!!

    0 讨论(0)
  • 2020-12-12 15:15

    NDK_PROJECT_PATH is an environment variable so you don't have to include in the Android.mk file. Is nkd-build launched in the project directory?

    For more info read the docs in docs/HOWTO.html in the NDK folder where I read

    Starting with NDK r4, you can simply place the file under $PROJECT/jni/ and launch the 'ndk-build' script from your project tree.

    If you want to use 'ndk-build' but place the file to a different location, use a GNU Make variable override as:

    ndk-build NDK_APPLICATION_MK=/path/to/your/Application.mk
    
    0 讨论(0)
  • 2020-12-12 15:15

    You need to specify 3 things.

    NDK_PROJECT_PATH - the location of your project
    NDK_APPLICATION_MK - the path of the Application.mk file
    APP_BUILD_SCRIPT - the path to the Android.mk file
    

    These are needed to override the default values of the build script, which expects things to be in the jni folder.

    When calling ndk-build use

    ndk-build NDK_PROJECT_PATH=/path/to/proj NDK_APPLICATION_MK=/path/to/Application.mk
    

    In Application.mk add

    APP_BUILD_SCRIPT := /path/to/Android.mk
    
    0 讨论(0)
  • 2020-12-12 15:16

    Set your ndk builder's working directory could solve your problem as I got the same problem and solved it in this way.

    Path: Project Properties -> Builders -> -> Main -> Working Directory

    0 讨论(0)
  • 2020-12-12 15:23

    This is what I use, cd into the project directory and do:

    ndk-build NDK_PROJECT_PATH=.
    

    0 讨论(0)
  • 2020-12-12 15:25

    -C worked for me.

    You can also use the mac terminal to do this.

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