Huawei Developers
Published in

Huawei Developers

What Can I Do When the Message “miss client id” Is Displayed During AppGallery Connect Service Integration?

Background

When I referred to official documentation of AppGallery Connect for APM integration and packaged and run the app, an error message was displayed in the run log:

The log is as follows.

Another colleague encountered this error when integrating App Linking of AppGallery Connect.

According to the error message, I checked the agconnect-services.json file of my demo project. It was found that the client ID in the JSON file was correct.

Problem Reoccurring

First, I downloaded the sample code from the official website and replaced it with my own JSON file. Then, I checked the run logs and found no problem. This meant that the AppGallery Connect project configuration had no problem.

Then, I opened the demo downloaded from the official website, deleted the client ID from the JSON file, and repackaged and run the demo. Two lines of error logs were displayed, which were different from the preceding message. This was not the cause.

Next, I compared the demo project downloaded from the official website with the project created by me. Then, I found that I didn’t add the AppGallery Connect plug-in to the app-level build.gradle file, that is, the file did not contain the code as follows.

I deleted the code about the AppGallery Connect plug-in from the gradle file downloaded from the official website. The problem was reproduced.

Cause Analysis

Finally, we communicated with Huawei technical support to find out the root cause of the problem.

During building of the Android project, the AppGallery Connect plug-in in the gradle file automatically compiles the client ID in the JSON file to the String.xml file in the resource directory.

If the AppGallery Connect plug-in is missing, the SDK in the project cannot obtain the client ID.

Solution: Add the AppGallery Connect plug-in to the app-level build.gradle file.

For details about how to integrate the AppGallery Connect plug-in, please refer to the following:

https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-get-started#h2-1587477308727

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store