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 init app is crashing at startup

See original GitHub issue

Environment

➜ test58 react-native info

React Native Environment Info: System: OS: macOS 10.14.2 CPU: (4) x64 Intel® Core™ i5-4278U CPU @ 2.60GHz Memory: 662.13 MB / 8.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node Yarn: 1.12.3 - /usr/local/bin/yarn npm: 6.5.0 - ~/.nvm/versions/node/v8.10.0/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: 17, 19, 20, 21, 23, 24, 25, 26, 27, 28 Build Tools: 23.0.1, 23.0.2, 23.0.3, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.2, 27.0.3, 28.0.3 System Images: a…-23 | Intel x86 Atom, a… | Intel x86 Atom_64, a…google_apis | Google APIs Intel x86 Atom Sys…, a…gle_apis | Google APIs Intel x86 Atom_64 … IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.1/10B61 - /usr/bin/xcodebuild 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-git-upgrade: 0.2.7

Description

I wanted to test newly release 0.58 so just created an new emtpy app using react-native init and run it. The app crashes at start up and in the log I see

01-30 20:01:47.104  8410  8454 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
01-30 20:01:47.104  8410  8454 E AndroidRuntime: Process: com.test58, PID: 8410
01-30 20:01:47.104  8410  8454 E AndroidRuntime: java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at android.util.JsonReader.nextString(JsonReader.java:408)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at com.facebook.react.devsupport.BundleDeltaClient$BundleDeltaJavaClient.processDelta(BundleDeltaClient.java:103)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at com.facebook.react.devsupport.BundleDeltaClient.processDelta(BundleDeltaClient.java:71)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at com.facebook.react.devsupport.BundleDownloader.processBundleResult(BundleDownloader.java:314)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at com.facebook.react.devsupport.BundleDownloader.access$200(BundleDownloader.java:37)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at com.facebook.react.devsupport.BundleDownloader$1.onResponse(BundleDownloader.java:174)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:206)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-30 20:01:47.104  8410  8454 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:764)
01-30 20:01:47.107  9305  9454 W ActivityManager:   Force finishing activity com.test58/.MainActivity
01-30 20:01:47.115  9305  9336 I ActivityManager: Showing crash dialog for package com.test58 u0

Reproducible Demo

  • react-native init test58
  • cd test58
  • react-native run-android

Any idea what is wrong here ? The new release ? My environment ?

Issue Analytics

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

github_iconTop GitHub Comments

7reactions
rawbeanscommented, Mar 26, 2019

I am seeing this issue on RN 0.59.2 I freshly installed Android Studio 3.3.2 along with sdk, emulator etc. I run react-native init, and run-android and get the FATAL EXCEPTION: OkHttp Dispatcher error.

4reactions
HananeAlSamroutcommented, Jun 24, 2019

i restarted my laptop and it worked 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native Android app crashes immediately after start
My app crashes immediately after startup in release mode but it's working fine when using it in debug mode. List of things that...
Read more >
ReactNative App Crashes when Deployed to TestFlight
When I download the app from TestFlight on the same device, the app crashes immediately upon opening the app. The app is built...
Read more >
Troubleshooting - React Native
These are some common issues you may run into while setting up React Native. If you encounter something that is not listed here, ......
Read more >
App Center Crashes for React Native - Microsoft Learn
App Center Crashes (React Native) · Generate a test crash · Get more information about a previous crash · Customize your usage of...
Read more >
React Native IOS app crashes on startup - Countly
brand new react native app crashes on startup after calling Countly.init in IOS emulator react native 0.62 and works perfectly on android.
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