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 release APK crashing #1691

Open
2 of 3 tasks
usamaabutt opened this issue Apr 13, 2024 · 1 comment
Open
2 of 3 tasks

[Bug]: Android release APK crashing #1691

usamaabutt opened this issue Apr 13, 2024 · 1 comment

Comments

@usamaabutt
Copy link

usamaabutt commented Apr 13, 2024

What happened?

I am using the latest version of "OneSignal SDK 11" and "RN lib version 5.1.1". My Android release APK is crashing and throwing this error catch through adb logcat '*:W'.

Error:

FATAL EXCEPTION: mqt_native_modules
04-13 16:07:31.557 23027 23152 E AndroidRuntime: Process: com.smile.members, PID: 23027
04-13 16:07:31.557 23027 23152 E AndroidRuntime: java.lang.RuntimeException: Could not invoke OneSignal.addTriggers

Steps to reproduce?

1. Install the `react-native-onesignal` library
2. Initialise the library through `OneSignal.initialize(Config.ONE_SIGNAL_APP_ID);`
3. Create an APK file and install it on a real phone
4. On app launch it's crashing

What did you expect to happen?

I expect the release APK of Android will not crash and will work without crashing.

React Native OneSignal SDK version

Release 5.1.1

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

TypeError: null is not an object (evaluating 'f.setupAndStartRecording')
04-13 16:35:06.375 24154 24283 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
04-13 16:35:06.375 24154 24283 E AndroidRuntime: Process: com.smile.members, PID: 24154
04-13 16:35:06.375 24154 24283 E AndroidRuntime: java.lang.RuntimeException: Could not invoke OneSignal.addTriggers
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:192)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:147)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:942)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:1012)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:148)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	... 9 more
04-13 16:35:06.375 24154 24283 E AndroidRuntime: Caused by: java.lang.Exception: Must call 'initWithContext' before use
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at com.onesignal.internal.OneSignalImp.getInAppMessages(Unknown Source:16)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at com.onesignal.OneSignal.getInAppMessages(Unknown Source:6)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	at com.onesignal.rnonesignalandroid.RNOneSignal.addTriggers(Unknown Source:0)
04-13 16:35:06.375 24154 24283 E AndroidRuntime: 	... 11 more

Code of Conduct

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

Hello @usamaabutt thank you for your patience! I see in the stack trace that the method addTriggers is mentioned. When/where are you calling this method in your code? Would you be able to provide the full logs reproducing this crash so we can take a closer look?

Appreciate it!

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

2 participants