Cli: CreateProcess error=193, %1 is not a valid Win32 application

Created on 7 Feb 2020  路  26Comments  路  Source: react-native-community/cli

System:
OS: Windows 10 10.0.17763
CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
Memory: 6.53 GB / 15.91 GB
Binaries:
Node: 10.16.3 - C:\Program Files\nodejs\node.EXE
npm: 6.10.3 - C:\Users\oguzhan.kazak\AppData\Roaming\npm\npm.CMD
SDKs:
Android SDK:
API Levels: 23, 25, 28
Build Tools: 28.0.3, 29.0.2
System Images: android-23 | Google APIs Intel x86 Atom_64
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.6010548
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\Projects\TerminalMobil\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 154

  • What went wrong:
    A problem occurred evaluating script.

    Cannot run program "C:\Projects\TerminalMobil\node_modules\@react-native-community\cli\build\bin.js": CreateProcess error=193, %1 is not a valid Win32 application

react-native run-android throws this error.

bug report

Most helpful comment

I think the lasted version (0.61.0) is the problem I created a new react native app using 0.60.0 and I tested in the emulator without errors.

react-native init AwesomeProject --version 0.60.0

All 26 comments

Do you have a repro maybe? I haven't seen an error like this here yet. Maybe your node_modules are corrupted? Please try to remove them and yarn install again (I suggest using yarn, because npm produces undeterministic node_modules).

I also have this error, it occured quite recently after some packages like camera were added.
package-lock and node_modules removed and installed again, no change.
Tried the same (removal of node_modules and all lock files) with yarn, same thing.

I am facing the same issue.
"react-native": "^0.61.5",
"@react-native-community/cli": "^3.0.5-alpha.1",
"@react-native-community/cli-platform-android": "^3.0.5-alpha.1",

i have the same issue @OguzhanKazak . anyone solve this?

I solved it with replacing android folder, package.json and package-lock.json files with working ones.
Problem is probably about @react-native-community/cli-platform-android

i don't have package-lock.json file

@OguzhanKazak Can you explain a bit more? What do you mean by "working ones"?

We are working on that project with my friend. So i copied and pasted android + package.json's from him. I don't really know how did it solved my problem sorry :/

I'm having the same issue.

same problem here in a fresh react native app

I think the lasted version (0.61.0) is the problem I created a new react native app using 0.60.0 and I tested in the emulator without errors.

react-native init AwesomeProject --version 0.60.0

This sounds like a serious problem, we're going to look into it first thing in the morning.

Problem started again 5 hours ago.

I think the lasted version (0.61.0) is the problem I created a new react native app using 0.60.0 and I tested in the emulator without errors.

react-native init AwesomeProject --version 0.60.0

This made the build succeed, but when the app opens on my connected Android phone I get:

console error: React Native version mismatch. 

Javascript version: 0.61.5
Native version: 0.60.0

EDIT: Fixed the React Native version mismatch error by closing all terminals, deleting old project and recreating.

Im having the same problem and dont know how to fix it.
And my app was running fine 4 hours ago, out of the blue it just stops working and gives me this error.
Cannot run program "C:\Users\NikhilBatta\Desktop\throwaway\wellifynative\node_modules\@react-native-community\cli\build\bin.js": CreateProcess error=193, %1 is not a valid Win32 application

@sclavijo93 I tried this just now, and im still getting the same error.

@sclavijo93 thanks, that worked!

However I'm now getting another error from the same library, Error: ENOENT: no such file or directory, open 'app\build\intermediates\merged_manifests\debug\AndroidManifest.xml'. Seems to be an issue with 3.1.1: https://stackoverflow.com/questions/60218063/no-such-file-or-directory-open-app-build-intermediates-merged-manifests-debug

@amduffy19 Did you try downgrading @react-native-community/cli-platform-android to 2.9.0 ?

@sclavijo93 I'm trying to but having trouble getting it to downgrade due to my version of react-native I think. Working on it...

@amduffy19 Try removing the line '@react-native-community/cli-platform-android....' from dependencies in the package.json then follow this https://github.com/react-native-community/cli/issues/965#issuecomment-586056786

@sclavijo93 Thanks but still not working :( Trying to downgrade react-native to 0.60.0 now...

That worked, thanks!

Wish this issue was closed 7 days ago and I didn't see it. It was a good heads up. Anyway, this is fixed with latest CLI, so just re-install your node_modules.

Was this page helpful?
0 / 5 - 0 ratings