Error on start: Unable to load script.

Please provide the following:

  1. SDK Version: 39
  2. Platforms(Android/iOS/web/all): Android

After ejecting and trying to run the app on a physical device, the app will load with the splash screen and then show this error. I can dismiss the error but the app then stays on the splash screen.

https://www.google.com/search?q=react-native+unable+to+load+script&rlz=1C5CHFA_enCA927CA927&oq=react-native+unable+to+load+script&aqs=chrome.0.0i457j0i22i30l4.2656j0j7&sourceid=chrome&ie=UTF-8

if you can’t find a solution there, let us know :slight_smile: ideally also share your project so we can reproduce it.

Could you explain exactly what you mean by “trying to run the app on a physical device”? i.e. what steps did you take to run the app after ejecting? Also, do you mean that you are able to run it on an emulator?

@notbrent All of the results on Google seem to be based on running apps with react-native CLI and not Expo. I tried running the react-native CLI commands but still received the error.

Can you explain (or link to) how to share a project? Happy to do that.

@wodin By running on a physical device I mean:

  1. Run expo start from the project dir
  2. Open android folder in Android Studio
  3. Connect a physical device to the computer via USB and select that as my device to run app on
  4. Click Play

^This is the flow we’ve always used (we were on SDK34 previously fwiw)

I had the same thought as you and tried to run on an emulator, but when attempting that, the build fails with the following error:

Very weird that only happens with an emulator.

1 Like

RESOLVED. I should have read the Bare Workflow documentation better. I didn’t run yarn android

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.