You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently tried to add onesignal sdk to my expo project and had some issues while doing it.
I've spent hours on it and finally found the reason so here are some information for you.
First I had this issue: Expected receiver of type com.amazon.device.iap.internal.d, but got kotlin.Unit
> 10-04 11:50:12.904 29357 4726 D OneSignal: [mqt_native_modules] Already instantiated: com.onesignal.location.internal.LocationManager@e2d9032
> 10-04 11:50:12.904 29357 4726 D OneSignal: [mqt_native_modules] initWithContext: using cached user df219000-d6bd-4c86-8b65-00cba2f5f312
> 10-04 11:50:12.905 29357 4726 D OneSignal: [mqt_native_modules] OperationRepo.enqueue(operation: {"name":"refresh-user","appId":"MY_APP_ID","onesignalId":"df219000-d6bd-4c86-8b65-00cba2f5f312"}, flush: false)
> 10-04 11:50:12.908 29357 4754 D OneSignal: [Thread-19] ConfigModelListener: fetching parameters for appId: MY_APP_ID
> 10-04 11:50:12.908 29357 4754 D OneSignal: [Thread-19] ParamsBackendService.fetchParams(appId: MY_APP_ID, subscriptionId: 43743f56-6aae-44bb-8c23-05b6f1e807c9)
> 10-04 11:50:12.909 29357 4755 D OneSignal: [OpRepo] RefreshUserOperationExecutor(operation: [{"name":"refresh-user","appId":"MY_APP_ID","onesignalId":"df219000-d6bd-4c86-8b65-00cba2f5f312","id":"945a9916-8bb9-4444-b1b6-7a82f364cf23"}])
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: Exception in native call
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: java.lang.IllegalArgumentException: Expected receiver of type com.amazon.device.iap.internal.d, but got kotlin.Unit
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at java.lang.reflect.Field.get(Native Method)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.onesignal.core.internal.purchases.impl.TrackAmazonPurchase.start(TrackAmazonPurchase.kt:83)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.onesignal.core.internal.startup.StartupService.start(StartupService.kt:16)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.onesignal.internal.OneSignalImp.initWithContext(OneSignalImp.kt:247)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.onesignal.OneSignal.initWithContext(OneSignal.kt:126)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.onesignal.rnonesignalandroid.RNOneSignal.initialize(RNOneSignal.java:234)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at java.lang.reflect.Method.invoke(Native Method)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.facebook.jni.NativeRunnable.run(Native Method)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at android.os.Handler.handleCallback(Handler.java:938)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at android.os.Handler.dispatchMessage(Handler.java:99)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at android.os.Looper.loop(Looper.java:233)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
> 10-04 11:50:12.910 29357 4726 E unknown:ReactNative: at java.lang.Thread.run(Thread.java:923)
> 10-04 11:50:12.912 29357 4726 E unknown:ReactNative: Exception in native call
> 10-04 11:50:12.912 29357 4726 E unknown:ReactNative: java.lang.RuntimeException: Could not invoke OneSignal.addPermissionObserver
> 10-04 11:50:12.912 29357 4726 E unknown:ReactNative: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
> 10-04 11:50:12.912 29357 4726 E unknown:ReactNative: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
> 10-04 11:50:12.912 29357 4726 E unknown:ReactNative: at com.facebook.jni.NativeRunnable.run(Native Method)
> 10-04 11:50:12.912 29357 4726 E unknown:ReactNative: at android.os.Handler.handleCallback(Handler.java:938)
> 10-04 11:50:12.912 29357 4726 E unknown:ReactNative: at android.os.Handler.dispatchMessage(Handler.java:99)
> 10-04 11:50:12.912 29357 4726 E unknown:ReactNative: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
After tons of hours debugging this I found this was related to react-native-purchases package.
I also found you've got the same issue with flutter
While trying to fix it I installed expo-dev-client package and it went even worse with this issue:
> Your app just crashed. See the error below.
> java.lang.RuntimeException: Could not invoke OneSignal.hasNotificationPermission
> com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
> com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
> com.facebook.jni.NativeRunnable.run(Native Method)
> android.os.Handler.handleCallback(Handler.java:938)
> android.os.Handler.dispatchMessage(Handler.java:99)
> com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
> android.os.Looper.loop(Looper.java:233)
> com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
> java.lang.Thread.run(Thread.java:923)
> Caused by java.lang.reflect.InvocationTargetException
> java.lang.reflect.Method.invoke(Native Method)
> com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
> com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
> com.facebook.jni.NativeRunnable.run(Native Method)
> android.os.Handler.handleCallback(Handler.java:938)
> android.os.Handler.dispatchMessage(Handler.java:99)
> com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
> android.os.Looper.loop(Looper.java:233)
> com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
> java.lang.Thread.run(Thread.java:923)
> Caused by java.lang.Exception: Must call 'initWithContext' before use
> com.onesignal.internal.OneSignalImp.getNotifications(OneSignalImp.kt:81)
> com.onesignal.OneSignal.getNotifications(OneSignal.kt:62)
> com.onesignal.rnonesignalandroid.RNOneSignal.hasNotificationPermission(RNOneSignal.java:437)
> java.lang.reflect.Method.invoke(Native Method)
> com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
> com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
> com.facebook.jni.NativeRunnable.run(Native Method)
> android.os.Handler.handleCallback(Handler.java:938)
> android.os.Handler.dispatchMessage(Handler.java:99)
> com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
> android.os.Looper.loop(Looper.java:233)
> com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
> java.lang.Thread.run(Thread.java:923)
So I guess there is an issue with RevenueCat package. I think once it is fixed the second one with expo-dev-client will be too.
Let me know if you need more information.
Steps to reproduce?
1. Follow this tutorial to create an expo project : https://docs.expo.dev/tutorial/create-your-first-app/2. Install this package : https://www.npmjs.com/package/react-native-purchases3. Install this one : https://www.npmjs.com/package/expo-dev-client4. Follow those steps : https://documentation.onesignal.com/docs/react-native-expo-sdk-setup5. Prebuild
6. Run on Android
public boolean e() {
this.h();
return com.amazon.a.a.a((Application)this.e.getApplicationContext());
}
In 3.0.1, 3.0.2, 3.0.3
public static d e() {
return c;
}
react-native-purchases depends on version 3.0.3 of the Amazon Appstore SDK, and it looks like OneSignal-Android compiles against the latest available (3.0.4), so maybe that's where the issue is? That the function is not the same as the one in runtime?
Thanks for reporting, we had a bug and just released a new version of react-native-onesignal with the fix for the crash Expected receiver of type com.amazon.device.iap.internal.d, but got kotlin.Unit.
What happened?
Hi there,
I recently tried to add onesignal sdk to my expo project and had some issues while doing it.
I've spent hours on it and finally found the reason so here are some information for you.
First I had this issue:
Expected receiver of type com.amazon.device.iap.internal.d, but got kotlin.Unit
After tons of hours debugging this I found this was related to react-native-purchases package.
I also found you've got the same issue with flutter
While trying to fix it I installed expo-dev-client package and it went even worse with this issue:
So I guess there is an issue with RevenueCat package. I think once it is fixed the second one with expo-dev-client will be too.
Let me know if you need more information.
Steps to reproduce?
What did you expect to happen?
No issues while launching the app.
OneSignal Expo SDK version
react-native-onesignal: 5.0.1
onesignal-expo-plugin: 2.0.1
Platform
Android
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: