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.

@react-native-community/cli-platform-android Build failed with an exception

See original GitHub issue

Environment

react-native info

yarn run v1.19.1
$ /Users/b1ng/rn/haokan/node_modules/.bin/react-native info
info Fetching system and libraries information...
System:
    OS: macOS 10.15.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 53.23 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.12.0 
    Yarn: 1.19.1 
    npm: 6.12.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5900203
    Xcode: /undefined - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.4 => 0.61.4
✨  Done in 2.66s.

react-native --version

yarn run v1.19.1
$ /Users/b1ng/rn/haokan/node_modules/.bin/react-native --version
3.0.0-alpha.7
✨  Done in 0.32s.

Description

yarn android

yarn run v1.19.1
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...

FAILURE: Build failed with an exception.

* Where:
Script '/Users/b1ng/rn/haokan/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 182

* What went wrong:
A problem occurred evaluating script.
> Unable to determine the current character, it is not a string, number, array, or object

  The current character read is 'i' with an int value of 105
  Unable to determine the current character, it is not a string, number, array, or object
  line number 1
  index number 0
  info Run "react-native --help" to see a list of all available commands.
  ^

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

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Script '/Users/b1ng/rn/haokan/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 182

* What went wrong:
A problem occurred evaluating script.
> Unable to determine the current character, it is not a string, number, array, or object

  The current character read is 'i' with an int value of 105
  Unable to determine the current character, it is not a string, number, array, or object
  line number 1
  index number 0
  info Run "react-native --help" to see a list of all available commands.
  ^

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

    at checkExecSyncError (child_process.js:621:11)
    at execFileSync (child_process.js:639:15)
    at runOnAllDevices (/Users/b1ng/rn/haokan/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
    at buildAndRun (/Users/b1ng/rn/haokan/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
    at /Users/b1ng/rn/haokan/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Command.handleAction (/Users/b1ng/rn/haokan/node_modules/@react-native-community/cli/build/index.js:164:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproducible Demo

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:58 (11 by maintainers)

github_iconTop GitHub Comments

29reactions
sagargulaticommented, Dec 5, 2019

I found a workaround for this:

yarn add @react-native-community/cli-platform-android@3.0.3
yarn add react-native@0.61.5
Removed "--quiet" from npx.cmd in native_modules.gradle
cd android && gradlew clean
13reactions
b1ngxcommented, Nov 8, 2019

@Esemesek

I haven’t install react-native-cli any all. Create the app with npx react-native init. And when i reinstall @react-native-community/cli-platform-android with @3.0.0-alpha.2 , it’s ok.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native build failed in android, @react-native-community ...
2 iOS is building fine but in android i'm facing the issue in @react-native-community/cli-platform-android module. My settings.gradle file apply ...
Read more >
Android Studio & Gradle: "Build failed with an exception ...
Exception (no error message) * Try: Run with --info or --debug option to get more log output. Run with --scan to get full...
Read more >
@react-native-community/cli-platform-android - npm
Start using @react-native-community/cli-platform-android in your project by running `npm i @react-native-community/cli-platform-android`.
Read more >
Hi Team, I am trying to integrate react native app to Kony. The ...
The build fails with - java.lang.exception (no error messages) on node_modules/@react-native-community/cli-platform-android/native_modules.gradle.
Read more >
npx react-native run-android build failed - You.com
FAILURE: Build failed with an exception. ... /node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5) ...
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