react-native: Red screen error from today not sure what has happened
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
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 15
- Comments: 40 (1 by maintainers)
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
Problem started this morning. Below the error message from emulator.
Also packager shows 404 error.
RN Version is 0.49.3. Hope someone can suggest any help.
the same problem, RN version is 0.47.0
It looks like issue started from today stackover flow question
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
Duplicate of https://github.com/facebook/react-native/issues/19259 (based on followup comments)
@react-native-bot this issue needs some help pls…
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 abintray 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 is0.55.3
, you’ll be getting that obscureGET /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: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:
compile "com.facebook.react:react-native:+"
tocompile "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.Edit your
android/build.config
, under theallprojects/repositories
section, move the maven source that points to the local file system to the top, so it would look similar to this:After that, edit your
android/app/build.config
file and add this block:These changes will make two things:
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.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
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:
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
Is this issue related to Gradle ?
I’ve just had the same problem RN version 0.47.0 help!!!