2

I have configured my react-native app in appcenter for build and distribution. Everything was working fine and all of a sudden, build failed with the following error

> Task :app:stripReleaseDebugSymbols FAILED
Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.

> Task :app:mergeExtDexRelease

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:stripReleaseDebugSymbols'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Followed this link https://github.com/microsoft/appcenter/issues/2144 and updated my grade file to

buildscript {
    ext {
        ndkVersion = "20.1.5948944"
    }
    
    dependencies {
        classpath("com.android.tools.build:gradle:4.1.0")
   }

and gradle-wrapper.properties to

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

after this the build worked but the app distributed after the build failed to installed on devices with "App Not Installed" error. I tried different versions and no success so far.

2 Answers2

3

I was able to fix the issue with the following settings

in graddle-wrapper.properties updated the distributionUrl to

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

in android/build.gradle updated gradle version to

classpath("com.android.tools.build:gradle:4.2.0")

Updated react-native version to 0.65.1

npm i react-native@0.65.1

updated all related packages to be compatible with this react-native version

npm update "react-native"

after this, I was able to build it in appcenter and was able to distribute and install the app

0

Had a similar issue. After checking which ndk versions are supported in VSAC via looking at build logs I updated android/build.gradle with following ndk version & it worked.

buildscript {
    ext {
        ...
        ndkVersion = "18.1.5063045"
    }
    ...
}

Pasindu Dilshan
  • 366
  • 1
  • 15
  • I tried with this. Build was successful in appcenter but the distributed app didnt install on the phone. It again gave 'App Not Installed' error – Prakash Loganathan Oct 20 '21 at 04:43
  • Have you reverted the changes you made to the gradle versions in both `android/build.gradle` and `gradle-wrapper.properties` ? – Pasindu Dilshan Oct 20 '21 at 09:48
  • I reverted to distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip and classpath("com.android.tools.build:gradle:3.5.3") and the build failed now – Prakash Loganathan Oct 20 '21 at 14:11
  • Can you please share your versions? I can try with that – Prakash Loganathan Oct 20 '21 at 14:14
  • `distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip` in `gradle-wrapper.properties`. `classpath("com.android.tools.build:gradle:3.5.3")` in `build.gradle`. What does the build logs state ? – Pasindu Dilshan Oct 21 '21 at 03:42
  • I was getting this error in build log, same as the error posted in the question – Prakash Loganathan Oct 21 '21 at 11:21
  • ```> Task :app:stripReleaseDebugSymbols FAILED Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead. > Task :app:mergeExtDexRelease FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:stripReleaseDebugSymbols'. > No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ``` – Prakash Loganathan Oct 21 '21 at 11:21