标签: huawei-developers

华为移动服务 SDK 违反设备和网络滥用政策

\n

您的应用包含\xe2\x80\x99 不符合设备和\n网络滥用政策的内容。我们发现您的应用使用的是不合规\n版本的华为移动服务 SDK,其中包含从 Google Play 之外的未知来源下载\或安装应用程序的代码。

\n
\n

我正在使用华为移动服务SDK来实现自动橡皮擦。

\n
\n

使用的依赖项列表

\n
\n
implementation 'com.huawei.hms:ml-computer-vision-segmentation:3.0.0.301'\nimplementation 'com.huawei.hms:ml-computer-vision-image-segmentation-body-model:2.0.2.300'\n\n\nbuildscript {\n    repositories {\n        mavenCentral()\n        jcenter()\n        google()\n        maven {url 'http://developer.huawei.com/repo/'}\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:4.2.2'\n\n        //Auto eraser\n        classpath 'com.huawei.agconnect:agcp:1.3.1.300'\n    }\n}\n
Run Code Online (Sandbox Code Playgroud)\n
\n

在manifest.xml中添加了以下元数据

\n
\n
<meta-data\n    android:name="com.huawei.hms.ml.DEPENDENCY"\n    android:value="imgseg" />\n
Run Code Online (Sandbox Code Playgroud)\n

android huawei-mobile-services huawei-developers

37
推荐指数
3
解决办法
1万
查看次数


华为推送-com.huawei.hms.common.ApiException: 6003: 证书指纹错误

我收到“推送令牌失败,com.huawei.hms.common.ApiException:6003:证书指纹错误”。我不知道这里发生了什么事。

huawei-mobile-services huawei-developers huawei-push-notification

9
推荐指数
1
解决办法
6398
查看次数

com.huawei.agconnect 插件未找到

所以我尝试使用新的 Kotlin DSL 语法将 AppGallery connect gradle 插件添加到我的 android 项目中。但我收到这样的错误:

org.gradle.internal.exceptions.LocationAwareException: Build file 'D:\#KERJAAN\devbase\sample\build.gradle.kts' line: 3
Plugin [id: 'com.huawei.agconnect', version: '1.6.3.300'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.huawei.agconnect:com.huawei.agconnect.gradle.plugin:1.6.3.300')
  Searched in the following repositories:
    Gradle Central Plugin Repository
    Google
    MavenRepo
    maven(https://developer.huawei.com/repo/)
Run Code Online (Sandbox Code Playgroud)

我所做的就是为这样的插件添加存储库settings.gradle.kts

org.gradle.internal.exceptions.LocationAwareException: Build file 'D:\#KERJAAN\devbase\sample\build.gradle.kts' line: 3
Plugin [id: 'com.huawei.agconnect', version: '1.6.3.300'] was not found in any …
Run Code Online (Sandbox Code Playgroud)

android gradle huawei-mobile-services huawei-developers appgallery-connect

9
推荐指数
1
解决办法
9337
查看次数

华为应用签名导出和上传密钥和证书

我想将我的应用程序上传到华为应用程序库。我被困在应用程序签名过程中。

要执行应用签名,您需要选择以下两个选项之一:

  1. 让 AppGallery Connect 为您创建和管理应用签名(推荐且仅适用于新应用发布)
  2. 导出和上传密钥和证书

不幸的是,华为应用程序库中的说明告诉您Obtain the pepk.jar file from the Internet or another legitimate source.但没有提供可以下载 PEPK 工具 (pepk.jar) 的链接。

在哪里可以找到下载该工具的“合法渠道”?

编辑:华为应用程序库说明供参考

  1. 通过互联网或其他合法渠道获取pepk.jar文件。
  2. 运行以下命令将您的私钥和公钥证书导出并加密到 ZIP 文件中。必须根据需要替换粗体参数。然后,根据提示输入您的存储位置和密钥密码。
java -jar pepk.jar --keystore test.jks --alias test --output=output.zip --encryptionkey=<some-encryption-key> --include-cert
Run Code Online (Sandbox Code Playgroud)
  1. 上传包含私钥和公钥证书的 ZIP 文件。(ZIP 文件仅包含 certificate.pem 和 encryptedPrivateKey。)

第二个编辑:Google播放PEPK
在谷歌播放应用程序签名时,他们提供了一个链接: Pepk工具Pepk工具源代码

android android-app-signing app-signing huawei-developers

8
推荐指数
1
解决办法
4808
查看次数

HmsMessageService onMessageReceived 未调用

我实现了华为Push Kit。onNewToken 在应用程序启动后调用。我想使用 onMessageReceived。

当我向客户端发送推送通知时,推送通知出现在 android 上,但 onMessageReceived 未触发。

我将以下代码添加到 Android Manifest

    <service
        android:name=".HmsMessageSrv"
        android:enabled="true" android:exported="false">
        <intent-filter>
            <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <meta-data
        android:name="push_kit_auto_init_enabled"
        android:value="true" />
Run Code Online (Sandbox Code Playgroud)

我的简单课程是;

public class HmsMessageSrv extends HmsMessageService {

    @Override
    public void onNewToken(String s) {
        super.onNewToken(s);
        Log.i("HmsMessageService", s);
    }

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);
        Log.i("HmsMessageService", "onMessageReceived");
    }
}
Run Code Online (Sandbox Code Playgroud)

如何在收到推送通知时触发 onMessageReceived 函数。

android push-notification huawei-mobile-services huawei-developers huawei-push-notification

8
推荐指数
1
解决办法
2523
查看次数

华为 AppGallery Connect API - 403 客户端令牌授权失败

我正在尝试使用链接中提到的 REST API 将应用程序发布过程自动化到华为商店。 https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agcapi-overview

我成功收到访问令牌,但其他操作(例如:获取应用信息、获取上传 URL)失败并显示以下状态代码和错误。

403 client token authorization fail.
Run Code Online (Sandbox Code Playgroud)

我没有写任何代码,我只是使用了下面的示例代码并更新了 clientId、clientSecret、appId。

https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Examples/agcapi-publish_api_code

什么可能出错?有人可以帮忙吗?

android huawei-mobile-services appgallery huawei-developers

7
推荐指数
2
解决办法
844
查看次数

是否可以从用户代理中识别华为设备是否不支持谷歌服务?

我想在我的 Google Analytics 中检查我的用户群中有多大比例使用华为设备,这些设备不再使用谷歌服务,而是使用应用程序库等。

我想知道我是否可以在用户代理等中查找特定的操作系统版本?

user-agent google-analytics huawei-mobile-services huawei-developers

7
推荐指数
1
解决办法
3936
查看次数

如何在flutter中检测华为设备型号和其他android型号?

由于我的应用程序是跨平台的,所以不会遇到任何问题,但是当涉及到android时,会出现一些问题,例如华为移动设备不再能够访问google play,并且它们有自己的应用程序商店(App Gallery),问题出现是因为我的应用程序的规格之一是强制用户下载最新版本,我不知道如何检测华为设备以让用户直接从应用程序库下载我的应用程序。

mobile android flutter huawei-mobile-services huawei-developers

7
推荐指数
2
解决办法
4263
查看次数

Agconnect - API“android.registerTransform”已删除

迁移到 gradle 8.x 后,我无法构建应用程序,因为最新的华为 AppGallery 依赖项 com.huawei.agconnect:agcp:1.9.0.300仍然与 gradle 8 不兼容。

那么除了恢复到 gradle 7 之外还有其他解决方案吗?

A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.huawei.agconnect'.
   > API 'android.registerTransform' is removed.

     For more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.
     To determine what is calling android.registerTransform, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Run Code Online (Sandbox Code Playgroud)

android huawei-developers

7
推荐指数
2
解决办法
1690
查看次数