React-native: Red screen error from today not sure what has happened

Created on 15 May 2018  Â·  40Comments  Â·  Source: facebook/react-native

It was working fine till yesterday but from today it has started throwing this error GET /index.android.delta?platform=android&dev=true&minify=false HTTP/1.1" 404 79 "-" "okhttp/3.8.0"

and respective stackoverflow question which is also asked today only stackoverflow question

Environment


Environment:
OS: Linux 3.10
Node: 8.9.4
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.7.0
Xcode: N/A
Android Studio: Not Found

Packages: (wanted => installed)
react: ^16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: ^0.48.0 => 0.48.0

Steps to Reproduce

yesterday it was working fine suddenly what happened not sure

Actual Behavior

App is not starting at all throwing red screen error

Linux Locked

Most helpful comment

add compile ("com.facebook.react:react-native:0.44.0") { force = true } with your version of react native to android/app/gradle.build and comment existing compile react-native line

All 40 comments

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?

Thank you for your contributions.

It looks like issue started from today stackover flow question

Problem started this morning. Below the error message from emulator.
screenshot_1526374131

Also packager shows 404 error.

Loading dependency graph...::ffff:127.0.0.1 - - [15/May/2018:08:15:11 +0000] "GET /index.delta?platform=android&dev=true&minify=false HTTP/1.1" 404 71 "-" "okhttp/3.6.0"

RN Version is 0.49.3.
Hope someone can suggest any help.

@react-native-bot this issue needs some help pls...

the same problem, RN version is 0.47.0

Having exactly the same issue, thought it was my config or genymotion since all was working well yesterday but then I saw this thread. What could cause something to err this morning specifically, I wonder…? Hope we'll have some quick help here. Thanks guys. RN 0.48.3

Issue turned to React-Native version mismatch my react-native version is 53.0 one my friend has 52.3 but all computer at the android emulator we had same error. When we closed our computers yesterday it's all good but today we had this error only at the android emulator. In IOS emulator everything workin fine...

add compile ("com.facebook.react:react-native:0.44.0") { force = true } with your version of react native to android/app/gradle.build and comment existing compile react-native line

I've just had the same problem
RN version 0.47.0
help!!!

i just have the same problem too

Duplicate of https://github.com/facebook/react-native/issues/19259 (based on followup comments)

Hi

I Tried with "adrianwarkoczespeo" approach
But I am still getting same error. MY RN version - 0.47.1

same issue with RN 0.46.4 for Android (iOS works fine), started about an hour ago... I've build the app succesfully this morning!

Made changes to my android project as described in https://stackoverflow.com/a/50346228/6280369 , now it works again!

_So the question now is: Should we always lock the react native version in android projects???_

I am also facing same issue... does anyone have any solution?

I am also facing this problem.. I tried "adrianwarkoczespeo" approach,, This fix run the app and after 2 seconds app get close.. Is there any other solution..

I also tried adrianwarkoczespeo approach, but the same thing happened to me. RN Version is 0.49.3.

same problem with RN 0.46.4, yesterday afternoon I generated apk normally...

hi @ranarashidsadiq i have the same error, i fixed with te solution provided here, but my app crash for an error on react-native-svg after this change. Maybe is your case too

It is not only in the emulator, in the physical device is also occurring the same error.

The RN version is 0.44.0 and the Mobile is Moto Z2 with Oreo

@adrianwarkoczespeo soluition worked for me; however you have to put your own version of react-native.

Is this issue related to Gradle ?

@adrianwarkoczespeo soluition worked for me; however you have to put your own version of react-native. I'm on 0.47.1

as I am learning, I started using version 0.55.4 and the error is not occurring. Thanks for your help.

So, sharing more info about this mess. Here in our app, we use several native libs like react-native-svg. So, what we have to do, is excluse the react-native dependency for the compile dependency. If you not do that, somehow the runtime native lib will use react-native 55.3 bc this native libs also reference the react-native at android module using react-native:+ .

so you should do this to every native lib that you use at your app:

compile(project(':react-native-svg')) {
exclude group: 'com.facebook.react', module: 'react-native'
}

BUT FOR SURE this type of dependency reference is TOO fragile for a good lib as RN is. Here is a point that we sould discuss for next releases

So, sharing more info about this mess. Here in our app, we use several native libs like react-native-svg. So, what we have to do, is exclude the react-native dependency for the compile dependency. If you not do that, somehow the runtime native lib will use react-native 55.3 bc this native libs also reference the react-native at android module using react-native:+ .

so you should do this to every native lib that you use at your app:

compile(project(':react-native-svg')) {
exclude group: 'com.facebook.react', module: 'react-native'
}

BUT FOR SURE this type of dependency reference is TOO fragile for a good lib as RN is. Here is a point that we sould discuss for next releases

check your react native version from node_modules/package.json at line no. 18

it looks like "react-native": "0.48.4",

Edit android/app/build.gradle

use this

compile ("com.facebook.react:react-native:0.48.4") { force = true }

if in your case its 0.44.0 or something else, use that instead of 0.48.4

and it will work

compile ("com.facebook.react:react-native:..") { force = true }

This works! But it still looks like a workaround. It could bite you back when you upgrade RN version, forgetting to change this value also.

I have the same problem, but the project flashing when i add compile ("com.facebook.react:react-native:0.40.0") { force = true } instead of compile "com.facebook.react:react-native:+". who can help me, plz!!!
project: react-native 0.40.0

ios working fine.
started happening after upgrading android studio.

I've the same issue in android, react-native version 0.41.2

In addition to what @guilharj said, I also had to force the dependency of the fbsdk like this, because I was already forcing another dependency:

project(':react-native-fbsdk') {
    configurations.all {
        resolutionStrategy {
            force 'com.facebook.android:facebook-android-sdk:4.22.1'
            force 'com.facebook.react:react-native:0.43.0'
        }
    }
}

Solved!

Look into your package.json file and look at exactly what version of react native you are using. Go to your build.gradle and paste the version like so:

compile ("com.facebook.react:react-native:{your_node_version_here}") { force = true }

@wmonecke this works up until the point my javascript bundle is created. when it finishes loading it crashes the app instantaneously. Any idea how to resolve this?

@wmonecke this not work for me.

The error body is: "Cannot find entry file index.android.js in any of the roots"

in console

Bundling index.android.js [development, non-minified, hmr disabled] 0.0% (0/1), failed.
error: bundling failed: "Cannot find entry file index.android.js in any of the roots: ["C:\\Users\\Francesca\\Progetti\\ReactNative\\cDocking"]"

I hope this still helps somebody, but this is what I've found so far and how I solved the problem for my project.
First of all, I was also freaking out about the compile "com.facebook.react:react-native:+" dependency, but it turned out that it was taking the only version avaliable which is located under the ../node_modules/react-native/android path, or so it was until yesterday (for me).

It seems there's another available source to get the react-native artifact for android, which is a bintray jcenter repository. I don't really know why it didn't take any artifact from that repository up until now, because there seems to be a lot of versions there, but the thing is that it is doing it now, so unless yor RN library matches the current latest version at bintray, which is 0.55.3, you'll be getting that obscure GET /index.android.delta?platform=android&dev=true&minify=false HTTP/1.1" 404 79 "-" "okhttp/3.8.0" error.

You can verify this by running gradlew app:dependencies --debug, the output will be quite big so I recommend redirecting it to a file (gradlew app:dependencies --debug > dependencies.log). In that output you'll find a text similar to this:

00:21:21.290 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] Metadata file found for module 'com.facebook.react:react-native:0.48.2' in repository 'maven2'.
00:21:21.290 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver] Using com.facebook.react:react-native:0.55.3 from Maven repository 'BintrayJCenter'

It seems someone already reported it in the artifact repository, so it may be fixed sometime now.

So, to fix the problem now instead of waiting for the fix, I've tried two options that worked for me:

  • The one everyone's been suggesting here, you can change compile "com.facebook.react:react-native:+" to compile "com.facebook.react:react-native:0.44.2 (or whatever version you're using)". This one seems pretty obvious but it makes the build fragile, as you have to remember to change this version if you update your RN library.
  • The one I liked better:

Edit your android/build.config, under the allprojects/repositories section, move the maven source that points to the local file system to the top, so it would look similar to this:

allprojects {
    repositories {
        maven {
            // MOVE THIS SOURCE HERE, AT THE TOP
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        mavenLocal()
        maven { url 'https://maven.google.com' }
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

After that, edit your android/app/build.config file and add this block:

configurations.all {
    resolutionStrategy.preferProjectModules()
}

These changes will make two things:

  • Force gradle to find your local version first.
  • Make gradle prefer the local version instead of the remote ones.

I liked this solution better as you can now update your RN library whenever you want without hardcoding the version in the build.gradle files.

Oh and remember to run gradlew clean after making the changes.

Yes, this resolve this issue but after that, if I try to use the commands react-native run-android or gradlew assembleRelease, appears a different one that says:

Cannot find entry file index.android.js in any of the roots: ["here my root"]

but I have a index.android.js in base directory!

someone can help me?

my dependencies
"react": "15.4.2",
"react-native": "0.41.2",
"react-native-camera": "^0.6.0",
"react-native-fetch-blob": "^0.10.6",
"react-native-keyevent": "^0.1.1",
"react-native-material-tabs": "^1.1.0",
"react-native-sound": "^0.10.3",
"react-native-swipe-out": "^2.0.14",
"react-native-tab-view": "0.0.56",
"react-native-vector-icons": "^4.0.0"

@mdelgado
I am the owner of the Maven artifact published in the repository you linked.
I've already replied by mail to the author of the review.
F.Y.I, this is not in any way the artifact that is causing you some issues.
We are explicitly publishing our react-native artifacts to a different group id than the one used by Facebook (we did that in the first place to avoid the kind of problem you are stating).
Facebook is using Maven Group ID com.facebook.react as it can be seen here
Our artifact will only be retrieved if you are explicitly and manually changing the default compile statement in the build.gradle from com.facebook.react:react-native:+ to com.walmartlabs.ern:react-native:+.
React Native core team stopped publishing artifacts to Maven since version 0.20.1 given that the AAR was then retrieved directly on the file system from node_modules instead of retrieving it from Maven.
Meanwhile, other users published react-native using THE SAME GROUP ID as Facebook (com.facebook.react) while they really shouldn't have.
Such as these users ... amongst many others !
https://bintray.com/minyushov/android/react-native
https://bintray.com/tuncaulubilge/times-xnative/react-native
While I feel sorry for the issue you are facing, we are not the ones to blame ;)

Locking as this was already marked as a duplicate, and the solution is already covered in the original issue.

Was this page helpful?
0 / 5 - 0 ratings