Skip to content

[Bug] CameraKit authorization failed on some devices (Huawei/Xiaomi) even with correct package name #31

@misswuwei

Description

@misswuwei

Hi Snap team and developers,

We encountered a strange issue in production: some of our users are seeing CameraKit authorization failures.

Sentry captured the following error:
The application with API token [***] and package name [com.xxx.xxxx] is not authorized to use CameraKit

This only affects a small portion of users (more often on Huawei and Xiaomi devices). Most users are unaffected. According to the Sentry logs, the application package name is correct (com.xxx.xxxx), so we are not sure why the authorization failed.

Full stack trace:
UnauthorizedApplicationException
The application with API token [***] and package name [com.xxx.xxxx] is not authorized to use CameraKit
mechanism
UncaughtExceptionHandler
handled
false
com.snap.camerakit.internal.rd1 in a at line 15
com.snap.camerakit.internal.fr4 in a at line 1
com.snap.camerakit.internal.dv3 in a at line 217
com.snap.camerakit.internal.oo1 in run at line 3
com.snap.camerakit.internal.qo1 in a at line 7
com.snap.camerakit.internal.qo1 in a at line 17
com.snap.camerakit.internal.jy in b at line 14
com.snap.camerakit.internal.jy in a at line 4
com.snap.camerakit.internal.m80 in run at line 3
com.snap.camerakit.internal.o35 in run at line 4
com.snap.camerakit.internal.py in a at line 12
com.snap.camerakit.internal.ry in a at line 15
com.snap.camerakit.internal.ck2 in a at line 23
… k2$$InternalSyntheticLambda$1$614ce6186f522a68062755f5f50fc15347b12c5f9eb16a5bfd81e68db24bcd03$1 in a$bridge
com.snap.camerakit.internal.b72 in b at line 48
com.snap.camerakit.internal.m62 in a at line 69
com.snap.camerakit.internal.m62 in a at line 59
com.snap.camerakit.internal.pa2 in run at line 4
com.snap.camerakit.internal.d02 in run at line 5
com.snap.camerakit.internal.f02 in run at line 28
com.snap.camerakit.internal.fc in run at line 5
java.util.concurrent.ThreadPoolExecutor in runWorker at line 1167
java.util.concurrent.ThreadPoolExecutor$Worker in run at line 641
com.snap.camerakit.internal.h4 in run at line 4

🔹 Observations

The issue only affects a small portion of users.

It happens more frequently on Huawei and Xiaomi devices.

For the majority of devices, the same build and same API token works fine.

Happens during app runtime, not at app startup.

According to Sentry logs, the package name is correct (com.xxx.xxxx) and matches the one we registered with the token.

🔹 Questions

At what point does CameraKit perform the authorization check?

Could this be related to multi-process scenarios, where the SDK might initialize in a non-main process?

🔹 Environment

CameraKit version: 1.42.0

Distribution: Google Play & third-party app stores

Affected devices: Mostly Huawei and Xiaomi

Trigger: Cold start, first usage of CameraKit

🔹 What we have verified

API token and package name binding are correct.

The majority of users (same version, same package, same token) are unaffected.

No manual call to CameraKit.initialize() in our project — we rely on default initialization.

@DipoSnap @obobrosc
We would really appreciate it if the Snap team could provide any insight, suggestions, or possible reasons why this authorization issue may occur. Your feedback would be very helpful for us to resolve this problem.

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