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

Crashes on Android using the plugin #19

Closed
dericksa opened this issue Apr 9, 2021 · 7 comments
Closed

Crashes on Android using the plugin #19

dericksa opened this issue Apr 9, 2021 · 7 comments

Comments

@dericksa
Copy link

dericksa commented Apr 9, 2021

Hello,

We've been receiving some reports from firebase crashlytics of crashes involving this plugin:

Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {br.com.madeiramadeira/br.com.madeiramadeira.MainActivity}: java.lang.IllegalArgumentException: Receiver not registered: org.infobip.reactlibrary.mobilemessaging.ReactNativeMobileMessagingModule$6@27f7efc
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4497)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4515)
       at android.app.ActivityThread.-wrap5()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1690)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6626)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)

Is it something related to android's sdk?

We are currently using the 2.6.0 version of the plugin and react-native 62.2

@dericksa
Copy link
Author

dericksa commented Apr 9, 2021

We are also facing this:

Caused by java.lang.NullPointerException
       at java.util.Hashtable.put(Hashtable.java:461)
       at org.infobip.mobile.messaging.mobileapi.MobileApiResourceProvider.getGenerator(MobileApiResourceProvider.java:201)
       at org.infobip.mobile.messaging.mobileapi.MobileApiResourceProvider.getGenerator(MobileApiResourceProvider.java:191)
       at org.infobip.mobile.messaging.mobileapi.MobileApiResourceProvider.getMobileApiAppInstance(MobileApiResourceProvider.java:132)
       at org.infobip.mobile.messaging.MobileMessagingCore.installationSynchronizer(MobileMessagingCore.java:1899)
       at org.infobip.mobile.messaging.MobileMessagingCore.setCloudTokenUnreported(MobileMessagingCore.java:973)
       at org.infobip.mobile.messaging.MobileMessagingCore.setCloudToken(MobileMessagingCore.java:677)
       at org.infobip.mobile.messaging.cloud.RegistrationTokenHandler.sendRegistrationToServer(RegistrationTokenHandler.java:35)
       at org.infobip.mobile.messaging.cloud.firebase.FirebaseRegistrationTokenHandler.handleNewToken(FirebaseRegistrationTokenHandler.java:37)
       at org.infobip.mobile.messaging.cloud.MobileMessagingCloudHandler.handleNewToken(MobileMessagingCloudHandler.java:69)
       at org.infobip.mobile.messaging.cloud.MobileMessagingCloudHandler.handleWork(MobileMessagingCloudHandler.java:49)
       at org.infobip.mobile.messaging.cloud.MobileMessagingCloudService.onHandleWork(MobileMessagingCloudService.java:119)
       at org.infobip.mobile.messaging.platform.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:413)
       at org.infobip.mobile.messaging.platform.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:404)
       at android.os.AsyncTask$3.call(AsyncTask.java:378)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:919)

@tjuric
Copy link
Member

tjuric commented Apr 9, 2021

Hi @dericksa,

The first issue java.lang.IllegalArgumentException: Receiver not registered: is affecting only our RN plugin (Android platform). We'll provide a fix for it in the upcoming week. Thanks for reporting it.

The second issue is related to the native Android SDK and we did have it reported long time ago (but with different stacktrace), did changes that silenced this particular issue, and we were unable to reproduce it later on. Your example log is related to our library trying to fetch application code to authorize backend call after we got a new token from Firebase as far as I see from your logs.
Could you please provide us more details about it:

  1. how do you provide app code to our SDK?
  2. which devices experience this bug?
  3. what OS versions?
  4. were you able to reproduce it yourself?
  5. how often does this bug happen in your app (some percentage of devices)?

BR,
Tereza

@dericksa
Copy link
Author

dericksa commented Apr 9, 2021

@tjuric Hello, thanks for replying:

We get the appCode from AppConfig, which gets from an env file.

const appCode: string = AppConfig.mobileMessageAppCode;

    export const init = () => {
        mobileMessaging.init(
            {
                applicationCode: appCode,
                ios: {
                    notificationTypes: ['alert', 'badge', 'sound']
                }
            },
            () => {
                logDebug('MobileMessaging started');
            },
            error => {
                logDebug('MobileMessaging error: ', error);
            }
        );
    };
  1. and 3. There are different devices with different OS versions experiencing it:
    Redmi Note 9 Pro, GalaxyA71, GalaxyS10e - Android 10
    Galaxy S10 - Android 11
    Galaxy J7 - Android 6.0.1

  2. We were not able to reproduce it

  3. Since we launched, it happens 1-5 times a day

@tjuric
Copy link
Member

tjuric commented Apr 9, 2021

Thank you for details @dericksa,
We'll try to check the other reported bug as well, but I'm not yet sure when. We'll provide you updates on this thread.

BR,
Tereza

@riskpp
Copy link
Contributor

riskpp commented Apr 14, 2021

Hi @dericksa we released 3.0.3 version with fix for java.lang.IllegalArgumentException: Receiver not registered

BR,
Olga

@tjuric
Copy link
Member

tjuric commented May 6, 2021

Hi @dericksa,
We've released MM RN plugin version 3.1.1 with a few bug fixes on Android. We've fixed cases that we've noticed in our code related to your reported issue.

Please, try it out and update us on the new status.

BR,
Tereza

@tjuric
Copy link
Member

tjuric commented May 14, 2021

I'll close this one cause we've released a fix for this particular case. If you encounter it again, feel free to reopen this one.

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

3 participants