Skip to content
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

Suddenly lots of crashes on android related to onesignal #1501

Closed
2 of 3 tasks
pierroo opened this issue Mar 24, 2023 · 12 comments
Closed
2 of 3 tasks

Suddenly lots of crashes on android related to onesignal #1501

pierroo opened this issue Mar 24, 2023 · 12 comments

Comments

@pierroo
Copy link

pierroo commented Mar 24, 2023

What happened?

On android, the google play console suddenly brings a lots of crashes since my latest version where I updated onesignal to 4.5.0.
Here is the stack (same for all crashes)

backtrace:
  #00  pc 0x00000000001cd12c  /data/app/com.myapp.app-xIXiJbtoH4NJUFKsVZ_uYA==/oat/arm64/base.odex (lj.c.a+236)
  #01  pc 0x00000000001b7fe4  /data/app/com.myapp.app-xIXiJbtoH4NJUFKsVZ_uYA==/oat/arm64/base.odex (com.onesignal.i.d+100)
  #02  pc 0x00000000001b5b80  /data/app/com.myapp.app-xIXiJbtoH4NJUFKsVZ_uYA==/oat/arm64/base.odex (com.onesignal.f0.o+1296)
  #03  pc 0x00000000001b5158  /data/app/com.myapp.app-xIXiJbtoH4NJUFKsVZ_uYA==/oat/arm64/base.odex (com.onesignal.f0.l+1064)
  #04  pc 0x00000000001c311c  /data/app/com.myapp.app-xIXiJbtoH4NJUFKsVZ_uYA==/oat/arm64/base.odex (com.onesignal.s1.f+252)
  #05  pc 0x00000000001b06ec  /data/app/com.myapp.app-xIXiJbtoH4NJUFKsVZ_uYA==/oat/arm64/base.odex (com.onesignal.a2.b+332)
  #06  pc 0x00000000001f859c  /data/app/com.myapp.app-xIXiJbtoH4NJUFKsVZ_uYA==/oat/arm64/base.odex (com.onesignal.OSNotificationWorkManager$NotificationWorker.a+908)
  #07  pc 0x00000000001f8914  /data/app/com.myapp.app-xIXiJbtoH4NJUFKsVZ_uYA==/oat/arm64/base.odex (com.onesignal.OSNotificationWorkManager$NotificationWorker.doWork+676)
  #08  pc 0x0000000000137734  /data/app/com.myapp.app-xIXiJbtoH4NJUFKsVZ_uYA==/oat/arm64/base.odex (androidx.work.Worker$a.run+68)
  #09  pc 0x000000000037b4ec  /apex/com.android.art/javalib/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+988)
  #10  pc 0x0000000000374d14  /apex/com.android.art/javalib/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+68)
  #11  pc 0x00000000001bf19c  /apex/com.android.art/javalib/arm64/boot.oat (java.lang.Thread.run+76)
  #12  pc 0x00000000002ca764  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548)
  #13  pc 0x000000000030e980  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+156)
  #14  pc 0x00000000003c1db4  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+380)
  #15  pc 0x00000000004578ec  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+992)
  #16  pc 0x00000000000deb44  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264)
  #17  pc 0x000000000007b2fc  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68)

Steps to reproduce?

I am unable to reproduce it myself, but I got hundreds of crash reports in just 2 days.

What did you expect to happen?

No crash

React Native OneSignal SDK version

4.5.0

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
@nan-li
Copy link
Contributor

nan-li commented Mar 25, 2023

Hi @pierroo,

Thank you for reporting this and I apologize for the sudden crashes you are seeing. Can you confirm you are on react-native-onesignal 4.5.0 and not 4.5.1?

In the latest release 4.5.1, we included a speculative fix for an Android WorkManager crash people have been reporting in production. It looks like it is having very unexpected effects, I'm quite perplexed, but in the meantime, please downgrade to the previous version of this library.

Can you answer some questions to help me understand what is happening?

  1. Did you ever experience a WorkManager is not initialized properly crash (this was the issue were were trying to fix)?
  2. Do you have a custom WorkManager or using any library for Android Work, that you know of?
  3. Do you have some of the devices and their versions that are reported?
  4. I see this has happened hundreds of times. Do you think it is a 100% of the time crash or doesn't always crash? Any concrete numerical data is appreciated.
  5. Is there any more information about this crash? The stack trace doesn't provide much information, unfortunately.
  6. You mention you cannot reproduce, was this in debug? Did you try using a production build to reproduce?

@pierroo
Copy link
Author

pierroo commented Mar 25, 2023

I can confirm I am on v4.5.0;
I actually updated to 4.5.1 yesterday and was planning on pushing this update this weekend.

So you are telling me I should not and should actually stick with the 4.5.0 instead for now?

1- I am really unsure, I don't think so, the crash I experience are really all having the same play console I reported above
2- I honestly have no idea
3- It's hiting every kind of device and android versions:
Redmi fog (Redmi 10) - android 11
OPPO OP4F83L1 (CPH2251) - android 13
etc tc
image
4- oh no it's not a 100% crash, many users are not facing the issue
5- unfortunately not, that's my issue, google play console really sucks for those crash info
6- it's in production. I cannot reproduce because it doesn't happen on my devices, and not on my beta testers either, but it obviously happens to hundreds of users (I have around 50K DAU)

Not sure if that helps, but please let me know if I should revert to v4.5.0 for now

@nan-li
Copy link
Contributor

nan-li commented Mar 25, 2023

Hi @pierroo,

Thank you for the information.

I am even more perplexed you are not on 4.5.1... which version of react-native-onesignal were you on previously before 4.5.0?

Because in release 4.5.0, we only updated the native iOS SDK, and there were no Android changes.

I see com.onesignal.OSNotificationWorkManager$NotificationWorker and androidx.work.Worker in the stack trace. We made changes that affect these classes in release 4.5.1.


Not sure if that helps, but please let me know if I should revert to v4.5.0 for now

^ I am not sure of the answer to this because I think you are already on v4.5.1 based on the stacktrace and that we made no Android changes in v4.5.0. Is it possible you are actually using a different version of the native OneSignal Android SDK than the one specific in this library?

react-native-onesignal 4.5.0 uses OneSignal-Android-SDK 4.8.2

react-native-onesignal 4.5.1 uses OneSignal-Android-SDK 4.8.5

OneSignal-Android-SDK 4.8.5 is where we made changes that affect com.onesignal.OSNotificationWorkManager.

@pierroo
Copy link
Author

pierroo commented Mar 25, 2023

That is confusing then, because I can guarantee all those crashes are from v4.5.0
I only updated 4.5.1 two days ago and it's just on my computer in debug, not in production where the crashes happen.

So the onesignal Android sdk where do I find it ?
In node modules / onesignal or in my own build.gradle ?

I really don't want to push in production 4.5.1 if it crashes even more; anything else I could provide to help with it ?

@nan-li
Copy link
Contributor

nan-li commented Mar 25, 2023

Did you update to 4.5.0 from 4.4.1? Or an earlier version?

We didn't make any Android changes at all in 4.5.0 so I am not sure how to advise.

You can check any of the build.gradle files for the any dependency mentioning OneSignal. It won't be in node_modules or in this library.

Another way to check is seeing if a bug we fixed is still in the app.

  1. We fixed Fix default values in liquid IAMs OneSignal-Android-SDK#1698 in a later release. To reproduce, create an in-app message with tag substitution and view it on a device that doesn't have the tag. Please see the images in the PR.
  2. Another bug we fixed is this issue. It can be reproduced if you send 5 notifications and call OneSignal.clearOneSignalNotifications. It will collapse into a single summary notification.

@pierroo
Copy link
Author

pierroo commented Mar 26, 2023

I checked in both build.gradle, there is no mention of " api 'com.onesignal:OneSignal:4.8.2' " (or any other version)
Yes I did update from an earlier version than 4.4.1

While I investigate further so I can provide more materials here, my initial question remains:
is v4.5.1 safe to update to?
Or should I stick with 4.5.0? since you mentioned 4.5.1: "It looks like it is having very unexpected effects,"

@nan-li
Copy link
Contributor

nan-li commented Mar 26, 2023

Hi @pierroo,

What version did you upgrade to 4.5.0 from? I can see what changes were made since the previous version you were on.

since you mentioned 4.5.1: "It looks like it is having very unexpected effects,"

This comment was when I thought you were using react-native-onesignal 4.5.1 and getting these crashes on that version. Let me follow up on Monday with any suggestions.

For now, please let me know the previous version you were using before 4.5.0.

@pierroo
Copy link
Author

pierroo commented Mar 27, 2023

I came from 4.3.8
Hopefully that helps knowing whether I should update to 4.5.1 or not (from 4.5.0)
Thank you!

@nan-li
Copy link
Contributor

nan-li commented Mar 27, 2023

Hi @pierroo,
There were several changes from 4.3.8 to 4.5.0 and I will see what could be affecting you, but I haven't seen your stack trace reported by others.

Now that I am looking at the stack trace again, it may not be the same issue I thought it was on 4.5.1. The difficulty is the stack trace is obfuscated and doesn't include what expectation was thrown.

You can update to 4.5.1 from 4.5.0 but it will probably not resolve these crashes because there were no fixes that could be applied to your case.

I have some more questions:

  1. Do all of the stack traces contain OSNotificationWorkManager.NotificationWorker or are there some that come from other places?
... (com.onesignal.OSNotificationWorkManager$NotificationWorker.a+908)
... (com.onesignal.OSNotificationWorkManager$NotificationWorker.doWork+676)
  1. I see you mention Redmi, vivo, and OPPO as affected devices. These all use a variant of the Android operating system. Are there any devices like Samsung Galaxy or others that use the Android operating system directly?

  2. Did you make any other changes to the app besides updating the react-native-onesignal SDK from 4.3.8 to 4.5.0?

@pierroo
Copy link
Author

pierroo commented Mar 28, 2023

Hi @nan-li ,
My apologies, I did a bit more digging, and after further checking it seems it may have been a misunderstanding on my end.

I can barely retrieve those crash on my newest production release (the one with 4.5.0), whereas they mostly (95%) seem to be from the previous production release instead (thus the 4.3.8)
so if anything, it seems that those were actually fixed by 4.5.0
I will then update to 4.5.1 and see how it goes if no side effect are expected with it.

And if that still matters, you are right, all those crashes did not involve samsung devices, only variant of the android OS.
(yes, they ALL did contain the OSNotificationWorkManager.NotificationWorker)

Thank you for your time,

@nan-li
Copy link
Contributor

nan-li commented Mar 28, 2023

Hey @pierroo thanks for the update. Please keep us posted on your version update and if any other issues arise.

@emawby
Copy link
Contributor

emawby commented Apr 18, 2023

Closing for now feel free to reopen if there are issues

@emawby emawby closed this as completed Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants