Open
Description
What happened?
Description:
While using the OneSignal Flutter plugin, I encountered a java.lang.NoClassDefFoundError during runtime. This error wasn't observed during compile-time, and I believe it might be related to the plugin's implementation or a potential conflict with other plugins/dependencies.
Stack Trace:
Fatal Exception: java.lang.NoClassDefFoundError: pd.a
at com.onesignal.flutter.OneSignalNotifications.q(SourceFile)
at com.onesignal.flutter.OneSignalNotifications.onMethodCall(SourceFile)
at ng.k$a.a(SourceFile)
at bg.c.l(SourceFile)
at bg.c.m(SourceFile)
at bg.c.i(SourceFile)
at bg.b.run(SourceFile)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6946)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
flutter doctor
[!] Flutter (Channel stable, 3.13.6, on macOS 14.0 23A344 darwin-arm64, locale en-IN)
! Warning: `flutter` on your path resolves to /Users/taiyarikarlo/flutter/bin/flutter, which is not inside your current Flutter SDK checkout
at /users/taiyarikarlo/flutter. Consider adding /users/taiyarikarlo/flutter/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/taiyarikarlo/flutter/bin/dart, which is not inside your current Flutter SDK checkout at
/users/taiyarikarlo/flutter. Consider adding /users/taiyarikarlo/flutter/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.79.0)
[✓] Connected device (3 available)
[✓] Network resources
! Doctor found issues in 1 category.```
### Steps to reproduce?
```Markdown
1. onesignal_flutter: ^5.0.3 previously I'm using ^3.0.0
2. changes the code from this
`OneSignal.shared.setAppId("");
OneSignal.shared.promptUserForPushNotificationPermission().then((accepted) {
print("Accepted permission: $accepted");
});`
to this at main()
` OneSignal.initialize("");
OneSignal.Notifications.requestPermission(true);`
3. flutter clean and flutter pub get completed.
Notification receiving properly, and no errors detected at emulator, but after releasing on production mode at Play Store it's throwing the fatal error and app crashing.
What did you expect to happen?
The plugin should operate without causing any runtime exceptions, especially NoClassDefFoundError
OneSignal Flutter SDK version
Release ^5.0.2
Which platform(s) are affected?
- iOS
- Android
Relevant log output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels