🏗️Build & Development

Problems and solutions you may encounter while using the plugin or testing it on the device. (Before - After Build)

Why I am getting a class not found exception?

  • Did you enable the kits you are using from the kit settings?

  • There is a known issue: you need to disable kits from kit settings, restart unity then enable kits again.

  • If you are getting Unity java.lang.ClassNotFoundException: org.m0skit0.*********

I am still getting a class not found exception!

  • You can try to delete all files and folders in the root directory except the Assets, Packages, and ProjectSettings folder (exit the Unity editor before deleting folders) and then restart the Unity.


What should I do if a 6003 error occurs?

Inconsistent certificate fingerprint configurations cause the 6003 error. Check the following items:

  1. Ensure that the certificate fingerprint has been configured, and the certificate for packing the signature on the local client is the same as the certificate for configuring the fingerprint in AppGallery Connect.

  2. Check the fingerprint entries in the certificate. It is recommended that you use a single entry.

  3. If the 6003 error persists when you run the local client after the fingerprint is configured, the debug certificate is running by default. Clear the HMS Core (APK) cache and run the client again.

I am still getting 6003 error!

Verify that the certificate fingerprint is correctly configured when you apply for related services.

Open the APK file of an app, extract the META-INF directory from the file, and obtain the CERT.RSA file in the directory, and run the:

keytool -printcert -file CERT.RSA

command to record the signing certificate information. You will get certificate fingerprints like this:

Certificate fingerprints:

MD5: ****

SHA1: ****

SHA256:****

I don't have an RSA file inside META-INF!!!

The real issue seems to be that the APK is not signed with the v1 scheme. Please refer to the unity forum.


Why is the result code 6004 returned?

(example for game service)

After enabling the game service you need to

  1. reimport agconnect-services.json

  2. Clear the HMS Core (APK) cache and try again.

It may take a while for the change to be effected.


Why I am getting [HmsIAPManager] Specified: -productID- could not be found in the retrieved product list! using In-App-Purchases?

Is there any error in the logs before this error? That can be the reason. If not can you check your productID and product types are correct?


How can I fix the Duplicate classes error?

You can try to disable Common Libraries from the kit settings.


Doesn't work in Cloud Debugging!

Please switch the guest user to the owner and test again. (For testing Ads)


Why is my app closing as I open it on the test device? (Corrupted Scene)

Check your logs for level0' is corrupted! remove it and launch unity again! error. No matter how much we don't want it, this error can happen. To fix this issue please restart Unity editor.


How can I check my device's logs?

You can use

  • android logcat in Unity.

  • android studio to catch logs.Kit

  • Cloud debugging.

  • In console {your unity editor}\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb logcat


How can I resolve the failure to install the following Android SDK packages as some licenses have not been accepted?

You need to accept SDK licenses. You can refer to this comment.


Why I am getting the "Failed to load the ***Settings. Please restart Unity Editor" error?

There was probably the same settings file so the plugin created a new settings file name like "**settings 1". You can delete all settings files in the resources folder and then restart Unity. This will recreate the settings files and fix the issue.


Is there any way I can understand if the device supports HMS or GMS?

You can use the isGMSAvailable and isHMSAvailable fields in the ServiceHelper class.


Why I am getting the 7018 "GAME_STATE_NOT_INIT" error?

For our demo, you should check the InitOnStart box in the Game service editor (Unity>Huawei>Kit Settings>Game Service). For your custom logic please refer to our manager.


Why I am getting 3 - NO_AD error while using the Ads kit?

The ad request is sent successfully, but the server returns a response indicating no available ad assets. If you trying with real Ads ID in the non-released game, this situation is normal. When you release your game, it will start showing real ads.


Why I am getting 2 - NETWORK_ERROR while using the Ads kit?

Are you testing with no HMS Core installed device(non-Huawei)? Please refer to Devices without HMS Core installed.


Why I am getting 0 - INNER error while using the Ads kit?

1. is your targetSdkVersion: 31 (recommended) and compileSdkVersion: 31 (recommended)?

2. Do you have the latest HMS core version on your test device?

3. Does your test device have HMS Core? If not, please refer to Devices without HMS Core installed.

4. Synchronize the mobile phone time with the current time.

5. Inserting a SIM card can fix the problem.


Unable to get provider com.huawei.hms.update.provider.UpdateProvider?

Please refer to #368.


Exception: NullReferenceException: Object reference not set to an instance of an object. HmsPlugin.HMSAdsKitManager +ConsentUpdateListener.HuaweiMobileServices.Ads.IConsentUpdateListener.OnSuccess

IConsentUpdateListener.OnSuccess we believe mAdsManager is null in your case.

You need to call the RequestConsentUpdate method before using consent.

You can refer to our demo scene.


Failed to call I Post Generate Gradle Android Project callbacks

(fixed with v2.2.7)

Failed to Copy File / Directory from D: /Unity/projects/{yourProjectname}/Assets/Huawei/Plugins/Android/hms Main Template.gradle' to ''D: \Unity\projects\{yourProjectname}\Library\Bee\Android\Pro\Mono 2 x\Gradle\unity Library/hms Main Template.gradle': destination path already exists.

Are you getting an error similar to this?

Please delete the Library/Bee folder then try again. The bee folder holds temporary files and uses them when building. If Build succeeds, Unity cleans this folder, but if fails, the temporary files remain. So if you try to build after a failed build you get this issue.


Gradle build failed: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

Is everything ok with your Keystore? Maybe you entered the password wrong? Restarting Unity and trying again may fix it.


InvalidOperationException: Insecure connection not allowed

Are you sure that you are using the right agc.json? This problem can be related to agc.json or SHA-256. Please refer to quickstart. Related parts: "Obtaining the agconnect-services.json File" - "Adding Fingerprint Certificate to AppGallery Connect".

👩‍💻pageQuick Start

Why I am getting Ads not loaded error?

Is there any error in the logs before this error? That can be the reason.


Why I am getting "com.android.build.gradle.internal.tasks.Workers$ActionFacade AAPT2 aapt2-4.1.0-6503028" error?

is your target API level 34 or Automatic (Highest installed). Please check from "Build Setting>Player Settings>Other settings>Target API Level". Just a reminder you should use Unity 2022 and the upper versions for Android 14(API 34).

Last updated