"Unable to load script" only when generating .aab

  android, gradle, javascript, react-native

Always after generating .aab with ./gradlew clean bundleProdRelease app crashes in a real device.

Unable to load script. Make sure you’re either running a Metro server (run ‘react-native start’) or that your bundle ‘index.android.bundle’ is packaged correctly for release.

This only happens with .abb ./gradlew clean bundleProdRelease but not with .apk ./gradlew clean assembleProdRelease.

Apparently it is a bug in React Native, but none of the solutions worked for me.

I’m using gradle plugin 4.1.

Source: Ask Javascript Questions