android
android copied to clipboard
NDK 23 is incompatible with release builds - Execution failed for task ':app:stripReleaseDebugSymbols'.
Environment
- CLI: Doesn't matter
- Android Runtime: 8.x (and prior)
Describe the bug Error during release build it:
Execution failed for task ':app:stripReleaseDebugSymbols'.
error=2, No such file or directory
In release mode the current gradle attempts to call *-linux-android-strip and these tools has been removed in v23 of the NDK, and the recommendation is now to use llvm-strip.
Possible work arounds:
- Update the
App_Resources/android/app.gradlefile add andkVersion "22.0.7026061"(using which ever versions you have installed before v23) in theandroid {section of the file. - Copy the
ndk/<prior_version>/toolchains/llvm/prebuilt/linux-x86_64/bin/*-linux-android-stripfrom v2x to v23 directory. (4 of them, x86_64, arm, i686 and aarch64
To Reproduce
ns build android --release --key-store-... and have ndk v23 installed
Expected behavior Works.
Future Solution
- We need to upgrade the gradle plugin to v4.1 or later... (We are currently using v3.x)
Additional context
- https://github.com/android/ndk/issues/843
- #1654 will probably fix this because it upgrades the gradle plugin.
any update on this, currently unable to build in azure
@JJB1980 yes you can just add this ndkVersion to your app.gradle in meantime:

Anyone have any clue how to install ndk in a github workflow file to be used with the above gradle file?
@mykone github runners should have ndk 22.1.7171670 pre installed https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md
Ok. Cool @rigor789 , thanks.. Will remove my install NDK step then.. And use the ndk version you suggested above. Thanks man.
@NathanWalker Thank you for the Workaround, was having the same problem and setting the NDK variable to the version you suggested fixed my Azure pipeline Build process. Thx.
Thanks for the info! ndkVersion also got my Azure Pipeline building again.
Hi! A update about it! I just add ANDROID_NDK_HOME, environment var on .zshrc (Because I use ZSH) like this: export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk/23.0.7599858 And solved the "No version of NDK matched the requested version" issue... but suddenly I face another issues, follow the error: _Execution failed for task ':app:stripDebugDebugSymbols'. error=2, No such file or directory
Unable to apply changes on device: emulator-5554. Error is: Command ./gradlew failed with exit code 1._
Any ideas? Thanks
Try using a lower ndk version than 23
@danielideriba It's likely build-tools 31 which is a broadly known issue in android stack. You can try this solution here: https://stackoverflow.com/a/68430992/2192332
@danielideriba It's likely build-tools 31 which is a broadly known issue in android stack. You can try this solution here: https://stackoverflow.com/a/68430992/2192332
Thanks @NathanWalker =) I tried to follow the step like stackoverflow link but unfortunately doesn't work. My environment is a little bit different because I needed to change inside de Android Studio configurations folders.
I tried this:
cd /Users/[MY_USER]/Library/Android/sdk/build-tools/31.0.0
&& mv d8 dx
&& cd lib
&& mv d8.jar dx.jar
Then I execute this command: ns run android
I got this: Execution failed for task ':app:stripDebugDebugSymbols'. error=2, No such file or directory
Unable to apply changes on device: emulator-5554. Error is: Command ./gradlew failed with exit code 1.
Furthermore...on iOS platform the app running fine on simulator. Any ideas? Thanks in advance
@danielideriba you can try installing NDK 22.1.7171670 and uninstalling 23 - that should solve it in the meantime... The new alpha version of the android runtime supports 23 with the gradle plugin update, so you may give that a shot first. @nativescript/[email protected]
@rigor789 Huge thanks for your reply! I'll explain my entire steps and troubleshooting. Like you suggested my first attempt is: Uninstalling the latest JDK and install the previous version 22.1.7171670 and updated the project platform to @nativescript/[email protected]. Unfortunately not work yet. I added npm i @nativescript/[email protected]:

I just added NDK info:

But I face the same old error =( I didn't delete the newest NDK folder inside the /Library/Android/sdk/ndk do you suggest to? Erase all NDK versions and leave 22.1.7171670 version?
Update: It is works! lol The only thing I do is delete all NDK folder inside Library/Android/sdk/ndk and just left 22.1.7171670 folder and success! Thanks guys for support!
:
@JJB1980 yes you can just add this ndkVersion to your app.gradle in meantime:
just added ndkVersion "22.1.7171670" and issue solved
For older versions of the runtime you can set the ndkVersion but I do recommend upgrading to the latest version of the runtime