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.

Doesn't build after project initialization

See original GitHub issue

After recent update in cli-platform-android the project doesn’t start. Stating Cannot invoke method getErrorStream() on null object. I wanted to submit an issue for that package but I could not find a github repo for that.

$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 863 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
:ReactNative:Cannot run program "npx": CreateProcess error=2, ═х єфрхЄё  эрщЄш єърчрээ√щ Їрщы
:ReactNative:Automatic import of native modules failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\TEMP\natapp\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 169

* What went wrong:
A problem occurred evaluating script.
> Cannot invoke method getErrorStream() on null object

* 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 --v

erbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Script 'C:\TEMP\natapp\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 169

* What went wrong:
A problem occurred evaluating script.
> Cannot invoke method getErrorStream() on null object

* 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 (C:\TEMP\natapp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
    at buildAndRun (C:\TEMP\natapp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
    at C:\TEMP\natapp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
    at async Command.handleAction (C:\TEMP\natapp\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.

I’m running on Windows 10 x64 and node version is 12.8.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:19
  • Comments:54 (16 by maintainers)

github_iconTop GitHub Comments

19reactions
zrelyyderevacommented, Oct 16, 2019

I’m on same status Node Version: v12.12.0 react-native --version 3.3.0-alpha.6

On Windows, npx command is “npx.cmd” and windows terminal can omit extensions for executables(i.e. bat,cmd,exe ) .so we can run npx by “npx” in the terminal, but it’s looks only in terminal (except for *.exe) I modified native_modules.gradle L.153 “npx --quiet react-native config” to “npx.cmd --quiet react-native config” ,then I could run run-android but it’s not smart and not portable.

16reactions
thymikeecommented, Oct 16, 2019

CLI is a direct dependency of react-native and we want it to keep it this way. You can use yarn resolutions in package.json to pin to previous version:

"resolutions": {
  "@react-native-community/cli": "3.0.0-alpha.2",
  "@react-native-community/cli-platform-android": "3.0.0-alpha.2",
  "@react-native-community/cli-platform-ios": "3.0.0-alpha.2",
  "@react-native-community/cli-tools": "2.8.3"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring-Boot application does not build properly - Stack Overflow
If your project is gradle then go to Project right click and go to >gradle >Refresh gradle project.
Read more >
Initializing project data in the init lifecycle - Gradle Forums
So I looked a bit deeper, seems what i want to do isn't possible because the project object doesn't exist until after these...
Read more >
Known issues with Android Studio and Android Gradle Plugin
To fix the issue for the current project, click Run > Edit Configurations and change the default JUnit configuration to only include the...
Read more >
Create a new project | IntelliJ IDEA Documentation - JetBrains
This is a general-purpose project without specific frameworks. You will be able to add the necessary frameworks and technologies later at any ...
Read more >
Troubleshoot initialization options | Firebase - Google
If you initialize your app without a valid set of Firebase options, ... and to associate client data with your Firebase project and...
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