36

Your app contains content that doesn’t comply with the Device and Network Abuse policy. We found your app is using a non-compliant version of Huawei Mobile Services SDK which contains code to download or install applications from unknown sources outside of Google Play.

I am using Huawei Mobile Services SDK for Auto Eraser.

List of used dependency

implementation 'com.huawei.hms:ml-computer-vision-segmentation:3.0.0.301'
implementation 'com.huawei.hms:ml-computer-vision-image-segmentation-body-model:2.0.2.300'


buildscript {
    repositories {
        mavenCentral()
        jcenter()
        google()
        maven {url 'http://developer.huawei.com/repo/'}
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.2'

        //Auto eraser
        classpath 'com.huawei.agconnect:agcp:1.3.1.300'
    }
}

Added below meta data in manifest.xml

<meta-data
    android:name="com.huawei.hms.ml.DEPENDENCY"
    android:value="imgseg" />
VIISHRUT MAVANII
  • 11,410
  • 7
  • 34
  • 49
  • hi@VIISHRUT MAVANII, Could you please leave your appId? Let me check the info to see the problem. – zhangxaochen Mar 17 '22 at 07:46
  • and may i confirm have you configured the following metadata in your app? `````` – zhangxaochen Mar 17 '22 at 07:53
  • @shirley I am using it without appId. – VIISHRUT MAVANII Mar 17 '22 at 08:15
  • yes@VIISHRUT MAVANII, but before reporting to R&D team, we need to confirm your app ID, app package name, and whether above metadata is configured. Then we will record the information and report it to R&D team to fix it. – zhangxaochen Mar 17 '22 at 09:14
  • 1
    @shirley That's True! but during the whole implementation, SDK didn't ask me for any API key. It is working without any registration. I have followed this blog https://medium.com/huawei-developers/build-a-background-eraser-app-with-huawei-ml-kit-image-segmentation-52208a7471ee – VIISHRUT MAVANII Mar 17 '22 at 09:28
  • Or do you know your app package name? You can refer to this [link](https://developer.huawei.com/consumer/en/doc/distribution/app/agc-help-appinfo-0000001100014694?ha_source=hms1). After a project is created on AppGallery Connect, you can obtain your developer ID, the client ID, and app information including the app ID. – zhangxaochen Mar 17 '22 at 09:44
  • 1
    We received the same warning from google play today. Could it be an issue with the version of com.huawei.agconnect? – GareDeveloper Mar 17 '22 at 09:48
  • @GareDeveloper, We are very sorry that it brings you inconvinience and are now investigating the root cause of it. Could you mind leave your APPID, app name and package name? and just to confirm, whether configured the following metadata in your app? `` – zhangxaochen Mar 17 '22 at 09:58
  • No in our manifest there isn't configured such meta-data. Can you explain why is needed? I retrieve the documentation and the problem could be that, as default, the flag is true and the Play Store recognizes the HMS SDK as dangerous? – GareDeveloper Mar 17 '22 at 10:29
  • 1
    We also received the same warning today. Why this issue popped up? Any solution? @shirley – Utku Altaş Mar 17 '22 at 10:34
  • @UtkuAltaş sorry, we are now investigating the root cause of it, and will provide a solution as soon as possible. BTW, to better address this issue, could you provide the information that I consulted above? Your appId, etc. – zhangxaochen Mar 17 '22 at 10:41
  • 1
    we got same issue from Play store. I suspect that HMS downloads and installs third app. Because a few days ago, some strange apps were available in my phone even though I didn't install those app and a notification said that x app installed from y(our app) app – Abdullah Mar 17 '22 at 11:45
  • 1
    Same issue here, I don't know what should I do :( I'm using Huawei ML kit for too many apps – Mouaad Abdelghafour AITALI Mar 17 '22 at 13:05
  • 1
    Same issue here. We don't have the metadata mentioned in our app. Any idea why we need that? Here's our app: https://appgallery.huawei.com/app/C100433473 – waseefakhtar Mar 17 '22 at 13:07
  • 1
    Hello, I can confirm we have the same issue. We use the following libraries : - MapKit - LocationKit - ScanKit - PushKit - HiAnalytics – John Thiriet Mar 17 '22 at 18:53
  • 1
    hi@waseefakhtar, Your request has been received. We are aware of this issue and are currently investigating. Your application experience won't be affected at this time and we will continue to update you on solutions. Thanks for your understanding and support. – zhangxaochen Mar 18 '22 at 01:50
  • 3
    You can follow the conversation on the Huawei dev forums here: https://developer.huawei.com/consumer/cn/forum/topic/0201829890037360002?fid=18 it appears the team has acknowledge the issue and is working towards a resolution. – bJacoG Mar 18 '22 at 07:11
  • Hello, still no update on the Huawei forum. Furthermore, reading chinese is not easy for everyone :-) Is there a status somewhere ? – John Thiriet Mar 22 '22 at 09:49
  • Hey @shirley, can you explain what `` exactly does if set to `true` and what it does if set to `false`. It's not quite clear for me from the Configuring Metadata section in [this documentation](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/as-integration-hms-core-sdk-0000001050436235). Thanks in advance – Vall0n Mar 22 '22 at 11:11
  • 1
    hi@Vall0n , This is a key-value pair. Do not change it to `true`. Define it based on the integration in the document. `ActivityInfo actInfo = mContext.getPackageManager().getActivityInfo( getComponentName(), PackageManager.GET_META_DATA); String msg = actInfo.metaData.getString("com.huawei.hms.client.channel.androidMarket"); `The default value `false` is used in the SDK. If the value is changed to`true`, the value cannot be matched. – zhangxaochen Mar 23 '22 at 02:53
  • I received the same message today from Google. Now i have 120 days to delete this library from my app. What should we do now Huawei? Using this library to check is Huawei services available on device or not: implementation 'com.huawei.hms:base:6.4.0.300' – Andrey M. Mar 17 '22 at 16:55
  • Hey @shirley, thanks for the fast response! And what is the purpose of this key-value pair? I run the code on a pixel 5 and a Huawei CDY-NX9A but the value of `com.huawei.hms.client.channel.androidMarket` was always null. – Vall0n Mar 23 '22 at 07:57
  • Facing same issue even in 2023 with all latest SDK. – neobie Jan 16 '23 at 13:55

6 Answers6

10

Update:

Note: If you have confirmed that the latest SDK version is used, before submitting a release to Google, please check the apks in all Testing track on Google Play Console(including Open testing, Closed testing, Internal testing). Ensure that the APKs on all tracks(including paused track) have updated to the latest HMS Core SDK.


HMS Core SDKs have undergone some version updates recently. To further improve user experience, update the HMS Core SDK integrated into your app to the latest version.

HMS Core SDK Version Link
Keyring com.huawei.hms:keyring-credential:6.4.0.302 Link
Location Kit com.huawei.hms:location:6.4.0.300 Link
Nearby Service com.huawei.hms:nearby:6.4.0.300 Link
Contact Shield com.huawei.hms:contactshield:6.4.0.300 Link
Video Kit com.huawei.hms:videokit-player:1.0.12.300 Link
Wireless kit com.huawei.hms:wireless:6.4.0.202 Link
FIDO com.huawei.hms:fido-fido2:6.3.0.304
com.huawei.hms:fido-bioauthn:6.3.0.304
com.huawei.hms:fido-bioauthn-androidx:6.3.0.304
Link
Panorama Kit com.huawei.hms:panorama:5.0.2.308 Link
Push Kit com.huawei.hms:push:6.5.0.300 Link
Account Kit com.huawei.hms:hwid:6.4.0.301 Link
Identity Kit com.huawei.hms:identity:6.4.0.301 Link
Safety Detect com.huawei.hms:safetydetect:6.4.0.301 Link
Health Kit com.huawei.hms:health:6.5.0.300 Link
In-App Purchases com.huawei.hms:iap:6.4.0.301 Link
ML Kit com.huawei.hms:ml-computer-vision-ocr:3.6.0.300
com.huawei.hms:ml-computer-vision-cloud:3.5.0.301
com.huawei.hms:ml-computer-card-icr-cn:3.5.0.300
com.huawei.hms:ml-computer-card-icr-vn:3.5.0.300
com.huawei.hms:ml-computer-card-bcr:3.5.0.300
com.huawei.hms:ml-computer-vision-formrecognition:3.5.0.302
com.huawei.hms:ml-computer-translate:3.6.0.312
com.huawei.hms:ml-computer-language-detection:3.6.0.312
com.huawei.hms:ml-computer-voice-asr:3.5.0.301
com.huawei.hms:ml-computer-voice-tts:3.6.0.300
com.huawei.hms:ml-computer-voice-aft:3.5.0.300
com.huawei.hms:ml-computer-voice-realtimetranscription:3.5.0.303
com.huawei.hms:ml-speech-semantics-sounddect-sdk:3.5.0.302
com.huawei.hms:ml-computer-vision-classification:3.5.0.302
com.huawei.hms:ml-computer-vision-object:3.5.0.307
com.huawei.hms:ml-computer-vision-segmentation:3.5.0.303
com.huawei.hms:ml-computer-vision-imagesuperresolution:3.5.0.301
com.huawei.hms:ml-computer-vision-documentskew:3.5.0.301
com.huawei.hms:ml-computer-vision-textimagesuperresolution:3.5.0.300
com.huawei.hms:ml-computer-vision-scenedetection:3.6.0.300
com.huawei.hms:ml-computer-vision-face:3.5.0.302
com.huawei.hms:ml-computer-vision-skeleton:3.5.0.300
com.huawei.hms:ml-computer-vision-livenessdetection:3.6.0.300
com.huawei.hms:ml-computer-vision-interactive-livenessdetection:3.6.0.301
com.huawei.hms:ml-computer-vision-handkeypoint:3.5.0.301
com.huawei.hms:ml-computer-vision-faceverify:3.6.0.301
com.huawei.hms:ml-nlp-textembedding:3.5.0.300
com.huawei.hms:ml-computer-ner:3.5.0.301
com.huawei.hms:ml-computer-model-executor:3.5.0.301
Link
Analytics Kit com.huawei.hms:hianalytics:6.5.0.300 Link
Dynamic Tag Manager com.huawei.hms:dtm-api:6.5.0.300 Link
Site Kit com.huawei.hms:site:6.4.0.304 Link
HEM Kit com.huawei.hms:hemsdk:1.0.4.303 Link
Map Kit com.huawei.hms:maps:6.5.0.301 Link
Wallet Kit com.huawei.hms:wallet:4.0.5.300 Link
Awareness Kit com.huawei.hms:awareness:3.1.0.302 Link
Crash com.huawei.agconnect:agconnect-crash:1.7.0.300 Link
APM com.huawei.agconnect:agconnect-apms:1.5.2.310 Link
Ads Kit com.huawei.hms:ads-prime:3.4.55.300 Link
Paid Apps com.huawei.hms:drm:2.5.8.301 Link
Base com.huawei.hms:base:6.4.0.303

Required versions for cross-platform app development:

Platform Plugin Name Version Link
React Native react-native-hms-analytics 6.3.2-301 Link
react-native-hms-iap 6.4.0-301 Link
react-native-hms-location 6.4.0-300 Link
react-native-hms-map 6.3.1-304 Link
react-native-hms-push 6.3.0-304 Link
react-native-hms-site 6.4.0-300 Link
react-native-hms-nearby 6.2.0-301 Link
react-native-hms-account 6.4.0-301 Link
react-native-hms-ads 13.4.54-300 Link
react-native-hms-adsprime 13.4.54-300 Link
react-native-hms-availability 6.4.0-303 Link
Cordova
(Ionic-Cordova
Ionic-Capacitor)
cordova-plugin-hms-analytics
ionic-native-hms-analytics
6.3.2-301 Link
cordova-plugin-hms-location
ionic-native-hms-location
6.4.0-300 Link
cordova-plugin-hms-nearby
ionic-native-hms-nearby
6.2.0-301 Link
cordova-plugin-hms-account
ionic-native-hms-account
6.4.0-301 Link
cordova-plugin-hms-push
ionic-native-hms-push
6.3.0-304 Link
cordova-plugin-hms-site
ionic-native-hms-site
6.4.0-300 Link
cordova-plugin-hms-iap
ionic-native-hms-iap
6.4.0-301 Link
cordova-plugin-hms-availability
ionic-native-hms-availability
6.4.0-303 Link
cordova-plugin-hms-ads
ionic-native-hms-ads
13.4.54-300 Link
cordova-plugin-hms-adsprime
ionic-native-hms-adsprime
13.4.54-300 Link
cordova-plugin-hms-map
ionic-native-hms-map
6.0.1-305 Link
cordova-plugin-hms-ml
ionic-native-hms-ml
2.0.5-303 Link
Flutter huawei_safetydetect 6.4.0+301 Link
huawei_iap 6.2.0+301 Link
huawei_health 6.3.0+302 Link
huawei_fido 6.3.0+304 Link
huawei_push 6.3.0+304 Link
huawei_account 6.4.0+301 Link
huawei_ads 13.4.55+300 Link
huawei_analytics 6.5.0+300 Link
huawei_map 6.5.0+301 Link
huawei_hmsavailability 6.4.0+303 Link
huawei_location 6.0.0+303 Link
huawei_adsprime 13.4.55+300 Link
huawei_ml 3.2.0+301 Link
huawei_site 6.0.1+304 Link
Xamarin Huawei.Hms.Hianalytics 6.4.1.302 Link
Huawei.Hms.Location 6.4.0.300 Link
Huawei.Hms.Nearby 6.2.0.301 Link
Huawei.Hms.Push 6.3.0.304 Link
Huawei.Hms.Site 6.4.0.300 Link
Huawei.Hms.Fido 6.3.0.304 Link
Huawei.Hms.Iap 6.4.0.301 Link
Huawei.Hms.Hwid 6.4.0.301 Link
Huawei.Hms.Ads-prime 3.4.54.302 Link
Huawei.Hms.Ads 3.4.54.302 Link
Huawei.Hms.Maps 6.5.0.301 Link

If you have any further questions or encounter any issues integrating any of these kits, please feel free to contact us.

Region Email
Europe developereu@huawei.com
Asia Pacific developerapac@huawei.com
Latin America developerla@huawei.com
Middle East & Africa developermea@huawei.com
Russia developer_ru@huawei.com
zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • I suppose this is the actual change that matters: Improved the capability of prompting users to install HMS Core (this is for In-App Purchases 6.4.0.301 and Identity Kit 6.4.0.301). – NewestStackOverflowUser Jun 02 '22 at 11:42
  • Did anyone tried the latest versions of the HMS SDK and submitted to the PlayStore ? We worked around the issue for the moment but I would be really interested on having a feedback. – John Thiriet Jun 22 '22 at 15:41
  • @nunoarruda i received mail today did you received too? or this workaround worked for you so I will upgrade as above if you haven't received mail today! – Kishan Soni Jul 15 '22 at 10:12
  • @shirey i recieved email from google "We found your app is using a non-compliant version of Huawei Mobile Services SDK which contains code to download or install applications from unknown sources outside of Google Play." Are you sure after upgrade as you suggest my issue will fixed? – Kishan Soni Jul 15 '22 at 10:15
  • I've deleted my previous comment. Yesterday I received another email from Google Play saying my app is not compliant again. I've reopened a GitHub issue related to that: https://github.com/HMS-Core/hms-cordova-plugin/issues/81 – nunoarruda Jul 15 '22 at 12:36
  • @KishanSoni nunoarruda Please check the apk in Testing Track on Google Play Console. Ensure that the APK on all channels are using of the latest HMS Core SDK version. – zhangxaochen Jul 18 '22 at 08:55
  • @JohnThiriet did you tried the latest versions and worked with you ? – Mahmoud Aly Oct 10 '22 at 11:00
  • We have decided to generate different builds for AppGallery and Google Play Store unfortunately. Therefore, we avoided the problem. – John Thiriet Nov 08 '22 at 15:27
5

If you have dependencies that can be replaced with Google compatible equivalent dependencies then this could be a possible solution to manage both in one code base.

Using app flavours I was able to separate my GMS and HMS dependencies. In your app level build.gradle file you can create product flavour like so

android {
    flavorDimensions "platforms"
    ...
    productFlavors {
        gms {
            dimension "platforms"
        }
        hms {
            dimension "platforms"
        }
    }
    ...
}

More on product flavors here. And then you can specify if a dependency should be part of the flavour by prefixing it to the keyword implementation under dependencies.

dependencies {
    ...
    gmsImplementation 'com.google.android.gms:play-services-maps:18.0.2'
    hmsImplementation 'com.huawei.hms:maps:5.0.0.300'
    ...
}

I then went a bit further by wrapping the usage of each dependency in a class that is available in both flavours but the implementation differs based on the dependency's requirements.

com.example.maps.MapImpl under src>hms>java
and
com.example.maps.MapImpl under src>gms>java

So I am free to use the wrapper class anywhere without worrying about the dependency mismatch.

The HMS dependency is no longer part of the GMS build variant so I would be able to upload that to the Google playstore.

Daniel
  • 611
  • 8
  • 20
2

I solved it by doing similar to what @Daniel has suggested to avoid such worries in the future:

  1. Create different product flavors in your app level Gradle file:
android {
    ...

    flavorDimensions 'buildFlavor'

    productFlavors {
        dev {
            dimension 'buildFlavor'
        }

        production {
            dimension 'buildFlavor'
        }


        huawei {
            dimension 'buildFlavor'
        }
    }
}
  1. Restrict the Huawei related dependencies so they're only available for Huawei product flavor:
    huaweiImplementation "com.huawei.hms:iap:3.0.3.300"
    huaweiImplementation "com.huawei.hms:game:3.0.3.300"
    huaweiImplementation "com.huawei.hms:hwid:5.0.1.301"
    huaweiImplementation "com.huawei.hms:push:5.0.0.300"
    huaweiImplementation "com.huawei.hms:hianalytics:5.0.3.300"
    huaweiImplementation "com.huawei.hms:location:5.0.0.301"
  1. Since dev and production flavors are not going to have Huawei dependencies now, you may get build errors for the Huawei related classes that you use in your app.

For that I create dummy classes with the same packages tree as Huawei, for instance:

app > src > dev > java > com > huawei > hms > analytics > HiAnalytics.kt

class HiAnalytics {

    companion object {

        @JvmStatic
        fun getInstance(context: Context): HiAnalyticsInstance {
            return HiAnalyticsInstance()
        }
    }
}
  1. This solves the Cannot resolve symbol error when trying to import Huawei classes in your main, dev, or production flavors and you can import those classes anywhere:
import com.huawei.hms.analytics.HiAnalytics

Now if you change the build variant to dev, you should have access to the dummy classes in your app. If you change it to huawei, you should be able to access the classes from Huawei dependencies.

waseefakhtar
  • 1,373
  • 2
  • 24
  • 47
1

UPDATE 06/04/2022

Huawei released a new version of their SDK : 3.4.0.300

3.4.0.300 (2022-03-04) New Features

  • Real-time translation: Added Afrikaans to the list of languages supported. (Note that this language is available only in Asia, Africa, and Latin America.)

Modified Features

  • Deleted the capability of prompting users to install HMS Core (APK).
  • Modified the SDK privacy and security statement. Updated the SDK
  • versions of all subservices.

For me, since I've migrated to Google ML Kit, I will wait till August, then I will switch back to Huawei ML Kit to make sure Google will not remove or suspend my apps.


Old answer :

I used to love the HMS ML kit, but because of this issue, I'm aware that Google will one day completely suspend my apps because I'm using HMS services, and even if Huawei fixes the issue, we'll have to wait 120 days to find out if we're safe.

In my case, I'm using the HMS Segmentation ML Kit. I've just switched to Google Selfie Segmentation ML. I will wait till 120 days have passed and see if the issue is still persisting for other developers. If not, I will switch back to the HMS Kit.

1

The solution to the problem is to update the dependencies like in this link.

With this update, the ability to prompt users to install HMS Core (APK) has been removed.

https://developer.huawei.com/consumer/en/doc/development/hmscore-common-Guides/hmssdk-kit-0000001050042513#section20948233203517

0

I just use hms push when upload to huawei. i fixed by commenting hms services in build.gradle and app/build.gradle when to upload to playstore. Then, I uncomment if upload to huawei.

//apply plugin: "com.huawei.agconnect"

apply plugin: 'com.google.gms.google-services'

//implementation 'com.huawei.hms:push:5.3.0.304'.  
Elikill58
  • 4,050
  • 24
  • 23
  • 45