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

[Bug]: Android Crash - org.json.JSONException #1550

Closed
2 of 3 tasks
mahdieh-dev opened this issue Sep 5, 2023 · 11 comments
Closed
2 of 3 tasks

[Bug]: Android Crash - org.json.JSONException #1550

mahdieh-dev opened this issue Sep 5, 2023 · 11 comments

Comments

@mahdieh-dev
Copy link

mahdieh-dev commented Sep 5, 2023

What happened?

Hello everyone,

We've encountered an Android issue while using the latest version of the OneSignal SDK. Our users are experiencing app crashes when attempting to open the Android app, accompanied by the following error log:

Fatal Exception: java.lang.RuntimeException
java.lang.reflect.InvocationTargetException

Detailed logs have been uploaded in the relevant sections.

We kindly request your assistance in identifying and resolving this issue. Your support is greatly appreciated.

Steps to reproduce?

1. Open the signed APK on an Android device (preferably Samsung, Xiaumi)
2. The app crashes on start

What did you expect to happen?

I expected the app to open normally

React Native OneSignal SDK version

5.0.0

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

Fatal Exception: java.lang.RuntimeException: Could not invoke OneSignal.initialize
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
       at android.os.Looper.loopOnce(Looper.java:210)
       at android.os.Looper.loop(Looper.java:299)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
       at java.lang.Thread.run(Thread.java:1012)

Caused by java.lang.reflect.InvocationTargetException:
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
       at android.os.Looper.loopOnce(Looper.java:210)
       at android.os.Looper.loop(Looper.java:299)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
       at java.lang.Thread.run(Thread.java:1012)

Caused by java.lang.reflect.InvocationTargetException:
       at java.lang.reflect.Constructor.newInstance0(Constructor.java)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
       at com.onesignal.common.services.ServiceRegistrationReflection.resolve(ServiceRegistration.kt:90)
       at com.onesignal.common.services.ServiceProvider.getServiceOrNull(ServiceProvider.kt:79)
       at com.onesignal.common.services.ServiceProvider.getService(ServiceProvider.kt:67)
       at com.onesignal.common.services.ServiceRegistrationReflection.resolve(ServiceRegistration.kt:83)
       at com.onesignal.common.services.ServiceProvider.getServiceOrNull(ServiceProvider.kt:79)
       at com.onesignal.common.services.ServiceProvider.getService(ServiceProvider.kt:67)
       at com.onesignal.common.services.ServiceRegistrationReflection.resolve(ServiceRegistration.kt:83)
       at com.onesignal.common.services.ServiceProvider.getServiceOrNull(ServiceProvider.kt:79)
       at com.onesignal.common.services.ServiceProvider.getService(ServiceProvider.kt:67)
       at com.onesignal.internal.OneSignalImp.initWithContext(OneSignalImp.kt:419)
       at com.onesignal.OneSignal.initWithContext(OneSignal.kt:126)
       at com.onesignal.rnonesignalandroid.RNOneSignal.initialize(RNOneSignal.java:231)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
       at android.os.Looper.loopOnce(Looper.java:210)
       at android.os.Looper.loop(Looper.java:299)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
       at java.lang.Thread.run(Thread.java:1012)

Caused by org.json.JSONException: Value  at lon of type java.lang.String cannot be converted to long
       at org.json.JSON.typeMismatch(JSON.java:101)
       at org.json.JSONObject.getLong(JSONObject.java:526)
       at com.onesignal.common.modeling.Model.initializeFromJson(Model.kt:103)
       at com.onesignal.user.internal.properties.PropertiesModel.createModelForProperty(PropertiesModel.kt:94)
       at com.onesignal.common.modeling.Model.initializeFromJson(Model.kt:86)
       at com.onesignal.common.modeling.SimpleModelStore.create(SimpleModelStore.kt:32)
       at com.onesignal.common.modeling.ModelStore.load(ModelStore.kt:129)
       at com.onesignal.common.modeling.SimpleModelStore.<init>(SimpleModelStore.kt:25)
       at com.onesignal.user.internal.properties.PropertiesModelStore.<init>(PropertiesModelStore.kt:8)
       at java.lang.reflect.Constructor.newInstance0(Constructor.java)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
       at com.onesignal.common.services.ServiceRegistrationReflection.resolve(ServiceRegistration.kt:90)
       at com.onesignal.common.services.ServiceProvider.getServiceOrNull(ServiceProvider.kt:79)
       at com.onesignal.common.services.ServiceProvider.getService(ServiceProvider.kt:67)
       at com.onesignal.common.services.ServiceRegistrationReflection.resolve(ServiceRegistration.kt:83)
       at com.onesignal.common.services.ServiceProvider.getServiceOrNull(ServiceProvider.kt:79)
       at com.onesignal.common.services.ServiceProvider.getService(ServiceProvider.kt:67)
       at com.onesignal.common.services.ServiceRegistrationReflection.resolve(ServiceRegistration.kt:83)
       at com.onesignal.common.services.ServiceProvider.getServiceOrNull(ServiceProvider.kt:79)
       at com.onesignal.common.services.ServiceProvider.getService(ServiceProvider.kt:67)
       at com.onesignal.internal.OneSignalImp.initWithContext(OneSignalImp.kt:419)
       at com.onesignal.OneSignal.initWithContext(OneSignal.kt:126)
       at com.onesignal.rnonesignalandroid.RNOneSignal.initialize(RNOneSignal.java:231)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
       at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
       at android.os.Looper.loopOnce(Looper.java:210)
       at android.os.Looper.loop(Looper.java:299)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
       at java.lang.Thread.run(Thread.java:1012)

pool-18-thread-1:
       at jdk.internal.misc.Unsafe.park(Unsafe.java)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
       at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1188)
       at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:905)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
       at java.lang.Thread.run(Thread.java:1012)

glide-active-resources:
       at java.lang.Object.wait(Object.java)
       at java.lang.Object.wait(Object.java:442)
       at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:203)
       at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:224)
       at com.bumptech.glide.load.engine.ActiveResources.cleanReferenceQueue(ActiveResources.java:128)
       at com.bumptech.glide.load.engine.ActiveResources$2.run(ActiveResources.java:61)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
       at com.bumptech.glide.load.engine.ActiveResources$1$1.run(ActiveResources.java:43)
       at java.lang.Thread.run(Thread.java:1012)

DefaultDispatcher-worker-2:
       at java.net.SocketInputStream.socketRead0(SocketInputStream.java)
       at java.net.SocketInputStream.socketRead(SocketInputStream.java:118)
       at java.net.SocketInputStream.read(SocketInputStream.java:173)
       at java.net.SocketInputStream.read(SocketInputStream.java:143)
       at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readFromSocket(ConscryptEngineSocket.java:945)
       at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:909)
       at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.-$$Nest$mprocessDataFromSocket()
       at com.android.org.conscrypt.ConscryptEngineSocket.doHandshake(ConscryptEngineSocket.java:241)
       at com.android.org.conscrypt.ConscryptEngineSocket.startHandshake(ConscryptEngineSocket.java:220)
       at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:196)
       at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:153)
       at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
       at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
       at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
       at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
       at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
       at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
       at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
       at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
       at com.stripe.android.core.networking.ConnectionFactory$Default.openConnectionAndApplyFields(ConnectionFactory.kt:68)
       at com.stripe.android.core.networking.ConnectionFactory$Default.create(ConnectionFactory.kt:37)
       at com.stripe.android.core.networking.DefaultStripeNetworkClient.makeRequest(DefaultStripeNetworkClient.kt:65)
       at com.stripe.android.core.networking.DefaultStripeNetworkClient.access$makeRequest(DefaultStripeNetworkClient.kt:14)
       at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeRequest$2.invoke(DefaultStripeNetworkClient.kt:24)
       at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeRequest$2.invoke(DefaultStripeNetworkClient.kt:23)
       at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeInternal$2.invokeSuspend(DefaultStripeNetworkClient.kt:43)
       at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeInternal$2.invoke(:8)
       at com.stripe.android.core.networking.DefaultStripeNetworkClient$executeInternal$2.invoke(:4)
       at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
       at kotlinx.coroutines.BuildersKt.withContext(:1)
       at com.stripe.android.core.networking.DefaultStripeNetworkClient.executeInternal$stripe_core_release(DefaultStripeNetworkClient.kt:42)
       at com.stripe.android.core.networking.DefaultStripeNetworkClient.executeRequest(DefaultStripeNetworkClient.kt:23)
       at com.stripe.android.DefaultFraudDetectionDataRepository$getLatest$2.invokeSuspend(FraudDetectionDataRepository.kt:76)
       at com.stripe.android.DefaultFraudDetectionDataRepository$getLatest$2.invoke(:8)
       at com.stripe.android.DefaultFraudDetectionDataRepository$getLatest$2.invoke(:4)
       at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
       at kotlinx.coroutines.BuildersKt.withContext(:1)
       at com.stripe.android.DefaultFraudDetectionDataRepository.getLatest(FraudDetectionDataRepository.kt:69)
       at com.stripe.android.DefaultFraudDetectionDataRepository$refresh$1.invokeSuspend(FraudDetectionDataRepository.kt:64)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Measurement Worker:
       at java.lang.Object.wait(Object.java)
       at java.lang.Object.wait(Object.java:442)
       at m.iy.run(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (190400-0):71)

DefaultDispatcher-worker-10:
       at jdk.internal.misc.Unsafe.park(Unsafe.java)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:357)
       at com.smartlook.a2$b.d(SourceFile:14)
       at com.smartlook.a2$b.h(SourceFile:23)
       at com.smartlook.a2$b.f(SourceFile:40)
       at com.smartlook.a2$b.run(SourceFile:1)

AsyncTask #1:
       at jdk.internal.misc.Unsafe.park(Unsafe.java)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
       at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:463)
       at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:361)
       at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:939)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1062)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
       at java.lang.Thread.run(Thread.java:1012)

SentryAsyncConnection-0:
       at libcore.io.Linux.poll(Linux.java)
       at libcore.io.ForwardingOs.poll(ForwardingOs.java:573)
       at libcore.io.BlockGuardOs.poll(BlockGuardOs.java:283)
       at libcore.io.ForwardingOs.poll(ForwardingOs.java:573)
       at libcore.io.IoBridge.isConnected(IoBridge.java:326)
       at libcore.io.IoBridge.connectErrno(IoBridge.java:237)
       at libcore.io.IoBridge.connect(IoBridge.java:179)
       at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:142)
       at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
       at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
       at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
       at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
       at java.net.Socket.connect(Socket.java:646)
       at com.android.okhttp.internal.Platform.connectSocket(Platform.java:182)
       at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:145)
       at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
       at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
       at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
       at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
       at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
       at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@skoob13
Copy link

skoob13 commented Sep 5, 2023

A similar crash happens on Android 10 on Redmi Note 9S (react-native-onesignal is 5.0.0):

java.lang.Exception: Service class vc.b could not be instantiated
    at lc.c.h(ServiceProvider.kt:59)
    at vd.a.k(OneSignalImp.kt:79)
    at fc.e.i(OneSignal.kt:17)
    at com.onesignal.rnonesignalandroid.RNOneSignal.initialize(RNOneSignal.java:30)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:149)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:148)
    at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1)
    at android.os.Looper.loop(Looper.java:224)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:38)
    at java.lang.Thread.run(Thread.java:919)
java.lang.reflect.InvocationTargetException: null
    at java.lang.reflect.Method.invoke(Method.java)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:149)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:148)
    at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1)
    at android.os.Looper.loop(Looper.java:224)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:38)
    at java.lang.Thread.run(Thread.java:919)
java.lang.RuntimeException: Could not invoke OneSignal.initialize
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:193)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:148)
    at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1)
    at android.os.Looper.loop(Looper.java:224)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:38)
    at java.lang.Thread.run(Thread.java:919)

@parthpv99
Copy link

Similar case with us. Release Build crashes on start on emulator as well as physical device.

log output:

FATAL EXCEPTION: mqt_native_modules
java.lang.RuntimeException: Could not invoke OneSignal.initialize
	at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:192)
	at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:147)
	at com.facebook.jni.NativeRunnable.run(Native Method)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37)
	at java.lang.Thread.run(Thread.java:920)
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
	at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:148)
	at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:147) 
	at com.facebook.jni.NativeRunnable.run(Native Method) 
	at android.os.Handler.handleCallback(Handler.java:938) 
	at android.os.Handler.dispatchMessage(Handler.java:99) 
	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0) 
	at android.os.Looper.loopOnce(Looper.java:201) 
	at android.os.Looper.loop(Looper.java:288) 
	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37) 
	at java.lang.Thread.run(Thread.java:920) 
Caused by: java.lang.Exception: Service class rg.b could not be instantiated
	at hg.c.b(Unknown Source:58)
	at rh.a.l(Unknown Source:78)
	at bg.d.i(Unknown Source:16)
	at com.onesignal.rnonesignalandroid.RNOneSignal.initialize(Unknown Source:29)
	at java.lang.reflect.Method.invoke(Native Method) 
	at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:148) 
	at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:147) 
	at com.facebook.jni.NativeRunnable.run(Native Method) 
	at android.os.Handler.handleCallback(Handler.java:938) 
	at android.os.Handler.dispatchMessage(Handler.java:99) 
	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0) 
	at android.os.Looper.loopOnce(Looper.java:201) 
	at android.os.Looper.loop(Looper.java:288) 
	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37) 
	at java.lang.Thread.run(Thread.java:920) 

@jennantilla
Copy link
Contributor

Thank you for reporting this and for the detailed logs. We're investigating and will get back to you as soon as possible!

@Shaheryarr
Copy link

Hi @jennantilla

I've been facing this issue as well, is there any update?

@Romick2005
Copy link

@mahdieh-dev Have you tried to add -keep class com.onesignal.** { *; } line to your project proguard file /android/app/proguard-rules.pro?

@mahdieh-dev
Copy link
Author

mahdieh-dev commented Sep 27, 2023

Hi @Romick2005, No we haven't but we are not using Progaurd for our builds

image

For now, we rolled back to the previous version of Onesignal to make the app work again for all users. we're using v4.5.1 now.

@dmorsoleto
Copy link

same problem here I tested with 5.0.0 and 5.0.1

@empiteranga
Copy link

@Romick2005 your solution works for me, thanks you save my day

@brismithers
Copy link
Contributor

To give an update an the underlying Android issue, a fix for this is now in review.

@mahdieh-dev
Copy link
Author

Hi @brismithers

Thanks for your update.
We're looking forward to the fix. If there's anything we can provide to help you with the reviewing process, please don't hesitate to reach out to me.

@jennantilla
Copy link
Contributor

Hello everyone! Please note that this should be resolved by upgrading to our latest SDK version. Please let us know if you have any additional questions or concerns. Thanks!

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

9 participants