OneSignal-Android-SDK icon indicating copy to clipboard operation
OneSignal-Android-SDK copied to clipboard

[Bug]: problem appears on last version oneSignal Android com.onesignal:OneSignal:5.1.31

Open tosuccesspractice opened this issue 8 months ago • 2 comments

What happened?

On the last version com.onesignal:OneSignal:5.1.31 Crash appears on crashlytics : Fatal Exception: java.lang.OutOfMemoryError pthread_create (1040KB stack) failed: Try again java.lang.Thread.nativeCreate (Thread.java)

com.onesignal.user.internal.PushSubscription.optIn (PushSubscription.kt:27)

When trying to do OneSignal.getUser().getPushSubscription().optIn(); on function onPushSubscriptionChange

Complete code :

@Override
public void onPushSubscriptionChange(@NonNull PushSubscriptionChangedState pushSubscriptionChangedState) {
        IPushSubscription pushSubscription = OneSignal.getUser().getPushSubscription();
        if(pushSubscription.getId() != null && pushSubscription.getId() != ""){
            if(!playerIdSended && userId != null && userId != ""){
                LoginActivity.updateOneSignalIds(userId, accessToken, pushSubscription.getId(), 10);
            }
        }
        else{
            OneSignal.getUser().getPushSubscription().optIn();
        }
}

Steps to reproduce?

import com.onesignal:OneSignal:5.1.31
public class MyApplication extends Application implements IPushSubscriptionObserver {
    @Override
    public void onCreate() {
        super.onCreate();
..
       OneSignal.initWithContext(this);
        String ONESIGNAL_APP_ID = "xxxxxx";
        OneSignal.initWithContext(this, ONESIGNAL_APP_ID);
...
}

What did you expect to happen?

I expect no crash caused by oneSignal

OneSignal Android SDK version

5.1.31

Android version

14

Specific Android models


Relevant log output


Code of Conduct

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

tosuccesspractice avatar May 07 '25 11:05 tosuccesspractice

@tosuccesspractice thanks for reporting, can you share the full stack trace of the java.lang.OutOfMemoryError?

Can you reproduce the issue on your test devices? Or is this only shown on Crashlytics?

Lastly, can you share more details about devices from Crashlytics? Can you include number of occurrences, Android versions (only Android 14?), and device models if possible?

jkasten2 avatar May 07 '25 19:05 jkasten2

is this only shown on Crashlytics It's not only on Android 14, or specific model

Image Image

tosuccesspractice avatar May 12 '25 13:05 tosuccesspractice