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
NPE on flushBufferToDisk #513
Comments
@rostopira Thanks for the details. Could you share which OneSignal SDK methods you are calling? Are your calls to OneSignal on the main thread? Or are some on a background thread? We haven't seen other reports of this crash so it might be an race condition with this. |
Here is code, that is used in my app At the Application onCreate:
NotificationExtenderService:
Other internal usage (used on background thread and main thread as well):
Another one (on both threads as well):
|
Is there any progress on this? |
• Fixes #513, where in very rare cases a concurrency issue could occur where shared preferences was accessed during a buffer flush before the object was actually initialized • Fixed by adding synchronization to all accesses/initialization of this object
• Fixes #513, where in very rare cases a concurrency issue could occur where shared preferences was accessed during a buffer flush before the object was actually initialized • Fixed by adding synchronization to all accesses/initialization of this object
• Fixes #513, where in very rare cases a concurrency issue could occur where shared preferences was accessed during a buffer flush before the object was actually initialized • Fixed by adding synchronization to all accesses/initialization of this object
The issue was fixed in the PR above and is now released in version 3.9.1 |
i have tested version 3.9.1 and 3.9.3 both causes the same issue.
|
This is still not resolved. Running into this with 3.9.1 as well. |
More than 3k of my users are currently affected by this issue (stats for 48 hours) on 3.9.1 as well |
@rostopira apologies about the crashes your users are experiencing. We’ve identified the cause of the problem and will be releasing an update to fix it shortly. It’s very similar to the issue we fixed in 3.9.1. We’ll be checking the SDK thoroughly to make sure there aren’t further NPE’s like this. |
@Nightsd01 any progress on this? This already caused delay in our release cycle |
@rostopira Sorry for the delay on this, we believe we have identified the root issue now. We should have a fix next week. We will update this ticket with our progress |
@jkasten2 more than week passed already. I'm starting to loose hope. If you don't have any ETA, than I'll rollback to the old version |
@rostopira Sorry for the delay. We just released 3.9.2 which includes a fix for this issue. |
I can confirm this issues is fixed |
* Unity Proxy setLocationShared • Adds setLocationShared(bool) to the Unity proxy * Fixed runtime issue when firebase-auth is added * Specific when com.google.firebase:firebase-auth:15.1.0 is used the following error would throw - java.lang.IllegalArgumentException: Given String is empty or null - at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source) - at com.google.firebase.auth.api.internal.zzcq.<init>(Unknown Source) - ... - at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) - at com.onesignal.PushRegistratorFCM.initFirebaseApp(PushRegistratorFCM.java:64) * Synchronize State • Fixes a crash where the generateJsonDiff() method of the currentUserState property in UserStateSynchronizer is called before the currentUserState is initialized, by adding a synchronization step to the initUserState() method • Adds a check to make sure the user state is initialized before internalSyncUserState() attempts to access it. * Synchronize LocationGMS • The GoogleAPIClient instance in LocationGMS (accessed through a proxy via reflection) was being accessed before it was being connected due to a race condition • Introduces synchronization to ensure access to the instance only occurs after it is initialized & connected. * Synchronize LocationUpdateListener • Adds synchronization to LocationUpdateListener, a class that also access the same instance of GoogleApiClient (from the previous commit) * Fixed proguard compatibility * Proguard is now renaming public classes so checked to static class based checks. - This way when Proguard renames the public class name it will be updated in OSUtils. - This is better then adding a proguard rule to keep class as allows renaming which means a smaller APK. * Removed reading from META-INF files * This was not reliable after some additional testing on a device * Fix Notification Restoration Crash for Android 7.0 • Fixes a crash (OneSignal#263) by disabling notification restoration after app upgrades for Android 7.0 devices. * Update Comment • Fixes an out of date comment, this change only checks against a specific version of android (not a range) * Fix Null Pointer Concurrency Issue • Fixes OneSignal#513, where in very rare cases a concurrency issue could occur where shared preferences was accessed during a buffer flush before the object was actually initialized • Fixed by adding synchronization to all accesses/initialization of this object * 3.9.1 Release commit * Update location tracking (#1) * Update location tracking * Fix NRE * Add lat/long tags
* Unity Proxy setLocationShared • Adds setLocationShared(bool) to the Unity proxy * Fixed runtime issue when firebase-auth is added * Specific when com.google.firebase:firebase-auth:15.1.0 is used the following error would throw - java.lang.IllegalArgumentException: Given String is empty or null - at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source) - at com.google.firebase.auth.api.internal.zzcq.<init>(Unknown Source) - ... - at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) - at com.onesignal.PushRegistratorFCM.initFirebaseApp(PushRegistratorFCM.java:64) * Synchronize State • Fixes a crash where the generateJsonDiff() method of the currentUserState property in UserStateSynchronizer is called before the currentUserState is initialized, by adding a synchronization step to the initUserState() method • Adds a check to make sure the user state is initialized before internalSyncUserState() attempts to access it. * Synchronize LocationGMS • The GoogleAPIClient instance in LocationGMS (accessed through a proxy via reflection) was being accessed before it was being connected due to a race condition • Introduces synchronization to ensure access to the instance only occurs after it is initialized & connected. * Synchronize LocationUpdateListener • Adds synchronization to LocationUpdateListener, a class that also access the same instance of GoogleApiClient (from the previous commit) * Fixed proguard compatibility * Proguard is now renaming public classes so checked to static class based checks. - This way when Proguard renames the public class name it will be updated in OSUtils. - This is better then adding a proguard rule to keep class as allows renaming which means a smaller APK. * Removed reading from META-INF files * This was not reliable after some additional testing on a device * Fix Notification Restoration Crash for Android 7.0 • Fixes a crash (OneSignal#263) by disabling notification restoration after app upgrades for Android 7.0 devices. * Update Comment • Fixes an out of date comment, this change only checks against a specific version of android (not a range) * Fix Null Pointer Concurrency Issue • Fixes OneSignal#513, where in very rare cases a concurrency issue could occur where shared preferences was accessed during a buffer flush before the object was actually initialized • Fixed by adding synchronization to all accesses/initialization of this object * 3.9.1 Release commit * Added GcmBroadcastReceiver to Eclipse example * This is required to receive pushes and was remove by mistake in a previous commit * Added google() to allprojects to root build.gradle Fixes issue with jcenter not always resolving google dependencies * Fix idsAvailable not firing a 2nd time * Fixed issue where idsAvailable would not fire a 2nd time if registrationId the first time * Revert "Fix Null Pointer Concurrency Issue" This reverts commit 69f99c9. * Added setAppContext which triggers dependents * Added null check to flushBufferToDisk * 3.9.2 Release commit * 3.9.2 Release jar * Fixes crash with FirebaseInstanceId * This crash happens due Google not handling the case where there isn't a default FireBase app. * Resolves OneSignal#552 * Handling IllegalStateException on Oreo * Normally startWakefulService can be used when notification is sent with high FCM priority however this may still not be allowed in some cases. * Resolves OneSignal#498 * Added Gradle plugin and updated to match Android SDK setup * updated gradle files * App gradle update
* Unity Proxy setLocationShared • Adds setLocationShared(bool) to the Unity proxy * Fixed runtime issue when firebase-auth is added * Specific when com.google.firebase:firebase-auth:15.1.0 is used the following error would throw - java.lang.IllegalArgumentException: Given String is empty or null - at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source) - at com.google.firebase.auth.api.internal.zzcq.<init>(Unknown Source) - ... - at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) - at com.onesignal.PushRegistratorFCM.initFirebaseApp(PushRegistratorFCM.java:64) * Synchronize State • Fixes a crash where the generateJsonDiff() method of the currentUserState property in UserStateSynchronizer is called before the currentUserState is initialized, by adding a synchronization step to the initUserState() method • Adds a check to make sure the user state is initialized before internalSyncUserState() attempts to access it. * Synchronize LocationGMS • The GoogleAPIClient instance in LocationGMS (accessed through a proxy via reflection) was being accessed before it was being connected due to a race condition • Introduces synchronization to ensure access to the instance only occurs after it is initialized & connected. * Synchronize LocationUpdateListener • Adds synchronization to LocationUpdateListener, a class that also access the same instance of GoogleApiClient (from the previous commit) * Fixed proguard compatibility * Proguard is now renaming public classes so checked to static class based checks. - This way when Proguard renames the public class name it will be updated in OSUtils. - This is better then adding a proguard rule to keep class as allows renaming which means a smaller APK. * Removed reading from META-INF files * This was not reliable after some additional testing on a device * Fix Notification Restoration Crash for Android 7.0 • Fixes a crash (OneSignal#263) by disabling notification restoration after app upgrades for Android 7.0 devices. * Update Comment • Fixes an out of date comment, this change only checks against a specific version of android (not a range) * Fix Null Pointer Concurrency Issue • Fixes OneSignal#513, where in very rare cases a concurrency issue could occur where shared preferences was accessed during a buffer flush before the object was actually initialized • Fixed by adding synchronization to all accesses/initialization of this object * 3.9.1 Release commit * Update location tracking (#1) * Update location tracking * Fix NRE * Add lat/long tags
* Unity Proxy setLocationShared • Adds setLocationShared(bool) to the Unity proxy * Fixed runtime issue when firebase-auth is added * Specific when com.google.firebase:firebase-auth:15.1.0 is used the following error would throw - java.lang.IllegalArgumentException: Given String is empty or null - at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source) - at com.google.firebase.auth.api.internal.zzcq.<init>(Unknown Source) - ... - at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) - at com.onesignal.PushRegistratorFCM.initFirebaseApp(PushRegistratorFCM.java:64) * Synchronize State • Fixes a crash where the generateJsonDiff() method of the currentUserState property in UserStateSynchronizer is called before the currentUserState is initialized, by adding a synchronization step to the initUserState() method • Adds a check to make sure the user state is initialized before internalSyncUserState() attempts to access it. * Synchronize LocationGMS • The GoogleAPIClient instance in LocationGMS (accessed through a proxy via reflection) was being accessed before it was being connected due to a race condition • Introduces synchronization to ensure access to the instance only occurs after it is initialized & connected. * Synchronize LocationUpdateListener • Adds synchronization to LocationUpdateListener, a class that also access the same instance of GoogleApiClient (from the previous commit) * Fixed proguard compatibility * Proguard is now renaming public classes so checked to static class based checks. - This way when Proguard renames the public class name it will be updated in OSUtils. - This is better then adding a proguard rule to keep class as allows renaming which means a smaller APK. * Removed reading from META-INF files * This was not reliable after some additional testing on a device * Fix Notification Restoration Crash for Android 7.0 • Fixes a crash (OneSignal#263) by disabling notification restoration after app upgrades for Android 7.0 devices. * Update Comment • Fixes an out of date comment, this change only checks against a specific version of android (not a range) * Fix Null Pointer Concurrency Issue • Fixes OneSignal#513, where in very rare cases a concurrency issue could occur where shared preferences was accessed during a buffer flush before the object was actually initialized • Fixed by adding synchronization to all accesses/initialization of this object * 3.9.1 Release commit * Added GcmBroadcastReceiver to Eclipse example * This is required to receive pushes and was remove by mistake in a previous commit * Added google() to allprojects to root build.gradle Fixes issue with jcenter not always resolving google dependencies * Fix idsAvailable not firing a 2nd time * Fixed issue where idsAvailable would not fire a 2nd time if registrationId the first time * Revert "Fix Null Pointer Concurrency Issue" This reverts commit 69f99c9. * Added setAppContext which triggers dependents * Added null check to flushBufferToDisk * 3.9.2 Release commit * 3.9.2 Release jar * Fixes crash with FirebaseInstanceId * This crash happens due Google not handling the case where there isn't a default FireBase app. * Resolves OneSignal#552 * Handling IllegalStateException on Oreo * Normally startWakefulService can be used when notification is sent with high FCM priority however this may still not be allowed in some cases. * Resolves OneSignal#498 * Added Gradle plugin and updated to match Android SDK setup * updated gradle files * App gradle update
Description:
20% of devices on new release experience critical issue
Reports error log:
Environment
Steps to Reproduce Issue:
Unknown
The text was updated successfully, but these errors were encountered: