Hms Cloud bd get error code: 8 message: please close CloudDBZone first. On android Studio

59 Views Asked by At

After HMS Cloud DB implementation I get error it is about I deleted table on cloud bd before close. How can I fix that problem?

 Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109) 
     Caused by: com.huawei.agconnect.cloud.database.exceptions.AGConnectCloudDBException: code: 8 message: please close CloudDBZone first.
        at com.huawei.agconnect.cloud.database.AGConnectCloudDB.nativeCreateObjectType(Native Method)
        at com.huawei.agconnect.cloud.database.AGConnectCloudDB.createObjectType(AGConnectCloudDB.java:33)
      
1

There are 1 best solutions below

0
On

I solved my problem. I was use hilt for DI(Dependency Injection) on my ViewModel file. When I called my ViewModel from my two different fragment, The Cloud DB was called in first time and second time was crashed because of already Cloud DB exist and I separated my ViewModel. So problem solved.