android icon indicating copy to clipboard operation
android copied to clipboard

NDK 23 is incompatible with release builds - Execution failed for task ':app:stripReleaseDebugSymbols'.

Open NathanaelA opened this issue 4 years ago • 15 comments

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.gradle file add a ndkVersion "22.0.7026061" (using which ever versions you have installed before v23) in the android { section of the file.
  • Copy the ndk/<prior_version>/toolchains/llvm/prebuilt/linux-x86_64/bin/*-linux-android-strip from 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.

NathanaelA avatar Apr 01 '21 22:04 NathanaelA

any update on this, currently unable to build in azure

JJB1980 avatar Sep 27 '21 04:09 JJB1980

@JJB1980 yes you can just add this ndkVersion to your app.gradle in meantime:

8E20DB83-1A6B-46DD-A1DD-430A1EBC3FA5

NathanWalker avatar Sep 27 '21 05:09 NathanWalker

Anyone have any clue how to install ndk in a github workflow file to be used with the above gradle file?

mykone avatar Oct 04 '21 17:10 mykone

@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

rigor789 avatar Oct 04 '21 17:10 rigor789

Ok. Cool @rigor789 , thanks.. Will remove my install NDK step then.. And use the ndk version you suggested above. Thanks man.

mykone avatar Oct 04 '21 18:10 mykone

@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.

varbex avatar Oct 08 '21 12:10 varbex

Thanks for the info! ndkVersion also got my Azure Pipeline building again.

mattsalerno2k avatar Oct 15 '21 15:10 mattsalerno2k

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

danielideriba avatar Oct 19 '21 21:10 danielideriba

Try using a lower ndk version than 23

triniwiz avatar Oct 19 '21 21:10 triniwiz

@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

NathanWalker avatar Oct 20 '21 15:10 NathanWalker

@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 avatar Oct 20 '21 21:10 danielideriba

@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 avatar Oct 20 '21 21:10 rigor789

@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]:

Screen Shot 2021-10-21 at 16 38 46

I just added NDK info:

Screen Shot 2021-10-21 at 16 41 37

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?

danielideriba avatar Oct 21 '21 20:10 danielideriba

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!

Screen Shot 2021-10-28 at 20 37 30 :

danielideriba avatar Oct 28 '21 23:10 danielideriba

@JJB1980 yes you can just add this ndkVersion to your app.gradle in meantime:

8E20DB83-1A6B-46DD-A1DD-430A1EBC3FA5

just added ndkVersion "22.1.7171670" and issue solved

Sabahat06 avatar Feb 09 '22 07:02 Sabahat06

For older versions of the runtime you can set the ndkVersion but I do recommend upgrading to the latest version of the runtime

triniwiz avatar Sep 29 '22 11:09 triniwiz