question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Native app shows 'index.android.bundle' error when setting targetSdkVersion to 28

See original GitHub issue

🐛 Bug Report

After I updated my targetSdkVersion from 27 to 28, I ran react-native run-android connected to an emulator and was presented with a screen stating “Unable to load script from assets ‘index.android.bundle’. Make sure your bundle packaged correctly or you’re running a package server.”

To Reproduce

From a new or existing (functioning) React Native app, change the targetSdkVersion in android/build.gradle file to 28.

Expected Behavior

The app loads as it did before.

Environment

  React Native Environment Info:
    System:
      OS: Linux 4.4 Ubuntu 16.04.5 LTS (Xenial Xerus)
      CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
      Memory: 17.71 GB / 31.87 GB
      Shell: 4.3.48 - /bin/bash
    Binaries:
      Node: 8.15.0 - ~/.nvm/versions/node/v8.15.0/bin/node
      Yarn: 1.12.3 - /usr/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v8.15.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      Android SDK:
        API Levels: 23, 24, 25, 26, 28
        Build Tools: 25.0.0, 28.0.3
        System Images: android-28 | Intel x86 Atom_64
    npmPackages:
      react: 16.6.3 => 16.6.3
      react-native: 0.58.3 => 0.58.3
    npmGlobalPackages:
      react-native-cli: 2.0.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
Imran-csecommented, Oct 21, 2019

Starting with Android 9.0 (API level 28), cleartext support is disabled by default.

AndroidManifest.xml file change as following

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        ...
        android:usesCleartextTraffic="true"
        ...>
        ...
    </application>
</manifest>
0reactions
cpojercommented, Mar 20, 2019

Duplicate of #22024.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load script from assets index.android.bundle
It's a bug in the recent version. You have to use the previous version by using react-native init ProjectName --version=0.55.4 The problem ...
Read more >
React native build release error: uncompiled PNG file passed ...
Error : uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays. DO NOT use android....
Read more >
Addressing common errors in React Native - LogRocket Blog
Solution 1: Package the bundle correctly. All of your app's JavaScript is bundled into the index.android.bundle file.
Read more >
react native compilesdkversion is not specified. please add it ...
I solved this issue by clearing the cache and re-install react-native-webview. The steps shown as below: reset cache. npm install react-native-webview --save.
Read more >
React Native Upgrade Helper
Show me how to upgrade! ... You can also provide your app name by clicking the settings icon on the top ... 16,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found