HMS Cloud DB SDK UnsatisfiedLinkError No implementation found for AGConnectCloudDB instance

268 Views Asked by At

I followed the guidelines on Huawei Developer website about Cloud DB service.Then I just created a simple app trying to query data from Cloud DB and test it via Android Studio Emulator.

But i am getting following error that make the app crush with message on screen: ExampleCloudDBApp keeps stopping.

    Process: com.huawei.agc.clouddb.quickstart, PID: 6400
    java.lang.UnsatisfiedLinkError: No implementation found for long com.huawei.agconnect.cloud.database.AGConnectCloudDB.nativeGetInstance(com.huawei.agconnect.cloud.database.CertificateService, java.lang.String, java.lang.String) (tried Java_com_huawei_agconnect_cloud_database_AGConnectCloudDB_nativeGetInstance and Java_com_huawei_agconnect_cloud_database_AGConnectCloudDB_nativeGetInstance__Lcom_huawei_agconnect_cloud_database_CertificateService_2Ljava_lang_String_2Ljava_lang_String_2)
        at com.huawei.agconnect.cloud.database.AGConnectCloudDB.nativeGetInstance(Native Method)
        at com.huawei.agconnect.cloud.database.AGConnectCloudDB.initialize(AGConnectCloudDB.java:128)
        at com.huawei.agc.clouddb.quickstart.model.CloudDBZoneWrapper.initAGConnectCloudDB(CloudDBZoneWrapper.java:103)
        at com.huawei.agc.clouddb.quickstart.CloudDBQuickStartApplication.onCreate(CloudDBQuickStartApplication.java:28)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
        at android.app.ActivityThread.access$1100(ActivityThread.java:199)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

CloudDBQuickStartApplication class's initAGConnectCloudDB method:

public class CloudDBQuickStartApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        //Initialize AGConnectCloudDB
        CloudDBZoneWrapper.initAGConnectCloudDB(this);
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
    } 

CloudDBZoneWrapper class content that calls initialize method of AGConnectCloudDB class:

    public static void initAGConnectCloudDB(Context context) {
        AGConnectCloudDB.initialize(context);
    }
2

There are 2 best solutions below

0
On

You mentioned to test your Cloud DB app on Android Studio Emulator.

Based on my observation throghout the Huawei Kits' implementations, it was a less painful practice to use real android/huawei device or even a cloud based smartphone test environment provided on Huawei developer website.Some errors i faced using emulator was not appear on real device at all.

So ,May I suggest you to re-test your app on online Cloud Debug or real android device and check if error persists?

Huawei Cloud DB Guide Link

0
On

The problem occurs because you are running the Android simulator and the selected device is an x86 architecture.

Solution is:

A. Download the ARM emulator image and create a VM. You are advised to use the Nexus 6p or later and increase the memory during running (double the default value at least because the ARM emulator runs slowly on the x86 system).

B. Use the command line to compile and generate the APK, and then install the APK on the x86 simulator.

C. Use a real phone to debug the app.

D. Set the splits parameter in the compilation script.