android: 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.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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 16 (6 by maintainers)

Most upvoted comments

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

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

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 :

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

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