Huawei Mobile Services SDK violation Device and Network Abuse policy

Viewed 6921

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" />
6 Answers

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

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.

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.

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.

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'.  
Related