Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"react-native run-android --variant=release" removes index.android.bundle and then fails on ENOENT for the same file?

Tags:

react-native

I bundled my latest release:

cd C:\s\ReactNative\MyRNProject\android gradlew :app:bundleRelease

After bundleRelease completed, I validated that the following file existed on my filesystem:

C:\s\ReactNative\MyRNProject\android\app\build\generated\assets\react\release\index.android.bundle

Then I executed the following command to test the release bundle before deployment:

react-native run-android --variant=release

However, this command failed with the following error:

error ENOENT: no such file or directory, open 'C:\s\ReactNative\MyRNProject\android\app\build\generated\assets\react\release\index.android.bundle'

So it appears that some process within the "react-native run-android --variant=release" command deleted the index.android.bundle file generated by bundleRelease and then another subsequent process within the "react-native run-android --variant=release" command failed because index.android.bundle no longer existed. Any idea what the root cause of this error might be or how to avoid?

like image 547
user10307666 Avatar asked Oct 17 '25 03:10

user10307666


1 Answers

Clean your project after working wall

cd android 
gradlew clean

and

react-native run-android --variant=release

or

npx react-native run-android --mode release // ios
like image 197
Shivo'ham 0 Avatar answered Oct 19 '25 00:10

Shivo'ham 0



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!