Open jarodhanko opened 6 years ago
I think it might be related to this expo issue
Edit: That did seem to be this issue. It is now running but lists Module AppRegistry is not a registered callable module
02-27 12:51:38.316 30638 2659 D BackgroundTask: Job is running
02-27 12:51:38.378 30638 30638 D BackgroundTask: Returning HeadlessJsTaskConfig, timeout=30 ms
02-27 12:51:38.386 30638 30638 D ReactNative: ReactInstanceManager.ctor()
02-27 12:51:38.466 30638 30638 D ReactNative: ReactInstanceManager.createReactContextInBackground()
02-27 12:51:38.471 30638 30638 D ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner()
02-27 12:51:39.446 30638 30638 D ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer()
02-27 12:51:39.448 30638 30638 D ReactNative: ReactInstanceManager.recreateReactContextInBackground()
02-27 12:51:39.448 30638 30638 D ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread()
02-27 12:51:39.455 30638 2680 D ReactNative: ReactInstanceManager.createReactContext()
02-27 12:51:39.466 30638 2680 D ReactNative: Initializing React Xplat Bridge.
02-27 12:51:39.472 30638 2680 D ReactNative: Initializing React Xplat Bridge before initializeBridge
02-27 12:51:39.515 30638 2680 D ReactNative: Initializing React Xplat Bridge after initializeBridge
02-27 12:51:39.515 30638 2680 D ReactNative: CatalystInstanceImpl.runJSBundle()
02-27 12:51:39.521 30638 2682 D ReactNative: ReactInstanceManager.setupReactContext()
02-27 12:51:39.521 30638 2682 D ReactNative: CatalystInstanceImpl.initialize()
02-27 12:51:40.136 30638 2681 E ReactNativeJS: The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo. Visit https://docs.expo.io to learn more about developing an Expo project.
02-27 12:51:40.157 30638 2681 E ReactNativeJS: Module AppRegistry is not a registered callable module (calling startHeadlessTask)
This issue should probably be closed, since it appears that react-native-background-task (and react-native-background-job) or any other library that requires access to the application context is not supported in Expokit (afaict). If anyone knows of a way to make it work, please let me know.
I am defining my background task so that it is not doing anything, simply running, and then finishing. The task schedules just fine, and adb says the job is running, however my app immediately crashes ('Appname' has stopped). I double checked based off of the other issues and the manual configuration is correct. I am running an Expokit project, where the only linked libraries are react-native-background-task and realm (for react-native-queue). I haven't been able to get any actual error information (adb doesn't show any errors, and I can't run the Android debugger at the same time as expo). Any ideas on what the issue might be?
Using Galaxy S8+ running 7.0.0 (same issue on GS4 running 5.0.1)
Example adb logs
Defining Background task in root App.js outside of component as