Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
NathanaelA opened this issue Apr 1, 2021 · 18 comments

Comments

@NathanaelA
Copy link
Contributor

NathanaelA commented Apr 1, 2021

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

@JJB1980
Copy link

JJB1980 commented Sep 27, 2021

any update on this, currently unable to build in azure

@NathanWalker
Copy link
Contributor

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

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

@mykone
Copy link

mykone commented Oct 4, 2021

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

@rigor789
Copy link
Member

rigor789 commented Oct 4, 2021

@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

@mykone
Copy link

mykone commented Oct 4, 2021

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

@varbex
Copy link

varbex commented Oct 8, 2021

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

@mattsalerno2k
Copy link

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

@danielideriba
Copy link

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

@triniwiz
Copy link
Member

Try using a lower ndk version than 23

@NathanWalker
Copy link
Contributor

@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
Copy link

@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

@rigor789
Copy link
Member

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

@danielideriba
Copy link

@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
Copy link

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
:

@Sabahat06
Copy link

@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

@triniwiz
Copy link
Member

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

@JesseBrown1980
Copy link

Is this still happening with NDK 23.1.7779620 and build tool 33?

@triniwiz
Copy link
Member

@JesseBrown1980 give 23.2.8568313 a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests