Appcenter-sdk-react-native: Android React Native build failure on AppCenter

Created on 21 May 2018  路  8Comments  路  Source: microsoft/appcenter-sdk-react-native

Description

Our React-native Android release build is failing at step :app:transformNative_libsWithStripDebugSymbolForRelease FAILED.

Running the release build on a 'dev machine' (my local machine) works without error.

Repro Steps

  1. the last command executed is [command]/Users/vsts/agent/2.133.3/work/1/s/android/gradlew -p android clean :app:assembleRelease
  2. i will attach here the complete log from AppCenter_logs.zip

Details

Using AppCenter version 1.5.0. Dependencies as listed in yarn.lock:

`
appcenter-analytics@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/appcenter-analytics/-/appcenter-analytics-1.5.0.tgz#48c147371a4b09c88678989403edde4c347e3a53"
dependencies:
appcenter "1.5.0"

appcenter-crashes@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/appcenter-crashes/-/appcenter-crashes-1.5.0.tgz#c4ac4b7f38c0640be92558de683db7f8445a68a5"
dependencies:
appcenter "1.5.0"

[email protected]:
version "1.5.0"
resolved "https://registry.yarnpkg.com/appcenter-link-scripts/-/appcenter-link-scripts-1.5.0.tgz#593f61988cab598059598538a02743b0cd84c6c9"
dependencies:
debug "^2.2.0"
glob "^5.0.15"
inquirer "1.1.2"
mkdirp "^0.5.1"
plist "1.2.0"
which "^1.2.11"
xcode "^0.8.9"

[email protected], appcenter@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/appcenter/-/appcenter-1.5.0.tgz#231c1b9aa515d2d6016abc0706062537d84e0e61"
dependencies:
appcenter-link-scripts "1.5.0"
`

support

All 8 comments

A similar issue is described here: https://github.com/wonday/react-native-pdf/issues/168

+1

Hi there, this is Mat from the App Center Build team - the issue here lies not within the App Center SDK but within this React Native issue. The latest NDK release dropped support for MIPS from the NDK and apparently this causes issues with some React Native apps.
We updated the version of the Android NDK shipped with our build VMs recently and are now discussing ways to remedy this situation for our users.

For some users, upgrading their Android Gradle plugin in their project configuration to 3.1.2 fixed the issue. i.e. classpath 'com.android.tools.build:gradle:3.1.2'.

To help us further identify and reproduce the issue, can you please create a conversation on App Center through the blue chat button in the bottom right corner and supply us with your Gradle configuration?

@ranterle Is there any chance to change or configure version of NDK on AppCenter?
I have tried to add old toolchains to NDK17 like below in _appcenter_post_clone.sh_ but it doesn't work also.

TOOLCHAINS_DIR=$ANDROID_HOME/ndk-bundle/toolchains

curl -s -o android-ndk-r16b-darwin-x86_64.zip https://dl.google.com/android/repository/android-ndk-r16b-darwin-x86_64.zip && \
unzip -qq android-ndk-r16b-darwin-x86_64.zip && \
rm android-ndk-r16b-darwin-x86_64.zip

cp -R android-ndk-r16b/toolchains/mips64el-linux-android-4.9 $TOOLCHAINS_DIR/mips64el-linux-android-4.9
cp -R android-ndk-r16b/toolchains/mipsel-linux-android-4.9 $TOOLCHAINS_DIR/mipsel-linux-android-4.9

rm -rf android-ndk-r16b

I tried @ranterle solution with changing gradle version to 3.1.2 and it works but I changed two files:

in _android/build.gradle_:
classpath 'com.android.tools.build:gradle:3.1.2'

in _android/gradle/wrapper/gradle-wrapper.properties_:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

After those changes project starts compiling on AppCenter and my machine with NDK17

Thanks for confirming @krystiansliwa - this is great to hear.
Yes, depending on your project configuration, upgrading to a newer Android Gradle version may require additional changes to your codebase.
With regards to the NDK substitution you performed, do you happen to know which error you got after this?

I get that error (AppDev is my build type)

Execution failed for task ':app:transformNativeLibsWithStripDebugSymbolForAppDev'.
> A problem occurred starting process 'command '/Users/vsts/Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip''

Hey!

We haven鈥檛 heard from you in a while, so I am going to go ahead and close this ticket. Should you still have any questions on App Center Build (and not our SDK), please contact us using the blue chat button on any page of https://appcenter.ms. If you have a SDK specific issue you can comment here or create a separate ticket.

Thanks for using App Center!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MrLoh picture MrLoh  路  4Comments

elnygren picture elnygren  路  5Comments

Maximell picture Maximell  路  9Comments

CyberMew picture CyberMew  路  4Comments

rafaelcorreiapoli picture rafaelcorreiapoli  路  5Comments