Skip to content

ANR triggered by com.tiktok.util.SystemInfoUtil >>> com.android.installreferrer due to slow binder transactions. #14

@nightism

Description

@nightism

Bug Description

We’re seeing a high number of ANRs caused by the TikTok Business SDK calling InstallReferrerClient.getInstallReferrer() (or similar synchronous methods) on the main thread. These methods make Binder calls to Google Play Services, which can block the thread and trigger ANRs.

A similar issue has been reported in the Facebook SDK: facebook/facebook-android-sdk#1039

Configuration

We have configured the TikTok Business SDK by following the official documentation: https://business-api.tiktok.com/portal/docs?id=1739585434183746

Java version

8

Android version

API 34+ (Android 14+)

Example stack trace

From API 35 - Android 15

          main (native):tid=1 systid=26102 
#00 pc 0xca388 libc.so (__ioctl + 8) (BuildId: 3cad38c74be79004f5b2927be886e077)
#01 pc 0x6ae5c libc.so (ioctl + 156) (BuildId: 3cad38c74be79004f5b2927be886e077)
#02 pc 0x6b0bc libbinder.so (android::IPCThreadState::transact + 924) (BuildId: 4e1cf8a0669a38f568703760164557d2)
#03 pc 0x64dcc libbinder.so (android::BpBinder::transact + 156) (BuildId: 4e1cf8a0669a38f568703760164557d2)
#04 pc 0x1ce768 libandroid_runtime.so (android_os_BinderProxy_transact + 152) (BuildId: 1ca72aeb09a3afddfd836b9768c1c822)
       at android.os.BinderProxy.transactNative(Native method)
       at android.os.BinderProxy.transact(BinderProxy.java:592)
       at com.google.android.a.a.b(a.java:2)
       at com.google.android.finsky.externalreferrer.IGetInstallReferrerService$Stub$Proxy.c(IGetInstallReferrerService.java:3)
       at com.android.installreferrer.api.InstallReferrerClientImpl.getInstallReferrer(InstallReferrerClientImpl.java:5)
  >>>  at com.tiktok.util.SystemInfoUtil$1.onInstallReferrerSetupFinished(SystemInfoUtil.java:166)
       at com.android.installreferrer.api.InstallReferrerClientImpl$InstallReferrerServiceConnection.onServiceConnected(InstallReferrerClientImpl.java:4)
       at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2217)
       at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2250)
       at android.os.Handler.handleCallback(Handler.java:991)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at android.app.ActivityThread.main(ActivityThread.java:8934)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions