Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dawsonc623 opened this issue Feb 12, 2019 · 9 comments
Labels
Bug Platform: Android Android applications. Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.

Comments

@dawsonc623
Copy link

🐛 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
@react-native-bot react-native-bot added Platform: Android Android applications. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. Platform: Linux Building on Linux. labels Feb 12, 2019
@andresmtz98
Copy link

andresmtz98 commented Feb 12, 2019

+1 on Windows 10

@dapx
Copy link

dapx commented Feb 12, 2019

I think that It could be related to this issue: #23349 (comment)

@ds8k
Copy link

ds8k commented Feb 21, 2019

Same problem after upgrading from RN 57.7 to 58.5

@mr-niri
Copy link

mr-niri commented Feb 22, 2019

i had a same problme
and fixed by this link

@joseph-perez
Copy link

I ran into the same type of error with the bundle not being found. My issue was fixed by changing the gradle version I was using. I made a comment about this here #23739 (comment). Hopefully, the solution I used will work for someone else 😄

@thinkzh
Copy link

thinkzh commented Mar 14, 2019

我升级28以后,在Android9.0系统上 ,text多行显示时,最后一行显示一半,好像整个text不计算行间距似的,这是怎么回事

@davincho
Copy link

I ran into the same problem with a project I upgraded to 0.59, so I thought the upgrading went wrong.

After creating a new project with react-native init I ran into the same problem when trying to run it on android simulator or a physical device.

I followed the instructions mentioned here https://stackoverflow.com/questions/44446523/unable-to-load-script-from-assets-index-android-bundle-on-windows/44476757#44476757 (as @mr-niri posted) and this resolved my issue.

Output of react-native info

info
  React Native Environment Info:
    System:
      OS: macOS 10.14.3
      CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 276.07 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 27, 28
        Build Tools: 27.0.3, 28.0.3
        System Images: android-28 | Google Play Intel x86 Atom
    IDEs:
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3
      react-native: 0.59.1 => 0.59.1

@cpojer
Copy link
Contributor

cpojer commented Mar 20, 2019

Duplicate of #22024.

@Imran-cse
Copy link

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>

@facebook facebook locked as resolved and limited conversation to collaborators Mar 20, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

No branches or pull requests