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

Calling setUserId with invalid character crashes app #196

Closed
rkrishnan2012 opened this issue May 26, 2024 · 1 comment
Closed

Calling setUserId with invalid character crashes app #196

rkrishnan2012 opened this issue May 26, 2024 · 1 comment

Comments

@rkrishnan2012
Copy link

Expected Behavior

  1. Call amplitude.setUserId("hello@email.com")
  2. Expect the app to not crash

Current Behavior

The app crashes with stacktrace:

java.io.IOException: Could not create directory at /tmp/amplitude-identity/$default_instance
at com.amplitude.id.utilities.FileUtilsKt.createDirectory(FileUtils.kt:9)
at com.amplitude.id.FileIdentityStorage.<init>(FileIdentityStorage.kt:21)
at com.amplitude.id.FileIdentityStorageProvider.getIdentityStorage(FileIdentityStorage.kt:71)
at com.amplitude.core.Amplitude$build$built$1.invokeSuspend(Amplitude.kt:112)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
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:920)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@5de282a, java.util.concurrent.ThreadPoolExecutor@a50161b[Running, pool size = 2, active threads = 1, queued tasks = 0, completed tasks = 2]]

Possible Solution

Not really sure.

Steps to Reproduce

Call amplitude.setUserId("hello@email.com") after initializing the Amplitude class.

Environment

  • Unity Plugin Version: 1.16.7
  • Device: Android Pixel 4 API 32 emulator
  • Device OS and Version: Android 12
@rkrishnan2012
Copy link
Author

Actually this issue happens because I imported com.amplitude.core.Amplitude instead of com.amplitude.android.Amplitude. Fixing the import resolved my issue.

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