ndk-samples icon indicating copy to clipboard operation
ndk-samples copied to clipboard

No tool chain is available to build for platform 'arm64-v8a'

Open nhphung216 opened this issue 10 years ago • 4 comments

While running the sample NDK program Hello-jni in Android studio I get the following error:

Error:Execution failed for task ':app:compileHello-jniArm64-v8aDebugAllSharedLibraryHello-jniMainC'.
> No tool chain is available to build for platform 'arm64-v8a':
    - Tool chain 'ndk-gcc' (GNU GCC): Could not determine GCC version: failed to execute aarch64-linux-android-gcc -dM -E -.

How can I correct this error? Do I need to make a tool chain so that i can run the sample ndk program?

nhphung216 avatar May 30 '16 04:05 nhphung216

which version is your ndk?

I thought this was raised before. Download the ndk r12 from here https://github.com/android-ndk/ndk/wiki [scroll down on that page ] see if it get over it?

ggfan avatar May 31 '16 05:05 ggfan

the 64 bit platform support begins to appear in android-21, if you set your platform version earlier than that, it won't compile for any 64 bit. You could open you ndk version and check whether you have directory like: ${ndk.dir}/platforms/android-21 or 23, 24 if you have some, check you do NOT have platformVersion set [or set to 21 or newer] in your app/build.gradle [I realize hello-jni is the only one calling out product flavors now] platformVersion = 21 // remove platformVersion totally or set it to 21 or above

by default it takes value from compileSdkVersion, which is 23 in the sample, and should not have problem [in theory :-)]

ggfan avatar May 31 '16 15:05 ggfan

Hi, may you put your ndk version here? I suspect there really something neglected in this sample ( two times people reporting this), and it needed to be fixed.

thanks

ggfan avatar Jun 02 '16 17:06 ggfan

maybe similar to this one: https://github.com/googlesamples/android-ndk/issues/202 that one is about clang. Hope it helps your case; I am closing down this one, please re-open if your issue it still there. thanks

ggfan avatar Jun 14 '16 18:06 ggfan