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

Android React Native build failure on AppCenter #317

Closed
ionut-movila opened this issue May 21, 2018 · 10 comments
Closed

Android React Native build failure on AppCenter #317

ionut-movila opened this issue May 21, 2018 · 10 comments
Labels

Comments

@ionut-movila
Copy link

ionut-movila commented May 21, 2018

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"
`

@ionut-movila
Copy link
Author

A similar issue is described here: wonday/react-native-pdf#168

@ChristBKK
Copy link

+1

@matthiaswenz
Copy link

matthiaswenz commented May 21, 2018

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?

@krystiansliwa
Copy link

@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

@krystiansliwa
Copy link

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

@matthiaswenz
Copy link

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?

@krystiansliwa
Copy link

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''

@guperrot
Copy link
Member

Hey!

We haven’t 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!

@MarcosGomesDev
Copy link

Hello i have this error on try generate build with AppCenter, how to solution?

A problem occurred configuring root project 'Coletor'.

Could not determine the dependencies of null.
Could not resolve all task dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:8.0.1.
Required by:
project :
> No matching variant of com.android.tools.build:gradle:8.0.1 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.0.1' but:
- Variant 'apiElements' capability com.android.tools.build:gradle:8.0.1 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Variant 'javadocElements' capability com.android.tools.build:gradle:8.0.1 declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Variant 'runtimeElements' capability com.android.tools.build:gradle:8.0.1 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Variant 'sourcesElements' capability com.android.tools.build:gradle:8.0.1 declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
> Could not resolve com.facebook.react:react-native-gradle-plugin.
Required by:
project :
> No matching variant of project :gradle-plugin was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.0.1' but:
- Variant 'apiElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Variant 'mainSourceElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a component, and its dependencies declared externally:
- Incompatible because this component declares a component of category 'verification' and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Doesn't say anything about its usage (required runtime)
- Variant 'runtimeElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Variant 'testResultsElementsForTest' capability com.facebook.react:react-native-gradle-plugin:unspecified:
- Incompatible because this component declares a component of category 'verification' and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Doesn't say anything about its usage (required runtime)

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

BUILD FAILED in 1m 43s
Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1
at ChildProcess. (/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. (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

@alihaydarsevgili
Copy link

Hello i have this error on try generate build with AppCenter, how to solution?

A problem occurred configuring root project 'Coletor'.

Could not determine the dependencies of null.
Could not resolve all task dependencies for configuration ':classpath'.

Could not resolve com.android.tools.build:gradle:8.0.1.
Required by:
project :
No matching variant of com.android.tools.build:gradle:8.0.1 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.0.1' but:

  • Variant 'apiElements' capability com.android.tools.build:gradle:8.0.1 declares a library, packaged as a jar, and its dependencies declared externally:
  • Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
  • Other compatible attribute:
  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
  • Variant 'javadocElements' capability com.android.tools.build:gradle:8.0.1 declares a component for use during runtime, and its dependencies declared externally:
  • Incompatible because this component declares documentation and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them packaged as a jar)
  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
  • Variant 'runtimeElements' capability com.android.tools.build:gradle:8.0.1 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
  • Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
  • Other compatible attribute:
  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
  • Variant 'sourcesElements' capability com.android.tools.build:gradle:8.0.1 declares a component for use during runtime, and its dependencies declared externally:
  • Incompatible because this component declares documentation and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them packaged as a jar)
  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')

Could not resolve com.facebook.react:react-native-gradle-plugin.
Required by:
project :
No matching variant of project :gradle-plugin was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.0.1' but:

  • Variant 'apiElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a library, packaged as a jar, and its dependencies declared externally:
  • Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
  • Other compatible attribute:
  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
  • Variant 'mainSourceElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a component, and its dependencies declared externally:
  • Incompatible because this component declares a component of category 'verification' and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them packaged as a jar)
  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
  • Doesn't say anything about its usage (required runtime)
  • Variant 'runtimeElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
  • Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
  • Other compatible attribute:
  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
  • Variant 'testResultsElementsForTest' capability com.facebook.react:react-native-gradle-plugin:unspecified:
  • Incompatible because this component declares a component of category 'verification' and the consumer needed a library
  • Other compatible attributes:
  • Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
  • Doesn't say anything about its target Java version (required compatibility with Java 8)
  • Doesn't say anything about its elements (required them packaged as a jar)
  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
  • Doesn't say anything about its usage (required runtime)
  • 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.

BUILD FAILED in 1m 43s Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1 at ChildProcess. (/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. (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

hello did you find any solution?
my react native version is :0.72.4
my gradlew distributionUrl: https://services.gradle.org/distributions/gradle-8.0.1-all.zip

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

No branches or pull requests

7 participants