-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Getting crash when running release build #713
Comments
me too |
1 similar comment
me too |
I am seeing this as well. In version 5 after all proper migration and app working in debug, in release build the OneSignal.initialize(appId) is not working. |
Same for me as well, all the classes from the OneSignal are getting removed in the production build. |
Same problem here, only after building the apk. |
Solution: Adding ProGuard Rules for OneSignal in Release Build To ensure that ProGuard doesn't obfuscate the necessary classes from the OneSignal library in your Android project's release build, follow these steps:
By adding the above ProGuard rule and configuring the |
any solution ??? |
@PhamChiNang151020 Do not initialize directly in the main function. https://documentation.onesignal.com/docs/flutter-sdk-setup#step-5-set-up-onesignal-for-android |
Sorry, But I initialize by And, If I'm doing something wrong, please help. Thank you! |
@PhamChiNang151020 You can follow the official doc or Could you move the initialization to the app level? Anyway there is a PR for this, you can check that as well |
Thanks it resolve my problem |
The latest release 5.0.1 adds the proguard rules to Android release builds that should resolve this issue. If that is not the case please tag me here! |
@emawby I keep getting errors related to the flutter plugin android code on Crashlytics. Maybe those should also not be minified? (Those crashes happened on version 5.0.4) Checking on mapping.txt after a release build, it seems that the plugin code are getting minified |
Same for me as well, for some devices it is crashing |
Got the same on Huawei device. On other devices with google - is ok. |
@edisonlsm @sur2548 @rickgrotavi can you share the version of OneSignal you are using and the proguard / minification rules you are using in your app? |
onesignal_flutter: 5.1.4
app/build.gradle upd: if i set |
include in
|
What happened?
Implemented OneSignal version 5.0.0 in Flutter app, but when tried to run the app in release mode I got a FATAL EXCEPTION saying Unable to start receiver com.onesignal.notifications.receivers.UpgradeReceiver: java.lang.Exception: Service class e7.b could not be instantiated.
Steps to reproduce?
What did you expect to happen?
I expected to receive call back of OneSignal.User.pushSubscription.addObserver to get user id.
OneSignal Flutter SDK version
5.0.0
Which platform(s) are affected?
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: