[HMS Core] Fusion Search cannot open the search service connection problem

 【keyword】

HMS, search service, fusion search

【Problem Description】

Some developers reported that when integrating the search service - fusion search, there was a problem that the search service connection could not be opened.

Strictly follow the official document integration, configuration, permissions have been added

searchServiceAbility .connect(new ServiceConnectCallback() {

   @Override

   public void onConnect() {

       // ALL

Log.i("SearchServiceAbility","SearchServiceAbility onConnect");

   }

   @Override

   public void onDisconnect() {

Log.i("SearchServiceAbility","SearchServiceAbility onDisconnect");

   }

});

The error log is as follows:

2023-07-12 17:24:57.390 5625-5625 HwSearchService: Client pid-5625 E [main]: SearchServiceAbility: Failed to open search service connection.

【problem analysis】

1. At first, it was thought that the permission of cp was not added correctly, and the integration of the integrated search service needs to add the following permission in AndroidManifest.xml. There is no problem in the normal situation during the test. If this permission is turned off, the same problem as cp will appear.

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<uses-permission android:name="ohos.permission.ACCESS_SEARCH_SERVICE"/>

cke_1044.png

But cp feedback that the permissions are added correctly, and the AndroidManifest.xml file is provided, which is indeed correct. Troubleshoot this error.

【solution】

Finally, it was found that the problem was caused by the fact that agconnect-services.json was not associated with the agconnect plug-in. Solve the problem first by using local associations.

cke_2822.png

【expand】

Fusion Search Donation Data Types:

cke_6089.png

Guess you like

Origin blog.csdn.net/Mayism123/article/details/132036365