Skip to content

[Bug]: java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider #1168

Description

@enricobenedos

What happened?

Latest version of SDK completely broke the app with a startup crash. It is reproducible on both 5.5.x and 5.6.x.

Steps to reproduce?

1. `flutter create your-app`
2. add ` onesignal_flutter:5.6.4` to `pubspec.yaml`
3. `flutter run --release`

What did you expect to happen?

App simply to start.

OneSignal Flutter SDK version

3.44.6

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

flutter run -d emulator-5554 --release
Resolving dependencies...
Downloading packages...
  _fe_analyzer_shared 100.0.0 (105.0.0 available)
  analyzer 13.0.0 (14.1.0 available)
  build 4.0.7 (4.0.8 available)
  build_runner 2.15.1 (2.15.2 available)
  cli_util 0.4.2 (0.5.1 available)
  dart_style 3.1.9 (3.1.12 available)
  matcher 0.12.19 (0.12.20 available)
  meta 1.18.0 (1.19.0 available)
+ onesignal_flutter 5.6.4
  package_config 2.2.0 (3.0.0 available)
  test_api 0.7.11 (0.7.13 available)
  vector_math 2.2.0 (2.4.0 available)
Changed 1 dependency!
11 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Launching lib\main.dart on sdk gphone16k x86 64 in release mode...
Running Gradle task 'assembleRelease'...                           41.7s
✓ Built build\app\outputs\flutter-apk\app-release.apk (17.7MB)
Installing build\app\outputs\flutter-apk\app-release.apk...        946ms

Flutter run key commands.
h List all available interactive commands.
c Clear the screen
q Quit (terminate the application on the device).

E/AndroidRuntime(16148): FATAL EXCEPTION: main
E/AndroidRuntime(16148): Process: com.example.canonical_bug, PID: 16148
E/AndroidRuntime(16148): java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider
E/AndroidRuntime(16148):        at android.app.ActivityThread.installProvider(ActivityThread.java:9240)
E/AndroidRuntime(16148):        at android.app.ActivityThread.installContentProviders(ActivityThread.java:8726)
E/AndroidRuntime(16148):        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:8350)
E/AndroidRuntime(16148):        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(ActivityThread.java:0)
E/AndroidRuntime(16148):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2776)
E/AndroidRuntime(16148):        at android.os.Handler.dispatchMessageImpl(Handler.java:142)
E/AndroidRuntime(16148):        at android.os.Handler.dispatchMessage(Handler.java:126)
E/AndroidRuntime(16148):        at android.os.Looper.loopOnce(Looper.java:295)
E/AndroidRuntime(16148):        at android.os.Looper.loop(Looper.java:398)
E/AndroidRuntime(16148):        at android.app.ActivityThread.main(ActivityThread.java:9572)
E/AndroidRuntime(16148):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(16148):        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:575)
E/AndroidRuntime(16148):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:842)
E/AndroidRuntime(16148): Caused by: bb.g: java.lang.RuntimeException: Failed to create an instance of class androidx.work.impl.WorkDatabase.canonicalName
E/AndroidRuntime(16148):        at r0.a.b(r8-map-id-9c2611e21b71f263ad2bc36d8bee2f841c0e791518bf520ce902cc647ce23334:105)
E/AndroidRuntime(16148):        at r0.a.a(r8-map-id-9c2611e21b71f263ad2bc36d8bee2f841c0e791518bf520ce902cc647ce23334:84)
E/AndroidRuntime(16148):        at androidx.startup.InitializationProvider.onCreate(r8-map-id-9c2611e21b71f263ad2bc36d8bee2f841c0e791518bf520ce902cc647ce23334:49)
E/AndroidRuntime(16148):        at android.content.ContentProvider.attachInfo(ContentProvider.java:2694)
E/AndroidRuntime(16148):        at android.content.ContentProvider.attachInfo(ContentProvider.java:2663)
E/AndroidRuntime(16148):        at android.app.ActivityThread.installProvider(ActivityThread.java:9237)
E/AndroidRuntime(16148):        ... 12 more
E/AndroidRuntime(16148): Caused by: java.lang.RuntimeException: Failed to create an instance of class androidx.work.impl.WorkDatabase.canonicalName
E/AndroidRuntime(16148):        at f1.m.<init>(r8-map-id-9c2611e21b71f263ad2bc36d8bee2f841c0e791518bf520ce902cc647ce23334:1109)
E/AndroidRuntime(16148):        at f1.m.b(r8-map-id-9c2611e21b71f263ad2bc36d8bee2f841c0e791518bf520ce902cc647ce23334:44)
E/AndroidRuntime(16148):        at androidx.work.WorkManagerInitializer.create(r8-map-id-9c2611e21b71f263ad2bc36d8bee2f841c0e791518bf520ce902cc647ce23334:22)
E/AndroidRuntime(16148):        at r0.a.b(r8-map-id-9c2611e21b71f263ad2bc36d8bee2f841c0e791518bf520ce902cc647ce23334:92)
E/AndroidRuntime(16148):        ... 17 more

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions