App Crashes on device but not on Expo Go - java.lang.Exception

My App is a managed workflow and Eas Cli 4.1.1 and works fine on Expo Go but crashes once insalled on device. It displays the splash screen for a second then crashes with the following Error Message which I have obtained from Logcat. Your assistance will be highly appreciated.

> Failed to launch embedded or launchable update
                                                                                                
 java.lang.Exception: No launchable update was found. If this is a bare workflow app, make 
 sure you have configured expo-updates correctly in android/app/build.gradle.
                                                                                                     
 at expo.modules.updates.launcher.DatabaseLauncher.launch(DatabaseLauncher.kt:71)
                                                                                                     
 at expo.modules.updates.loader.LoaderTask$launchFallbackUpdateFromDisk$1.onSuccess(LoaderTask.kt:286)
                                                                                                     
at expo.modules.updates.loader.Loader.finishWithSuccess(Loader.kt:153)
                                                                                                     
at expo.modules.updates.loader.Loader.handleAssetDownloadCompleted(Loader.kt:326)
                                                                                                     
at expo.modules.updates.loader.Loader.downloadAllAssets(Loader.kt:250)
                                                                                                     
at expo.modules.updates.loader.Loader.processUpdateManifest(Loader.kt:217)
                                                                                                     
at expo.modules.updates.loader.Loader.access$processUpdateManifest(Loader.kt:25)
                                                                                                     
at expo.modules.updates.loader.Loader$start$1.onSuccess(Loader.kt:116)
                                                                                                     
at expo.modules.updates.loader.EmbeddedLoader.loadRemoteUpdate(EmbeddedLoader.kt:58)
                                                                                                     
at expo.modules.updates.loader.Loader.start(Loader.kt:102)
                                                                                                     
at expo.modules.updates.loader.LoaderTask.launchFallbackUpdateFromDisk(LoaderTask.kt:279)
                                                                                                     
at expo.modules.updates.loader.LoaderTask.start(LoaderTask.kt:136)
                                                                                                     
at expo.modules.updates.UpdatesController.start(UpdatesController.kt:395)
                                                                                                     
at expo.modules.updates.UpdatesController$Companion.initialize(UpdatesController.kt:603
                                                                                                                                                                                                 
 at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42)
                                                                                                     
 at com.events.party42nite.MainApplication.onCreate(MainApplication.java:71)
                                                                                                     
 at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1277)
                                                                                                     
 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6759)
                                                                                                     
 at android.app.ActivityThread.-$Nest$mhandleBindApplication(Unknown Source:0)
                                                                                                     
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2133)
                                                                                                     
 at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                     
 at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                     
 at android.os.Looper.loop(Looper.java:288)
                                                                                                     
 at android.app.ActivityThread.main(ActivityThread.java:7872)
                                                                                                     
 at java.lang.reflect.Method.invoke(Native Method)
                                                                                                     
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                     
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Error 2

Failed to download remote update from URL: https://u.expo.dev/624c77c1-015b-42ac-b783- 
9fca8590d10f
                                                                                                
   java.lang.Exception: There are no branches that match the current request
                                                                               

hey @p42nadmin ,

Some background: your app comes bundled with an ‘embedded update’. This is the code that is run from the start. Later on, when the app asks for the newest update from our servers, if there is none to be served or the new update was buggy, we will fall back to the embedded update.

Error 1: you embedded update is crashing, which is why the error says there is ‘no launchable update’. We downloaded your .aab, used bundletool to extract apk, installed apk to emulator, ran it with logcat attached and this is the error log:

FATAL EXCEPTION: create_react_context
                                                                                                    Process: com.events.party42nite, PID: 8335
                                                                                                    java.lang.IllegalStateException: Native module RNDatePicker tried to override RNDatePicker. Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true. This error may also be present if the package is present only once in getPackages() but is also automatically added later during build time by autolinking. Try removing the existing entry and rebuild.
                                                                                                    	at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:55)
                                                                                                    	at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1467)
                                                                                                    	at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1438)
                                                                                                    	at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1340)
                                                                                                    	at com.facebook.react.ReactInstanceManager.-$$Nest$mcreateReactContext(Unknown Source:0)
                                                                                                    	at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1111)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
2023-08-24 11:46:37.969  8335-8382  dev.expo.updates        com.events.party42nite               E  {"timestamp":1692902797969,"message":"Could not emit Expo.nativeUpdatesStateChangeEvent check event; no event emitter was found.","code":"JSRuntimeError","level":"error","stacktrace":["expo.modules.updates.logging.UpdatesLogger.logEntryString(UpdatesLogger.kt:135)","expo.modules.updates.logging.UpdatesLogger.error(UpdatesLogger.kt:96)","expo.modules.updates.logging.UpdatesLogger.error(UpdatesLogger.kt:86)","expo.modules.updates.logging.UpdatesLogger.error$default(UpdatesLogger.kt:81)","expo.modules.updates.UpdatesUtils.sendEventToReactNative$lambda$4(UpdatesUtils.kt:197)","expo.modules.updates.UpdatesUtils.$r8$lambda$GWsksUGhLIkRuuXJF6UlMYNZXDo(Unknown Source:0)","expo.modules.updates.UpdatesUtils$$ExternalSyntheticLambda0.run(Unknown Source:10)","android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)","java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)","java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)","java.lang.Thread.run(Thread.java:1012)"]}

Error 2: This happens when the app asks the servers for a new update but there is none to be served. The reason is because there is no branch linked to your channel. In our website, you can check that there is no branch linked at https://expo.dev/accounts/[account]/projects/[project]/channels. If you havent already, you can publish an update to your branch (eas update), then link the branch to your channel (eas channel:edit).

Overall: Error 1 is fatal, but Error 2 is not

1 Like

Hey @quinlanj , Thank you so much for your response which is very informative. May you please advise me on what I should do next as I dont know where RNDatePicker has been created twice?

@p42nadmin no problem! As for the RNDatePicker error, I’d recommend checking your dependencies. From a cursory search, if you declare multiple datepicker dependencies they could be trying to overwrite each other: Native module RNDatePicker tried to override RNDatePicker · Issue #787 · react-native-datetimepicker/datetimepicker · GitHub

1 Like

Thank you so much @quinlanj Ive had a look and realised that my package.json file, had multiple date-picker modules in the dependencies`

( "@react-native-community/datetimepicker": “7.2.0”, “react-native-date-picker”: “^4.2.14” & “react-native-datepicker”: “^1.7.2”).

I removed

( "“react-native-date-picker”: “^4.2.14” & “7.2.0” & “react-native-datepicker”: “^1.7.2”`).

I then I cleaned the cache, ran yarn and rebuilt. I then followed what you did and used bundletool to extract apk, installed apk to emulator, ran it with logcat and Im still facing the below issues:

FATAL EXCEPTION: mqt_native_modules
Process: com.events.party42nite, PID: 10604
The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
at com.facebook.internal.Validate.sdkInitialized(Validate.kt:117)
at com.facebook.appevents.AppEventsLoggerImpl.(AppEventsLoggerImpl.kt:630)
at com.facebook.appevents.AppEventsLoggerImpl.(AppEventsLoggerImpl.kt:70)
at com.facebook.appevents.AppEventsLogger.(AppEventsLogger.kt:106)
at com.facebook.appevents.AppEventsLogger.(Unknown Source:0)
at com.facebook.appevents.AppEventsLogger$Companion.newLogger(AppEventsLogger.kt:357)
at com.facebook.appevents.AppEventsLogger.newLogger(Unknown Source:2)
at com.facebook.reactnative.androidsdk.FBAppEventsLoggerModule.initialize(FBAppEventsLoggerModule.java:129)
at com.facebook.react.bridge.ModuleHolder.doInitialize(ModuleHolder.java:236)
at com.facebook.react.bridge.ModuleHolder.markInitializable(ModuleHolder.java:100)
at com.facebook.react.bridge.NativeModuleRegistry.notifyJSInstanceInitialized(NativeModuleRegistry.java:124)
at com.facebook.react.bridge.CatalystInstanceImpl$2.run(CatalystInstanceImpl.java:443)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:1012)

Hi @p42nadmin

Are you using react-native-fbsdk-next?

Did you install it as per the instructions here?

Note: as with other native modules, although the instructions say you must prebuild, this is not 100% true. Actually, if you are using the Managed workflow, when you run eas build, the build server will automatically run npx expo prebuild. So although it is necessary to prebuild, it is not necessary for you to prebuild.

1 Like

Hi @wodin Thank you for your response, I followed your instructions and my app is working now and did not crash when opened. I really appreciate it

Hey @wodin , quick question do you know how or where I can find infor to solve this below issue I face when building ios?

The Swift pod FirebaseCoreInternaldepends uponGoogleUtilities, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers!globally in your Podfile, or specify:modular_headers => true for particular dependencies.

Hmm… not sure.

There’s stuff about modular_headers here:

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.