question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android release build fails

See original GitHub issue

Can’t create an Android release build -debug works. A comment on a closed, related issue, says it’s a matter of version conflict between react-native (0.59.x) and Gradle plugin (3.4.x).

Tried downgrading the plugin to 3.3.x (as other users did on the thread) and also upgraded RN to 0.60.0 which, according to the comment, supports 3.4.x. No matter the versions, issue persists.

React Native version:

System:
  OS: macOS 10.14.5
  CPU: (4) x64 Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
  Memory: 24.03 MB / 4.00 GB
  Shell: 3.2.57 - /bin/bash
Binaries:
  Node: 8.8.1 - /usr/local/bin/node
  npm: 4.6.1 - /usr/local/bin/npm
  Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
  iOS SDK:
    Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
  Android SDK:
    API Levels: 23, 24, 25, 26, 27, 28
    Build Tools: 23.0.1, 25.0.0, 25.0.2, 26.0.0, 26.0.2, 27.0.3, 28.0.0, 28.0.2, 28.0.3
    System Images: android-24 | Google APIs Intel x86 Atom
IDEs:
  Android Studio: 3.4 AI-183.6156.11.34.5522156
  Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
  react: ^16.8.6 => 16.8.6 
  react-native: 0.59.8 => 0.59.8 
npmGlobalPackages:
  create-react-native-app: 1.0.0
  react-native-cli: 2.0.1
  react-native-git-upgrade: 0.2.7

Steps To Reproduce

  1. Create new React-Native project: react-native init appname
  2. Open appname project within Android Studio
  3. Change Build Variant from debug to release

What actually happens:

> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> A problem occurred starting process 'command '/Users/user/Code/appname/android/app/build/generated/assets/react/release/index.android.bundle.map''

* 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 39s

Stacktrace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:bundleReleaseJsAndAssets'.Open stacktrace
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/Users/user/Code/appname/android/app/build/generated/assets/react/release/index.android.bundle.map''Open stacktrace
Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/Users/user/Code/appname/android/app/build/generated/assets/react/release/index.android.bundle.map'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.startProcess(ExecHandleRunner.java:97)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:70)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.io.IOException: Cannot run program "/Users/user/Code/appname/android/app/build/generated/assets/react/release/index.android.bundle.map" (in directory "/Users/user/Code/appname"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.startProcess(ExecHandleRunner.java:97)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:70)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.io.IOException: error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.startProcess(ExecHandleRunner.java:97)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:70)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)user

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:14
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
mcuelenaerecommented, Jul 11, 2019

We had the same issue, upgrading to a newer version of react-native-sentry fixed it for us.

8reactions
ferostarcommented, Jul 3, 2019

Tried with 0.60.0 (as specified in the issue description), and issue still exists. So there are two things worth mentioning:

  • Given that the issue persists (and using different versions of Gradle Plugin), not sure it’s RN version related.
  • Updating to 0.60.0 means breaking changes to the iOS project, so given the above, it would be great to have a fix/workaround/patch/anything for 0.59.x.

This is huge, can’t release an update to the Android app -and I’m already wasting a lot of time with this, don’t want to spend a considerable amount of time making the iOS app comply with 0.60.0 changes at the moment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android app build throws error for release, debug doesn't
The app builds just fine in debug mode (building and installing it on a device for testing). But when I try to build...
Read more >
Known issues with Android Studio and Android Gradle Plugin
If Studio doesn't start after an upgrade, the problem may be due to an invalid Android Studio configuration imported from a previous version...
Read more >
Why does a build fail in Android Studio even if I don't ... - Quora
There are several causes for gradle build fail in Android studio. Few reasons might be: * Dependencies added * Importing the project from...
Read more >
Android build error – The LinkAssemblies task failed ...
The resolution to this issue is to make sure you have the latest supported Android SDK versions, and set the Target Framework to...
Read more >
Android build issue in Release mode - Temenos Basecamp
Getting below error from viz 8 and Pack 4 when am taking android build in release mode. Please help. exec-shell] :compileReleaseSources. [exec-shell] : ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found