Description
Beginning version 2.10.9, where App Startup is used in Joda-time-android, the Joda time doesn't get initialized in the non-main process anymore. When if I switch back to version 2.10.7.2, then everything works
My suspicious it's the AppStartup bug/issue, where it only setup for the main process and not the other process. Not sure if there's any setting to get it setup for all processes. e.g. it is not working in the sync process of a syncService i.e. any services with android:process
set.
To demonstrate the issue, I have created a very simple design in https://github.com/elye/issue_android_joda_time_app_startup with
- MainApplication
- MainActivity
- MainService
- SyncService
- AccountService
When running it, the MainApplication, MainActivity and MainService that run on the main process works fine.
But the MainApplication and MainService that run on the sync process can no longer get the timezone.
Run the app and track the log using TrackDebug
, you'll get log like below
D/TrackDebug: MainApplication com.example.myapplication Thread[main,5,main]
D/TrackDebug: - MainApplication America/New_York
D/TrackDebug: Dispatchers.IO com.example.myapplication Thread[DefaultDispatcher-worker-2,5,main]
D/TrackDebug: - Dispatchers.IO America/New_York
D/TrackDebug: MainService com.example.myapplication Thread[main,5,main]
D/TrackDebug: - MainService America/New_York
D/TrackDebug: MainApplication com.example.myapplication:sync Thread[main,5,main]
D/TrackDebug: - MainApplication The datetime zone id 'America/New_York' is not recognized
D/TrackDebug: Dispatchers.IO com.example.myapplication:sync Thread[DefaultDispatcher-worker-1,5,main]
D/TrackDebug: - Dispatchers.IO The datetime zone id 'America/New_York' is not recognized
D/TrackDebug: SyncService com.example.myapplication:sync Thread[main,5,main]
D/TrackDebug: - SyncService The datetime zone id 'America/New_York' is not recognized
Hope this ease debugging from your side.