当前位置:网站首页>Why is there no data reported when the application is connected to Huawei Analytics in the application debugging mode?
Why is there no data reported when the application is connected to Huawei Analytics in the application debugging mode?
2022-07-30 15:53:00 【Huawei Developer Forum】
1. Problem description
First, we connected the Huawei Analytics SDK according to the "Huawei Analytics" integration document, and explained that the version of the integrated SDK is: com.huawei.hms:hianalytics:6.4.1.302, and then it cannot be seen in the "Application Debugging" panel.Real-time data, and there is no device to select in the upper right corner of the "Application Debugging" page, the details are shown in the following figure:

In fact, the problem is relatively clear, that is, no data can be seen in the application debugging interface of the AGC background.
First of all, we need to determine whether to open the debug mode. We can execute the following command on the command line:
adb shell setprop debug.huawei.hms.analytics.app

You can see that the command has been successfully executed, our debug mode has been turned on, but there is no data, so how to solve this problem?
There is no quick solution for this kind of problem. We can only check one by one according to the following situations. Let's take a look at how to troubleshoot this problem in detail.
2. Problem analysis and solution
For the above problem, we usually have the following steps to verify whether it is correct.
First: Check whether Huawei Analytics Service has been activated
After checking, we have activated the Huawei analysis service, so this item can be excluded, as shown in the following figure:

Second: Check if the "agconnect-services.json" file in the project is the original file
We re-downloaded a "agconnect-services.json" file in the AGC background, and then compared it with the file in the project and found that it is completely consistent, so this item can also be excluded, as shown in the following figure:

Third: Check if tools:node="replace" is used in the AndroidManifest.xml file
tools:node="replace" will cause some configurations of the application to conflict with the AGC SDK configuration, resulting in the failure of the AGC interface to obtain the token. The following modifications need to be made:
a. Change the parameter to tools:node="merge".
b. Manually write all the "AndroidManifest.xml" file information of AGC to the "AndroidManifest.xml" file information of your App.
But we checked the file and found that this configuration is not used, so there is no such problem, too much content will not be mapped.
Fourth: When compiling the APK, the Analytics Kit obfuscation configuration is not excluded, resulting in an abnormal APK
After checking the obfuscation configuration file of the project, it is found that the obfuscation configuration of Analytics Kit has been added, as shown below:
Groovy code
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
-keep class com.huawei.agconnect.**{*;}
-keep interface com.huawei.hms.analytics.type.HAEventType{*;}
-keep interface com.huawei.hms.analytics.type.HAParamType{*;}
So this problem doesn't exist either.
Fifth: Check whether the data storage location is set
This item is really difficult to check. Generally, it will be set when the analysis service is opened. After the above checks are all fine, we will once again connect with the agconnect-services.json file of other projects.After comparison, it was found that the field of data storage location was missing, so the data could not be reported successfully. Therefore, it was necessary to set the data storage location when opening the analysis service.
OK, that's all for today, thank you!
For more technical articles, please visit https://developer.huawei.com/consumer/cn/forum/?ha_source=zzh
边栏推荐
猜你喜欢
随机推荐
tiup env
Overview of TiUP commands
QIIME2得到PICRUSt2结果后如何分析
被捧上天的Scrum敏捷管理为何不受大厂欢迎了?
php如何查询字符串出现位置
HTTP缓存小结
ISELED---the new choice of ambient lighting scheme
Extremely Knowing v2 Analysis
一文读懂Elephant Swap,为何为ePLATO带来如此高的溢价?
TiUP 命令概览
使用 TiUP 命令管理组件
应用接入华为分析在应用调试模式下为何没有数据上报?
Sleuth+Zipkin (visualization) service link tracking
数据分析工具篇——HQL中DDL操作&DML操作
(Popular Science) What is Fractional NFT (Fractional NFT)
FME读写cass数据的方案及操作流程
php如何去除字符串最后一位字符
Shell脚本的概念
服务器装好系统的电脑怎么分区
【AGC】开放式测试示例









