I\'m trying to run my first React Native project for first time on my device (Android 4.2.2).
And I get:
unable to load script from assets in
I have just encounterred exactly the same problem and solved it. So hope to be helpful.
Suppose you are assemblling a release application package (.apk)
Check if your assets folder exist?: \android\app\src\main\assets If not, create one.
After executing "Assemble Release", check if there is anything in that folder(\android\app\src\main\assets) If not, find js bundle file(index.android.bundle), which should be in more than one of the following paths:
*a)\android\app\build\intermediates\merged_assets\release\out\index.android.bundle
b)\android\app\build\intermediates\merged_assets\release\mergeReleaseAssets\out\index.android.bundle
c)\android\app\build\intermediates\assets\release\index.android.bundle
d)\android\app\build\generated\assets\react\release\index.android.bundle*
A better way is to use "Everything" to search the file name: index.android.bundle.
Then copy this file into your assets folder(\android\app\src\main\assets\index.android.bundle)
Go back to powershell or command console, execute:
react-native run-android --variant=release
It should work.
Good luck!