expo: Android IllegalThreadStateException with SDK 44

Summary

Unfortunately I don’t know where is the problem, I got this error in Google Play Developer Console in 3 different apps, built with EAS and SDK 44. Could it be a problem with expo-updates package?

java.lang.IllegalThreadStateException: 
  at java.lang.Thread.start (Thread.java:872)
  at expo.modules.updates.UpdatesController.initializeDatabaseHandler (UpdatesController.kt:59)
  at expo.modules.updates.UpdatesController.start (UpdatesController.kt:205)
  at expo.modules.updates.UpdatesController$Companion.initialize (UpdatesController.kt:448)
  at expo.modules.updates.UpdatesPackage$createReactNativeHostHandlers$handler$1.onWillCreateReactInstanceManager (UpdatesPackage.kt:41)
  at expo.modules.ReactNativeHostWrapper.createReactInstanceManager (ReactNativeHostWrapper.kt:28)
  at com.facebook.react.ReactNativeHost.getReactInstanceManager (ReactNativeHost.java:39)
  at expo.modules.updates.UpdatesUtils.sendEventToReactNative (UpdatesUtils.kt:139)
  at expo.modules.updates.UpdatesController$start$1.onBackgroundUpdateFinished (UpdatesController.kt:254)
  at expo.modules.updates.loader.LoaderTask$launchRemoteUpdateInBackground$1$1.onFailure (LoaderTask.kt:282)
  at expo.modules.updates.loader.Loader.finishWithError (Loader.kt:142)
  at expo.modules.updates.loader.Loader.access$finishWithError (Loader.kt:18)
  at expo.modules.updates.loader.Loader$start$1.onFailure (Loader.kt:94)
  at expo.modules.updates.loader.FileDownloader$downloadManifest$1.onFailure (FileDownloader.kt:266)
  at expo.modules.updates.loader.FileDownloader$downloadData$1.onFailure (FileDownloader.kt:343)
  at okhttp3.RealCall$AsyncCall.execute (RealCall.java:211)
  at okhttp3.internal.NamedRunnable.run (NamedRunnable.java:32)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:923)

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

44

Environment

 Expo CLI 5.0.3 environment info:
    System:
      OS: Windows 10 10.0.19043
    Binaries:
      Node: 14.18.1 - C:\Program Files\nodejs\node.EXE
      npm: 8.1.4 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version     2020.3.0.0 AI-203.7717.56.2031.7621141
    npmPackages:
      babel-preset-expo: 9.0.1 => 9.0.1
      expo: ^44.0.0 => 44.0.0
      react: 17.0.1 => 17.0.1
      react-native: 0.64.3 => 0.64.3
    Expo Workflow: managed

Reproducible demo

This problem occurred on Android 11 and Android 10, with Samsung Galaxy A12, Galaxy A50, Galaxy A71, Galaxy S9, Galaxy S10, Galaxy S20+ 5G.

Command used to build and submit: eas build -p all --profile my-profile --auto-submit

UPDATE: I’ve deployed a new build with expo build:android --no-wait -t app-bundle and I don’t have this problem so maybe the problem is due to EAS build or specifically to expo-updates.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 7
  • Comments: 17 (5 by maintainers)

Most upvoted comments

expo-updates@0.11.4 has been released with a fix for this issue; you’ll need to make a new build to get the fix. Going to go ahead and mark this as closed. Thanks all for the report, and apologies again for the trouble.

Hi all, thanks for the report and sorry for the delay on our end. We’ve got a fix in the works that should be out by the end of the week (hopefully sooner). Many thanks to @jparkrr for the repo which was very helpful in finding the cause and testing a fix quickly.

The issue does reproduce in a new expo sdk 44 app with hermes enabled.

You must turn on airplane mode (or turn off wifi for emulator). Sometimes it launches but usually it crashes for me. Try it a few times.

APK: https://github.com/jparkrr/expo-android-crash/raw/main/build-10-01-2022-15:31.apk Repo: https://github.com/jparkrr/expo-android-crash