Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#31 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
android

Research direction

Start by reviewing the CameraKit 1.42.0 authorization failure and the provided stack trace, focusing on when default initialization performs its runtime check. Investigate the reported Huawei/Xiaomi pattern and the question about initialization in a non-main process. Done means identifying a reproducible cause or narrowing the authorization failure to a specific runtime condition.

Written by the indexing model from the issue text.

Description

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.

Dominant language
No language data
Stars
46
Forks
17
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Snapchat/camera-kit-android-sdk

All issues in Snapchat/camera-kit-android-sdk

Similar issues

More Security issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.