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

Getiing following error when launching salesforce mobile sdk based hybrid app on android platform #2619

Open
hemantsumanmetacube opened this issue Sep 24, 2024 · 13 comments
Assignees

Comments

@hemantsumanmetacube
Copy link

Please fill out the following details:

  1. Version of Mobile SDK Used: 12.0.1
  2. Issue found in Native App or Hybrid App: Hybrid
  3. OS Version: MacOS sequioa and windows 11
  4. Device: Android API 35
  5. Steps to reproduce: Login into the salesforce mobile based hybrid application and after entering the device password the app crashes
  6. Actual behavior: app crashed
  7. Expected Behavior: app should not get crashed
  8. Error Log:
    java.lang.UnsatisfiedLinkError: No implementation found for long net.zetetic.database.sqlcipher.SQLiteConnection.nativeOpen(java.lang.String, int, java.lang.String, boolean, boolean) (tried Java_net_zetetic_database_sqlcipher_SQLiteConnection_nativeOpen and Java_net_zetetic_database_sqlcipher_SQLiteConnection_nativeOpen__Ljava_lang_String_2ILjava_lang_String_2ZZ) - is the library loaded, e.g. System.loadLibrary?
    at net.zetetic.database.sqlcipher.SQLiteConnection.nativeOpen(Native Method)
    at net.zetetic.database.sqlcipher.SQLiteConnection.open(SQLiteConnection.java:226)
    at net.zetetic.database.sqlcipher.SQLiteConnection.open(SQLiteConnection.java:202)
    at net.zetetic.database.sqlcipher.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:475)
    at net.zetetic.database.sqlcipher.SQLiteConnectionPool.open(SQLiteConnectionPool.java:189)
    at net.zetetic.database.sqlcipher.SQLiteConnectionPool.open(SQLiteConnectionPool.java:181)
    at net.zetetic.database.sqlcipher.SQLiteDatabase.openInner(SQLiteDatabase.java:1028)
    at net.zetetic.database.sqlcipher.SQLiteDatabase.open(SQLiteDatabase.java:1013)
    at net.zetetic.database.sqlcipher.SQLiteDatabase.openDatabase(SQLiteDatabase.java:840)
    at net.zetetic.database.sqlcipher.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:359)
    at net.zetetic.database.sqlcipher.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:278)
    at com.salesforce.androidsdk.smartstore.store.SmartStore.getDatabase(SmartStore.java:207)
    at com.salesforce.androidsdk.smartstore.store.SmartStore.clearSoup(SmartStore.java:614)
    at com.salesforce.androidsdk.phonegap.plugin.SmartStorePlugin.clearSoup(SmartStorePlugin.java:559)
    at com.salesforce.androidsdk.phonegap.plugin.SmartStorePlugin.-$$Nest$mclearSoup(Unknown Source:0)
    at com.salesforce.androidsdk.phonegap.plugin.SmartStorePlugin$1.run(SmartStorePlugin.java:150)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)
    2024-09-24 15:57:07.081 5415-5543 AndroidRuntime com.tier1crm.tier1mobilenow E FATAL EXCEPTION: pool-5-thread-4
    Process: com.tier1crm.tier1mobilenow, PID: 5415
    java.lang.UnsatisfiedLinkError: No implementation found for long net.zetetic.database.sqlcipher.SQLiteConnection.nativeOpen(java.lang.String, int, java.lang.String, boolean, boolean) (tried Java_net_zetetic_database_sqlcipher_SQLiteConnection_nativeOpen and Java_net_zetetic_database_sqlcipher_SQLiteConnection_nativeOpen__Ljava_lang_String_2ILjava_lang_String_2ZZ) - is the library loaded, e.g. System.loadLibrary?
    at net.zetetic.database.sqlcipher.SQLiteConnection.nativeOpen(Native Method)
    at net.zetetic.database.sqlcipher.SQLiteConnection.open(SQLiteConnection.java:226)
    at net.zetetic.database.sqlcipher.SQLiteConnection.open(SQLiteConnection.java:202)
    at net.zetetic.database.sqlcipher.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:475)
    at net.zetetic.database.sqlcipher.SQLiteConnectionPool.open(SQLiteConnectionPool.java:189)
    at net.zetetic.database.sqlcipher.SQLiteConnectionPool.open(SQLiteConnectionPool.java:181)
    at net.zetetic.database.sqlcipher.SQLiteDatabase.openInner(SQLiteDatabase.java:1028)
    at net.zetetic.database.sqlcipher.SQLiteDatabase.open(SQLiteDatabase.java:1013)
    at net.zetetic.database.sqlcipher.SQLiteDatabase.openDatabase(SQLiteDatabase.java:840)
    at net.zetetic.database.sqlcipher.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:359)
    at net.zetetic.database.sqlcipher.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:278)
    at com.salesforce.androidsdk.smartstore.store.SmartStore.getDatabase(SmartStore.java:207)
    at com.salesforce.androidsdk.smartstore.store.SmartStore.clearSoup(SmartStore.java:614)
    at com.salesforce.androidsdk.phonegap.plugin.SmartStorePlugin.clearSoup(SmartStorePlugin.java:559)
    at com.salesforce.androidsdk.phonegap.plugin.SmartStorePlugin.-$$Nest$mclearSoup(Unknown Source:0)
    at com.salesforce.androidsdk.phonegap.plugin.SmartStorePlugin$1.run(SmartStorePlugin.java:150)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)
@wmathurin
Copy link
Contributor

Is it happening only on Android 35?
Could you try the latest Mobile SDK (12.1.1) ?

@hemantsumanmetacube
Copy link
Author

it's happening on Android 34 as well

@wmathurin
Copy link
Contributor

@hemantsumanmetacube
Copy link
Author

After further investigation we found that the app is running fine on Android Studio Jellyfish version and crashing on Kuala and Ladybug versions

@hemantsumanmetacube
Copy link
Author

Is there any update for this issue?

@brandonpage
Copy link
Contributor

I have not seen this issue with 12.1.1 running Kuala or Ladybug, perhaps try that? 12.2 will be releasing very soon as well.

@JohnsonEricAtSalesforce
Copy link
Contributor

I was able to reproduce this using Android Studio Ladybug 2024.2.1 Patch 1 on macOS 14.7 and the Google Play Android Emulator for both API 26 and API 35. The interesting thing is it works without the error on my real Google Pixel 9 Pro API 34.

Could this issue be specific to the Android emulator? The dependency is declared on the SmartStore dependency. It works consistently when I add the api("net.zetetic:sqlcipher-android:4.6.1") dependency directly to the AccountEditor hybrid sample app provided with MSDK.

@JohnsonEricAtSalesforce
Copy link
Contributor

@hemantsumanmetacube - How is your project resolving SalesforceHybrid in Gradle? At Salesforce, our samples and templates used to build that from included local sources. We switched to depending on pre-compiled, hosted binaries.

I noticed the older way of using a local build exhibits this issue. The newer way of using the hosted, pre-compiled binaries works A-OK. I'm not certain of the exact reason yet, but thought I'd share early if it helps you.

Here's the difference in Gradle.

dependencies {
//    api(project(":libs:SalesforceHybrid")) // Referencing local sources for SF MSDK Doesn't work.
    api("com.salesforce.mobilesdk:SalesforceHybrid:12.1.0") // Referencing hosted libraries works - Yay!

@hemantsumanmetacube
Copy link
Author

We are referencing local resources, because we have added some custom changes, and thus we can not use hosted libraries.

@hemantsumanmetacube
Copy link
Author

@JohnsonEricAtSalesforce In which file are you adding api("net.zetetic:sqlcipher-android:4.6.1") dependency that resolves the issue?

@JohnsonEricAtSalesforce
Copy link
Contributor

Thanks for the reply, @hemantsumanmetacube. That helps solidify the theory that there's something different about how the native library is picked up in these two different dependency styles.

I added SQLCipher as an API dependency in the app's build.gradle.kts exactly as it is also declared in the SmartStore library's build.gradle.kts. When building from hosted resources, SmartStore provides SQLCipher as a transitive dependency including the native portion. It's interesting that this project dependency on local SmartStore sources does not.

I noticed this issue in MSDK's AccountEditor hybrid sample app during 12.2 regression testing. So, that will get a similar fix as well.

Let me know if this doesn't work and we'll see what we can do.

@forcedotcom forcedotcom deleted a comment from Techfhil Oct 30, 2024
@JohnsonEricAtSalesforce
Copy link
Contributor

@hemantsumanmetacube - It's still in review, but there is also a more robust fix for this in the works. Feel to view this code and, if needed, incorporate into your app's local sources.

@hemantsumanmetacube
Copy link
Author

Getting this error after adding api("net.zetetic:sqlcipher-android:4.6.1")

[rpc_manager] SetConsent failed with status: gbzy{code=PERMISSION_DENIED, description=The caller does not have permission, cause=null}
Exception:
gbzz: PERMISSION_DENIED: The caller does not have permission
at gbzy.h(:com.google.android.gms@[email protected] (190400-646585959):3)
at anbi.u(:com.google.android.gms@[email protected] (190400-646585959):29)
at anbi.g(:com.google.android.gms@[email protected] (190400-646585959):97)
at ansl.o(:com.google.android.gms@[email protected] (190400-646585959):309)
at ansl.t(:com.google.android.gms@[email protected] (190400-646585959):126)
at com.google.android.gms.constellation.EventManager.onHandleIntent(:com.google.android.gms@[email protected] (190400-646585959):720)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms@[email protected] (190400-646585959):2)
at ajom.onHandleIntent(:com.google.android.gms@[email protected] (190400-646585959):8)
at pkf.run(:com.google.android.gms@[email protected] (190400-646585959):70)
at pke.run(:com.google.android.gms@[email protected] (190400-646585959):152)
at emsz.run(:com.google.android.gms@[email protected] (190400-646585959):21)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
2024-11-19 16:57:45.369 1619-2799 constellation com.google.android.gms E [api_set_asterism_consent] Verification exception:
aoeu: setConsent: The caller does not have permission []
at ansl.o(:com.google.android.gms@[email protected] (190400-646585959):524)
at ansl.t(:com.google.android.gms@[email protected] (190400-646585959):126)
at com.google.android.gms.constellation.EventManager.onHandleIntent(:com.google.android.gms@[email protected] (190400-646585959):720)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms@[email protected] (190400-646585959):2)
at ajom.onHandleIntent(:com.google.android.gms@[email protected] (190400-646585959):8)
at pkf.run(:com.google.android.gms@[email protected] (190400-646585959):70)
at pke.run(:com.google.android.gms@[email protected] (190400-646585959):152)
at emsz.run(:com.google.android.gms@[email protected] (190400-646585959):21)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
2024-11-19 16:57:45.374 8596-968 Bugle com.google.android.apps.messaging E SharedStorageInteractor: Security error,calling app is not whitelisted to access Bugle's data, uid: 10144
2024-11-19 16:57:45.376 8596-968 BugleRcsEngine com.google.android.apps.messaging W Unable to send ContentProvider request event log [CONTEXT thread_id=121 ]
2024-11-19 16:57:45.378 8596-968 BugleRcsEngine com.google.android.apps.messaging E Error while retrieving RcsProvisioningRcsDefaultOnConfiguration from Bugle storage. [CONTEXT log_prefix="ProvisioningEngineDataRetriever" thread_id=121 ]
cknl: ContentProvider request failed, failureReason: UID_NOT_VERIFIED_ERROR
at cknm.g(PG:134)
at cknm.i(PG:14)
at cknm.o(PG:7)
at cjww.e(PG:7)
at cjnx.a(PG:3)
at cjnp.i(PG:9)
at cjnj.apply(PG:7)
at dkwh.a(PG:7)
at dqra.run(PG:18)
at dqqd.execute(PG:1)
at dkwl.execute(PG:18)
at dqod.o(PG:1)
at dqod.j(PG:95)
at dqod.setException(PG:19)
at dqoj.run(PG:81)
at dqqd.execute(PG:1)
at dqod.o(PG:1)
at dqod.j(PG:95)
at dqod.setException(PG:19)
at cuol.a(PG:35)
at chhd.run(PG:12)
at dqqd.execute(PG:1)
at chhe.c(PG:12)
at chht.b(PG:36)
at chhz.u(PG:20)
at chhv.a(PG:3)
at cfoh.b(PG:15)
at cesy.onConsentRegistered(PG:3)
at com.google.android.gms.asterism.internal.IAsterismCallbacks$Stub.dispatchTransaction(PG:28)
at com.google.android.aidl.BaseStub.onTransact(PG:13)
at android.os.Binder.execTransactInternal(Binder.java:1505)
at android.os.Binder.execTransact(Binder.java:1444)

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

4 participants