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

[0.63-rc.0] Android release builds fail on new init projects #28700

Closed
owinter86 opened this issue Apr 20, 2020 · 3 comments
Closed

[0.63-rc.0] Android release builds fail on new init projects #28700

owinter86 opened this issue Apr 20, 2020 · 3 comments
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@owinter86
Copy link

owinter86 commented Apr 20, 2020

Description

Building release version of the new 0.63 RC fails at the bundling JS assets step

React Native version:

Run react-native info in your terminal and copy the results here.

System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
    Memory: 3.05 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.19.0 - /var/folders/jj/4jph4lr53tn9wsgf6fz2lmkr0000gn/T/yarn--1587411268433-0.37387762429499705/node
    Yarn: 1.22.4 - /var/folders/jj/4jph4lr53tn9wsgf6fz2lmkr0000gn/T/yarn--1587411268433-0.37387762429499705/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v10.19.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.8.4 - /Users/oliverwinter/.rvm/gems/ruby-2.6.1/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 23, 26, 27, 28, 29
      Build Tools: 26.0.3, 27.0.3, 28.0.2, 28.0.3, 29.0.2
      System Images: android-22 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6241897
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_192 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.0-rc.0 => 0.63.0-rc.0
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. npx react-native init RN063 --version 0.63.0-rc.0
  2. yarn react-native run-android --variant=release
> Task :app:bundleReleaseJsAndAssets FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
6 actionable tasks: 3 executed, 3 up-to-date
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '/Users/oliverwinter/Documents/work/RN063/node_modules/@react-native-community/cli/build/bin.js
'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1
  1. npx react-native init RN062
  2. yarn react-native run-android --variant=release

Works and builds fine

Expected Results

Building a release version of the new RC0.63 should be successful.

Snack, code example, screenshot, or link to a repository:

Simple reproduction shown above.

@palkerecsenyi
Copy link

I'm getting an almost identical issue: react-native-community/upgrade-support#60

@grabbou
Copy link
Contributor

grabbou commented Apr 21, 2020

Definitely a regression after recent change. Has something to do with the release mode in Gradle. Potential place to look: 992e0ce

@grabbou
Copy link
Contributor

grabbou commented Apr 28, 2020

Just submitted a PR to fix this issue.

grabbou added a commit that referenced this issue Apr 29, 2020
Summary:
Running `./gradlew assembleRelease` fails as the path to the CLI contains a new line at the end. We don't run this command in `debug` mode, hence it passed the testing. My bad.

Fixed, checked in both `debug` with `bundleInDebug: true` and `release`.

Fixes #28700

## Changelog

[INTERNAL] [ANDROID] - Fix `React.gradle` to build Android apps in production
Pull Request resolved: #28776

Test Plan: Running `./gradlew assembleRelease` works

Reviewed By: hramos

Differential Revision: D21287789

Pulled By: TheSavior

fbshipit-source-id: dc3ec8eef7a919b072b562d2bd455e2f704bc083
@facebook facebook locked as resolved and limited conversation to collaborators Oct 1, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants