react-native-community / cli

The React Native Community CLI - command line tools to help you build RN apps
MIT License
2.41k stars 905 forks source link

Build Failed #2402

Closed XfheDev closed 5 months ago

XfheDev commented 6 months ago

error Failed to launch emulator. Reason: The emulator (INFO | Storing crashdata in: C:\Users\cinar\AppData\Local\Temp\AndroidEmulator\emu-crash-35.1.1.db, detection is enabled for process: 90424) quit before it finished opening. You can try starting the emulator manually from the terminal with: C:\Users\cinar\AppData\Local\Android\Sdk/emulator/emulator @INFO | Storing crashdata in: C:\Users\cinar\AppData\Local\Temp\AndroidEmulator\emu-crash-35.1.1.db, detection is enabled for process: 90424. warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch. info Installing the app...

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

:ReactNative:Running '[node, C:\Users\cinar\OneDrive\Masaüstü\turkce-sozluk-master\node_modules\@react-native-community\cli\build\bin.js, config]' command failed.

FAILURE: Build failed with an exception.

Usama-Saud commented 6 months ago

Facing this same error, whenever I run npx-react-native run-android command.

- I always have to delete my node-modules folder, and reinstall them again, then it works.

If someone got a better solution, please let us know.

Thank you.

szymonrybczak commented 5 months ago

hey, please make sure that npx react-native config works and outputs correct config ✅

gladiuscode commented 5 months ago

hey, please make sure that npx react-native config works and outputs correct config ✅

Thank you @szymonrybczak ! This command helped me identify a strange error in an old project running .69.12.

Suddenly it has been impossibile to sync gradle correctly and I ended up debugging the react-native-cli bin.js file to identify the issue, only to then find that the error was thrown by the config package that detected a broken configuration in react-native-maps. This package is missing package="com.rnmaps.maps" in AndroidManifest and the config plugin is throwing because at version 8.0.0 it requires it.

szymonrybczak commented 5 months ago

hey @gladiuscode, make sure you're using react-native-maps with updated version so it contains correct manifests :) I think this the one that you want to use.

GabeConsalter commented 5 months ago

I had this error running on a old project running 0.69.11 react-native version. Fixing react-native-maps 1.13.0 version fixes this problem.

mohamad-kaddoura commented 2 months ago

To those who are still having this issue. Make sure the package name is included in your manifest of the AndroidManifest.xml file under ./android/app/src/main/AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yourapp">

to make sure you are writing the correct package. you can check from ./android/app/build.gradle and check for android > defaultConfig > applicationId

It must be com.yourapp there as well

Sabaa-Abdennabi commented 2 months ago

i am facing the exact same issue while building using eas cli :ReactNative:Running '[node, /home/expo/workingdir/build/node_modules/@react-native-community/cli/build/bin.js, config]' command failed. FAILURE: Build failed with an exception.

szymonrybczak commented 2 months ago

hey @Sabaa-Abdennabi, you can try debugging it by running npx react-native config in the root directory of your project

Hatsuya1993 commented 2 months ago

:ReactNative:Running '[node, /home/expo/workingdir/build/node_modules/@react-native-community/cli/build/bin.js, config]' command failed. FAILURE: Build failed with an exception.

I am getting this issue when building for Android.

eas build -p android

avinash-capsitech commented 2 months ago

I was facing the same issue, but when I added the @react-native-community/cli command to package.json, both of my apps started working again. It might be that some dependencies or modules were corrupted or not linked properly, but I’m not exactly sure what happened.

Hatsuya1993 commented 2 months ago

Alright finally managed to build for android after days of debugging. Apparently there was a dependency in my package.json called {project_name}: ":file". I wasn't sure how it got there in the first place. Deleting the dependency was also an issue as it keeps reappearing after I save the file. The only way to remove it is using the command npm uninstall {project_name}.

Sabaa-Abdennabi commented 2 months ago

Alright finally managed to build for android after days of debugging. Apparently there was a dependency in my package.json called {project_name}: ":file". I wasn't sure how it got there in the first place. Deleting the dependency was also an issue as it keeps reappearing after I save the file. The only way to remove it is using the command npm uninstall {project_name}.

Thank you so much you saveddd meeeee

OrleansRibeiro commented 1 month ago

Alright finally managed to build for android after days of debugging. Apparently there was a dependency in my package.json called {project_name}: ":file". I wasn't sure how it got there in the first place. Deleting the dependency was also an issue as it keeps reappearing after I save the file. The only way to remove it is using the command npm uninstall {project_name}.

Nice, saved me also.

vkourtis commented 1 month ago

Alright finally managed to build for android after days of debugging. Apparently there was a dependency in my package.json called {project_name}: ":file". I wasn't sure how it got there in the first place. Deleting the dependency was also an issue as it keeps reappearing after I save the file. The only way to remove it is using the command npm uninstall {project_name}.

Thank you it was the same for me. Appeared in an unrelated commit of a colleague. Do we have any idea how this pops up?

kbrattli commented 3 weeks ago

Alright finally managed to build for android after days of debugging. Apparently there was a dependency in my package.json called {project_name}: ":file". I wasn't sure how it got there in the first place. Deleting the dependency was also an issue as it keeps reappearing after I save the file. The only way to remove it is using the command npm uninstall {project_name}.

You are a hero

pragya-dbq commented 3 weeks ago

Alright finally managed to build for android after days of debugging. Apparently there was a dependency in my package.json called {project_name}: ":file". I wasn't sure how it got there in the first place. Deleting the dependency was also an issue as it keeps reappearing after I save the file. The only way to remove it is using the command npm uninstall {project_name}.

Thank u soo much