[Huawei Developers] Mayism:
Relevant Logs​

You may encounter a failure to create object types when integrating Cloud DB. Typical logs are as follows:

1. The ObjectType quantity is invalid.

NaturalBase: GenerateDiffSchemas: remove ObjectType is not supported. count of ObjectType is less than current

2. The object types failed to be negotiated.

E/NaturalBase: OpenNaturalStore: negotiate failed.
W/AGConnectCloudDB: openCloudDBZone: failed to create or open a cloudDBZone.

3. The scheme is not synchronized.

[NaturalCloudSyncModule][OnConnected]: negotiate schema.
[PushMessageAndNotifyStoreCv] Schema is UnSynced

4. The version of object types been changed but object types themselves are not changed.

E/NaturalBase: CreateObjectType: ObjectType version has changed, but ObjectType has not changed.
E/AGConnectCloudDB: createObjectType: failed to create ObjectType into the AGCConnectCloudDB.

Cause Analysis​

The main cause is that the file matching the object type version in your Android project is inconsistent with the object types set on the AppGallery Connect server.

You can check the object types in AppGallery Connect as follows.

To check information relevant to object types in your Android project, check the class in ObjectTypeInfoHelper.

Three Steps to Solve the Problem​

1. Exporting Object Types from AppGallery Connect​

Since the object types in your Android project are inconsistent with those in AppGallery Connect, you need to export the object types from AppGallery Connect for synchronization.

The export procedure in AppGallery Connect is as follows: Sign in to AppGallery Connect, click My projects, click your project, go to Build > Cloud DB > ObjectTypes, select the specific version, and click Export.

During the export, select JAVA for the file format and android for the file type of Java, and enter a package name.

Decompress the exported ZIP package in your project directory.

2. Checking Versions​

You should pay attention to two versions in the object type file, which correspond to the following two fields in the ObjectTypeInfoHelper file:

1. FORMAT_VERSION: The value should match the SDK version.

If the value of FORMAT_VERSION in the exported file is 1, integrate the Cloud DB SDK of a version earlier than 1.2.2. Version 1.2.1.301 is recommended.

If the value of FORMAT_VERSION in the exported file is 2, integrate the Cloud DB SDK of a later version. Version 1.2.3.301 is recommended.

2. OBJECT_TYPE_VERSION

This version is that selected when you export object type information from AppGallery Connect. Generally, you do not need to change it.

3. Uninstalling Your App from Your Device and Installing It Again​

If you have encountered the object type problem on your device, the incorrect information will still exist in the cache if you install your app again directly, and object type creation will still fail.

The correct method for performing the app re-installation is as follows:

1. Package your app again.

2. Uninstall the app already installed on your device manually.

3. Install the newly packaged app on your device for debugging.

The correct method for performing the app re-installation is as follows:

https://developer.huawei.com/consum...ect-Guides/agc-clouddb-agcconsole-objecttypes