Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio:import NDK project from eclipse

I exported project from Eclipse(windows) and imported it to android studio V 0.4.2(ubuntu).
The project include working NDK library.

I get this error when try to run my app:

Execution failed for task ':app:compileDebugNdk'.

NDK not configured

From others stackoverflow posts, I understand that it is an issue.

But get no workaround for this.
Should i proceed the development with eclipse for now, or is that the a lazy option ?

EDIT : I run this command:

export NDK=~/Downloads/android-ndk-r9c

and then :

and then go to my app directory and run this:

 ndk-build

And i get this:

        yarinkos-u@yarinkosu-MSI-Notebook-EX600:~/AndroidStudioProjects/AndEngineEXperimental$ ndk-build
    /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 1: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: dirname: not found
    /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 132: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: uname: not found
ERROR: Unknown host operating system:

What i did wrong?
It seems that the script running,but i miss something there.

EDIT 2:

i mistakenly runing this also :

 export PATH=~/Downloads/android-ndk-r9c 

so i get the error above.
If i running onlt this :

export NDK=~/Downloads/android-ndk-r9c 

I get ndk-build not found error.

like image 897
yarin Avatar asked Sep 27 '26 03:09

yarin


1 Answers

NDK Support is introduced from Android Studio 0.4.1 only, so make sure you are running AS 0.4.1 or above.

Android gradle plugin must be 0.7.+ in build.gradle file and also new NDK integration requires NDK r9c .

Lines from Developer tools blog under Release 0.4.1

Supports importing NDK projects. If the imported project contains NDK sources, these are imported into the jni/ source set of the project, the module name is inferred from the Makefile and stored in the Gradle file, and the ndk.dir property is defined in local.properties.

Check more about it here :

http://tools.android.com/recent

like image 155
Piyush Agarwal Avatar answered Sep 28 '26 20:09

Piyush Agarwal