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
Ubuntu
first time, I created new app with react-native init project-name
.
I got the same error.
so i do the following steps to resolve this in my case.
sudo chown user-name-of-pc /dev/kvm
in my case.While debugging from your Android phone, select Use USB to Transfer photos (PTP)
.
Create Folder assets
in project-name/android/app/src/main
index.js
be avaiable into your project root
directory and then run below command from console after cd project-name
directory.
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
or for index.android.js then
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
run command ./studio.sh
in android-studio/bin
directory. It will opens up Android Studio.
run command react-native run-android
.