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

Android Crash - "Callback arg cannot be called more than once"; #601

Open
mobinni opened this issue Jan 15, 2025 · 0 comments
Open

Android Crash - "Callback arg cannot be called more than once"; #601

mobinni opened this issue Jan 15, 2025 · 0 comments

Comments

@mobinni
Copy link

mobinni commented Jan 15, 2025

Report

Plugin Version

6.15.1

On what Platform are you having the issue?

Android only

What did you do?

We use logEvent

What did you expect to happen?

logEvent callbacks not to crash on Android

What happened instead?

On new arch in production for Android we receive crash logs where onError callback is called, but invoked twice which causes a crash to trigger;

react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp
      if (!callback) {
          LOG(FATAL) << "Callback arg cannot be called more than once";
          return;
        }
  #10  pc 0x000000000060cb00  /data/app/~~fd4r20TdR3MOOG2sjAaVtg==/com.wealthsimple.trade-dfI26diei0-qwrUPNR0eeg==/base.apk (com.facebook.react.bridge.CxxCallbackImpl.invoke+8)
  #11  pc 0x0000000000780ee4  /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
  #12  pc 0x0000000000879a18  /data/app/~~fd4r20TdR3MOOG2sjAaVtg==/com.*.*-dfI26diei0-qwrUPNR0eeg==/base.apk (com.appsflyer.reactnative.RNAppsFlyerModule$3.onError+12)
  #13  pc 0x0000000000780ee4  /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
  #14  pc 0x0000000000861500  /data/app/~~fd4r20TdR3MOOG2sjAaVtg==/com.*.*-dfI26diei0-qwrUPNR0eeg==/base.apk (com.appsflyer.internal.AFf1pSDK.AFAdRevenueData+116)

Please provide any other relevant information.

Im not sure how the double invocation happens, based on google play console it happens mostly on backgrounding. I could repro the issue by manually double invoking a callback. Based on the codepaths I see that we trigger the error callback in the try / catch as well as onError, there might be some type of condition being hit here where the error happens in logEvent natively gets thrown up and handled again?

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

1 participant