➜ test58 react-native info
React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: (4) x64 Intel(R) Core(TM) 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
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
Any idea what is wrong here ? The new release ? My environment ?
hey, try to follow these steps:
https://medium.com/@adityasingh_32512/solved-unable-to-load-script-from-assets-index-android-bundle-bdc5e3a3d5ff
It worked to me.
(sorry if isn't allowed to share links here)
Thanks for the workaround. Is there anything we can do on our side to prevent this from being necessary?
@rfernandotimedev & @hramos - I followed the above article that basically tell me to create the bundle and then to run the app again via react-native run android but it did not help.
Same crash with the same OkHttp Dispatcher error.
What bother me here is that I am running a vanilla, out-of-the-box react-native app and would expect that initial flow to come smoothly. I actually have issues upgrading from 0.53 my real app and wanted first to see how a new fresh 0.58 app will behave...
+1
I also face this problem after update Android 3.3
UPDATE
After updating gradle version 4.x It is OK now.
Did anyone else find a solution to this? We've been able to get it to work on iOS but I get a BUILD SUCCESSFUL message in the terminal on Android but it crashes the moment it loads. I _just_ created this through react-native init last week so it's RN 58.6. Any suggestions? Downgrade? Upgrade?
Hello there 👋 by using the repro / the list of steps to reproduce, we can't actually see the reported bug on RN 0.59 so we'll close this issue. It may have something to do with your local setup, please double check that you are using the correct version of Android Studio / XCode / Android NDK / Yarn / etc.
Side note, you could access logs from logcat to understand why your android app is crashing.
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.
Same issue with RN 0.59.2
Same issue with fresh app RN 0.59.3.
react-native init
react-native run-android
No code was done yet on the app.
ERROR:
E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.twinpharma, PID: 13544
java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY
@Titozzz is right. It is not the issue with RN Version.
I closely checked the console after running react-native init "ProjectName" command and found "Yarn" was missing. Then I installed Yarn first and ran the same command. It fixed the issue for me.
Hope it will help you guys. Yarn was missing in my case, you can keep eye on your console may be some other tool is missing in your case.
Installing Yarn did not prevent the OkHttp Dispatcher error for me.
Same problem here with RN 0.59 RC - any solutions?
Solved when I moved from 0.59.0-rc.0 to 0.59.8
i restarted my laptop and it worked :sweat_smile:
i restarted my laptop and it worked 😅
Maybe you have two projects, and start nodejs server in wrong folder for example.
i restarted my laptop and it worked 😅
Maybe you have two projects, and start nodejs server in wrong folder for example.
no i checked
After initial Install, App does not launch correctly from the Launch Button
I can see App restart alert , also when I click OK button, happen Keep stoping message
My package.json is following
{
"name": "project name",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"android-windows": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android"
},
"dependencies": {
"native-base": "^2.12.1",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-calendars": "^1.196.0",
"react-native-datepicker": "^1.7.2",
"react-native-dropdownalert": "^4.1.0",
"react-native-events-calendar": "^1.0.8",
"react-native-firebase": "^5.2.3",
"react-native-gesture-handler": "^1.3.0",
"react-native-indicators": "^0.13.0",
"react-native-keyboard-aware-scroll-view": "^0.8.0",
"react-native-modalbox": "^1.7.1",
"react-native-render-html": "^4.1.2",
"react-native-splash-screen": "^3.2.0",
"react-navigation": "^3.11.0",
"react-redux": "^7.1.0",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@babel/core": "7.4.5",
"@babel/runtime": "^7.0.0-beta.55",
"babel-jest": "24.8.0",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.54.1",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
Most helpful comment
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.