如何在应用程序中同时拥有 Google 移动服务和华为移动服务?
由于华为已经失去了GMS的许可,看来我们需要用华为提供的服务替换应用程序中使用的所有GMS服务。什么是“最佳实践”?使用口味并以某种方式单独处理每个类,还是复制粘贴项目并开始替换?或者……更好的是,有没有办法同时拥有和……以某种方式让应用程序根据它所在的设备决定使用哪种服务?显然,最后一个假设APK文件大小增加。
有任何想法吗?
\n\n您的应用包含\xe2\x80\x99 不符合设备和\n网络滥用政策的内容。我们发现您的应用使用的是不合规\n版本的华为移动服务 SDK,其中包含从 Google Play 之外的未知来源下载\或安装应用程序的代码。
\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}\nRun Code Online (Sandbox Code Playgroud)\n\n\n在manifest.xml中添加了以下元数据
\n
<meta-data\n android:name="com.huawei.hms.ml.DEPENDENCY"\n android:value="imgseg" />\nRun Code Online (Sandbox Code Playgroud)\n 我正在尝试使用 Android Studio“制作项目”,但出现此错误:
任务“:myApp:processGoogleDebugManifest”执行失败。
无法获取类型为 com.android.build.gradle.tasks.ProcessMultiApkApplicationManifest 的任务“:myApp:processGoogleDebugManifest”的未知属性“manifestOutputDirectory”。
请问有什么帮助吗?
编辑:此错误发生在我更新到 gradle v6.5 和插件 v4.1.0 之后。如果我恢复到 gradle v6.1.1 和插件 v4.0.0,错误就会消失。
我正在使用华为的Push服务开发 Android 应用程序。我已经DevEco IDE在 Android Studio 中安装了插件。但是我没有任何Huawei设备可以测试。所以我的问题是是否有任何华为的 Android 手机模拟器适用于 Windows PC。所以,我可以测试和调试应用程序。提前致谢。
当我尝试更新我的应用程序时 - 在审核过程中出现错误。隐式 PendingIntent 漏洞的修复 - https://support.google.com/faqs/answer/10437428。在我的应用程序中,我正在创建 PendingIntent - 用于 Firebase 推送通知:
内部类 FCMService 扩展了 FirebaseMessagingService
@Override
public void onMessageReceived(@NotNull RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
Intent intent = new Intent(this, ApplicationActivity.class);
intent.setAction("com.google.firebase.MESSAGING_EVENT");
intent.setPackage(getApplicationContext().getPackageName());
Map<String, String> data = remoteMessage.getData();
for (Map.Entry<String, String> entry : data.entrySet()) {
String value = entry.getValue();
String key = entry.getKey();
if (key.equals(ApplicationActivity.LINK_URL) ||
key.equals(ApplicationActivity.FLOCKTORY_LINK_URL)) {
intent.putExtra(ApplicationActivity.FLOCKTORY_LINK_URL, value);
if (remoteMessage.getNotification() != null && remoteMessage.getNotification().getTitle() != null) {
intent.putExtra(ApplicationActivity.HMS_PUSH_TITLE, remoteMessage.getNotification().getTitle());
}
}
}
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, …Run Code Online (Sandbox Code Playgroud) java android google-play huawei-mobile-services huawei-push-notification
很快,新的华为手机将停止支持 Google Play 和 Google 移动服务。
华为正在准备自己的名为 HMS 的生态系统https://developer.huawei.com/consumer/en/service/hms/developer.html
他们的应用商店叫做“Huawei App Gallery”,这里有它的文档:https : //developer.huawei.com/consumer/en/doc/30202
他们现在正在向开发人员(包括我)发送消息,鼓励他们向他们的商店发布应用程序。他们声称他们只需要一个 APK 文件,不需要对应用程序进行任何更改。
我的问题是:
android google-play-services react-native huawei-mobile-services
一些华为移动设备没有 Google Play 商店,而是有华为 AppGallery。由于 Flutter 是用于跨平台开发(iOS 和 Android),因此可能需要通过华为 AppGallery 提出 Flutter 开发的应用程序。
没有Google Play Store的华为设备仍然使用Android,上传到Huawei AppGallery的应用程序必须有apk扩展程序(就像在Google Play Store中一样)。这些预感至少可以在华为 AppGallery 上提出一些 Google Play Store 应用程序。但是,我没有找到任何证据或确认。这种兼容性也没有任何明确的边界。例如,由于技术或法律原因,某些服务可能无法在华为应用市场上运行或不被接受。这个边界的一部分是使用 Flutter 来开发应用程序。
那么,我的问题是,Flutter 开发的应用程序是否可以与华为应用程序库兼容,如果可以,在什么条件下?
首次应用发布后编辑 2020 04 13
我的第一个 Flutter 应用刚刚发布在华为应用市场。这回答了问题的第一部分。尽管如此,由于这个应用程序非常简约,这并没有回答最重要的部分,即:在什么情况下 Flutter 应用程序可以在华为应用程序市场上发布?
我想知道是否有任何有效的方法可以使用 Android Studio 模拟器测试华为商店的应用程序。
我尝试禁用 Google Play 服务,但由于某种原因改造请求停止工作:/
Android 的所有 Firebase 服务都无法在华为上运行还是只是云消息服务不起作用?所有的 Firebase 服务都依赖于 Google Play 服务吗?
firebase google-play-services firebase-realtime-database firebase-remote-config huawei-mobile-services
android ×9
google-play ×2
react-native ×2
apk ×1
appgallery ×1
firebase ×1
flutter ×1
java ×1
retrofit ×1