Appcenter: support building React native 0.64

Created on 15 Mar 2021  路  14Comments  路  Source: microsoft/appcenter

Hello, I'd like to ask for AppCenter to support react native 0.64

Currently, there are 2 issues in AC with regard to this

  • Usage of Android Gradle Plugin 4.1.0+ is not supported at the moment.

React Native uses newer plugin now. It works with the older version too, but something that would be nice to have

  • NDK version used by RN is not available in AC
> Task :app:stripReleaseDebugSymbols FAILED
WARNING: Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.
Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:stripReleaseDebugSymbols'.
> No version of NDK matched the requested version 20.1.5948944. Versions available locally: 18.1.5063045, 21.4.7075529, 21.4.7075529, 21.4.7075529, 22.0.7026061

Again, it appears that newer NDK can be used as well but would be nice to use the one specified by RN - not sure what implications this can have...

Thank you!

build feature request reviewed-DRI

All 14 comments

Is there a workaround for this with react native 0.64?

@syed I've been using NDK version 21.4.7075529 and Gradle 4.0.2 and everything seems to be working OK for now. I'd still feel a lot better using the RN 0.64 defaults, so hopefully this gets fixed soon.

I've just have set the ndkVersion to 22.0.7026061 and that is working fine with RN 0.64 (Android and iOS)

How have you guys managed to workaround this? I'm getting the below errors for Android. Would appreciate any help

Android:

Welcome to Gradle 6.7!

Here are the highlights of this release:
 - File system watching is ready for production use
 - Declare the version of Java your build requires
 - Java 15 support

For more details see https://docs.gradle.org/6.7/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
Gradle 6.7

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/runner/work/1/s/android/settings.gradle' line: 3

* What went wrong:
A problem occurred evaluating settings 'aLifeLived'.
> Could not read script '/Users/runner/work/1/s/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' as it does not exist.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 26s
Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1
    at ChildProcess.<anonymous> (/Users/runner/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/1.128.0/node_modules/vsts-task-lib/toolrunner.js:569:30)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Socket.<anonymous> (internal/child_process.js:351:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:509:12)
##[error]Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1

Any news about that?

React Native 0.64.x now uses Android Gradle Plugin 4.1.0.

So now we are unable to use React Native with AppCenter.

@Gitarcitano, please, what version of Android Gradle Plugin are you using with the NDK 22.0.7026061?

Sorry guys, my problem was actually with the jetifier 2.0.0: https://github.com/mikehardy/jetifier/issues/67

Everything working with React Native 0.64.1, Gradle Plugin 4.1.0 and NDK 20.1.5948944.

@douglasjunior so you're saying AppCenter is able to build a Gradle Plugin 4.1.0 app even though the banner at the top says "Android Gradle Plugin 4.1.x is not supported"?

@marcshilling Unbelievable, but yes.

I setup two apps, a new app created in RN 0.64.1, and another app created 2 years ago and updated to RN 0.64.1. Both with default Gradle Plugin 4.1.0.

Has anyone else been able to do this? I still get build failed.

@MatkovIvan Do you have an update for us on when this going to be fixed?

Third party libraries are now requiring Gradle 4.1+. Which means that we have to use older versions for now and can't get the latest bug fixes.

@maxckelly @yvbeek there is a workaround in order to use Gradle 4.1.x

Public documentation has recently been updated
https://docs.microsoft.com/en-us/appcenter/build/android/code-signing#setting-up-code-signing

Another alternative is the latest 4.2.0 version

@ivankostic85 - Seems to still be failing even with the above suggestions. This seems to be happening on the distribution part. When I disable distribution of the Android app to the store it passes.

##[error]Error: Failed find: ENOENT: no such file or directory, stat '/Users/runner/work/1/s/node_modules/@babel/register/node_modules/make-dir/node_modules/.bin/semver'

hi any workarounds to this issue
i tried using jetifier version 1.6.6, but it triggered some other issues

Was this page helpful?
0 / 5 - 0 ratings