c4sh
c4sh

Reputation: 701

Getting error: Execution failed for task : myApp:compileDebugNdk'

Hi I am trying to run an app created with Cocos2d-x 2.5 with Android Studio but I keep getting this error when running the project:

:myApp:compileDebugNdk AGPBI: {"kind":"ERROR","text":"*** Android NDK: Aborting... . Stop.","sourcePath":"/mypath/ndk/android-ndk-r10d/build/core/add-application.mk","position":{"startLine":199},"original":""}

FAILED Execution failed for task ':myApp:compileDebugNdk'.

Building works ok. I have Android Studio 1.1.0 and a Mac with OS X Yosemite 10.10.

Do you guys have any idea what could be wrong?

I have seen a similar error being discussed here Execution failed for task ':app:compileDebugNdk' when trying to compile Android Studio project with NDK source code

but the solution doesn't work for me (created an empty .c file in the jni folder). It looks like that is something that happens on Windows and I use Mac.

Upvotes: 0

Views: 2615

Answers (3)

Anisetti Nagendra
Anisetti Nagendra

Reputation: 341

1.set path for android ndk 2.add ndk.dir=ndk_path in local.properties file 3.add the following in gradle file

sourceSets.main {
    jni.srcDirs = []
}

Thats solves my problem.

Upvotes: 0

c4sh
c4sh

Reputation: 701

I solved it adding this to the build.gradle file:

sourceSets.main {
   jni.srcDirs = []
}

Upvotes: 6

user3906512
user3906512

Reputation:

I think that you have to add ndk path in your local.properties file. Check this tutorial here : http://aprogrammersday.blogspot.in/2015/02/cocos2d-x-game-development-in-android.html

Upvotes: 0

Related Questions