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

Cloudwatch throws UnsatisfiedLinkError when loading sqlcipher library on Android 15 device using 16KB memory page sizes #2917

Open
1 task done
cHunter791 opened this issue Sep 17, 2024 · 2 comments
Labels
bug Something isn't working logging Related to the Logging category/plugins

Comments

@cHunter791
Copy link

Before opening, please confirm:

Language and Async Model

Kotlin

Amplify Categories

Not applicable

Gradle script dependencies

implementation "com.amplifyframework:core-kotlin:2.21.1"
implementation "com.amplifyframework:aws-auth-cognito:2.21.1"
implementation "com.amplifyframework:aws-logging-cloudwatch:2.21.1"

Environment information

------------------------------------------------------------
Gradle 8.7
------------------------------------------------------------

Build time:   2024-03-22 15:52:46 UTC
Revision:     650af14d7653aa949fce5e886e685efc9cf97c10

Kotlin:       1.9.22
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          17.0.10 (Homebrew 17.0.10+0)
OS:           Mac OS X 14.3 aarch64

Please include any relevant guides or documentation you're referencing

https://developer.android.com/guide/practices/page-sizes

Describe the bug

We are testing our app on the new Android 15 SDK. As part of this investigation we are testing the app on an emulator that usings 16KB memory page sizes that Android 15 will now support in new devices (refer to above documentation)

When the app starts, it immediately crashes. The stacktrace is pointing to the Cloudwatch library as the source of the crash when it attempts to load the sqlcipher library.

java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~dtJqMT5Wdr7uvd_u4kYHCA==/com.my.app-hpvblSBKxaJ32rafyO5VUw==/lib/arm64/libsqlcipher.so" (new hash type from the future?)
    at java.lang.Runtime.loadLibrary0(Runtime.java:1081)
    at java.lang.Runtime.loadLibrary0(Runtime.java:1003)
    at java.lang.System.loadLibrary(System.java:1765)
    at com.amplifyframework.logging.cloudwatch.db.CloudWatchLoggingDatabase$database$2.invoke(CloudWatchLoggingDatabase.kt:46)
    at com.amplifyframework.logging.cloudwatch.db.CloudWatchLoggingDatabase$database$2.invoke(CloudWatchLoggingDatabase.kt:45)
    at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    at com.amplifyframework.logging.cloudwatch.db.CloudWatchLoggingDatabase.getDatabase(CloudWatchLoggingDatabase.kt:45)
    at com.amplifyframework.logging.cloudwatch.db.CloudWatchLoggingDatabase.query(CloudWatchLoggingDatabase.kt:127)
    at com.amplifyframework.logging.cloudwatch.db.CloudWatchLoggingDatabase.access$query(CloudWatchLoggingDatabase.kt:31)
    at com.amplifyframework.logging.cloudwatch.db.CloudWatchLoggingDatabase$queryAllEvents$2.invokeSuspend(CloudWatchLoggingDatabase.kt:69)
    at com.amplifyframework.logging.cloudwatch.db.CloudWatchLoggingDatabase$queryAllEvents$2.invoke(Unknown Source:14)
    at com.amplifyframework.logging.cloudwatch.db.CloudWatchLoggingDatabase$queryAllEvents$2.invoke(Unknown Source:12)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:61)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
    at com.amplifyframework.logging.cloudwatch.db.CloudWatchLoggingDatabase.queryAllEvents$aws_logging_cloudwatch_release(CloudWatchLoggingDatabase.kt:67)
    at com.amplifyframework.logging.cloudwatch.CloudWatchLogManager$syncLogEventsWithCloudwatch$2.invokeSuspend(CloudWatchLogManager.kt:116)
    at com.amplifyframework.logging.cloudwatch.CloudWatchLogManager$syncLogEventsWithCloudwatch$2.invoke(Unknown Source:14)
    at com.amplifyframework.logging.cloudwatch.CloudWatchLogManager$syncLogEventsWithCloudwatch$2.invoke(Unknown Source:12)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:61)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
    at com.amplifyframework.logging.cloudwatch.CloudWatchLogManager.syncLogEventsWithCloudwatch$aws_logging_cloudwatch_release(CloudWatchLogManager.kt:110)
    at com.amplifyframework.logging.cloudwatch.CloudWatchLogManager$onSignIn$1.invokeSuspend(CloudWatchLogManager.kt:222)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)

Checking the Cloudwatch plugin you are using the android-database-sqlcipher library, this has since been deprecated in favour of the sqlcipher-android library. The most recent release. 4.6.1, of sqlcipher-android has support for 16KB page sizes

Reproduction steps (if applicable)

  1. Create a new Android application
  2. Follow setup for adding Cloudwatch logging to the app here
  3. Setup an emulator following the instructions here to have it running Android 15 and using 16KB page sizes
  4. Run the app on the Android 15 emulator with 16KB page sizes, the app will immediately crash
  5. If you remove the Amplify.addPlugin(AWSCloudWatchLoggingPlugin()) line and run the app again, the app will not crash

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Sep 17, 2024
@tylerjroach
Copy link
Member

Thank you for the report! We will take this work on to provide 16kb page size support. We will update this ticket once support is ready.

@tylerjroach tylerjroach added the bug Something isn't working label Sep 17, 2024
@github-actions github-actions bot removed pending-maintainer-response Issue is pending response from an Amplify team member pending-triage Issue is pending triage labels Sep 17, 2024
@tylerjroach tylerjroach added the logging Related to the Logging category/plugins label Sep 17, 2024
@tylerjroach
Copy link
Member

Effort to support 16KB page size can be found here: #2919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logging Related to the Logging category/plugins
Projects
None yet
Development

No branches or pull requests

2 participants