[Bug]: problem appears on last version oneSignal Android com.onesignal:OneSignal:5.1.31
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 thanks for reporting, can you share the full stack trace of the java.lang.OutOfMemoryError?
- The single line you reported com.onesignal.user.internal.PushSubscription.optIn (PushSubscription.kt:27), doesn't allocate memory on that line.
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?
is this only shown on Crashlytics It's not only on Android 14, or specific model