3***@qq.com
3***@qq.com
  • 发布:2024-09-23 10:52
  • 更新:2024-10-03 17:57
  • 阅读:269

【报Bug】magicos获取oaid失败,使用荣耀官方sdk获取oaid自定义调试基座制作又报错

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 版本 Windows 11 专业版 版本号 23H2 安装日期 ‎2024/‎4/‎16 操作系统版本 22631.4169 体验 Windows Feature Experience Pack 1000.22700.1034.0

HBuilderX类型: 正式

HBuilderX版本号: 4.24

手机系统: Android

手机系统版本号: Android 14

手机厂商: 华为

手机机型: 荣耀magic3

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

参考华为 荣耀官方获取oaid方法:
https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/identifier-service-version-change-history-0000001050066927
https://developer.hihonor.com/cn/kitdoc?kitId=11030&navigation=guides&docId=intergrate.md

模块build中添加
api "com.huawei.hms:ads-identifier:3.4.62.300"
api 'com.hihonor.mcs:ads-identifier:1.0.2.301'

工程build中添加
maven { url 'https://developer.huawei.com/repo' }
maven { url 'https://developer.hihonor.com/repo' }

预期结果:

自定义基座打包成

实际结果:

打包报错

bug描述:

在使用plus.device.getOAID获取荣耀magic3手机oaid时,得到一串00,然后我改用华为和荣耀官网提供的获取oaid的sdk,然后使用Android Studio在真机上运行正常。
但是,在把插件放入hbuiderX 4.24版本进行真机测试,需要自定义调试基座,打包报错,如下:

  • What went wrong:
    Execution failed for task ':app:processReleaseGoogleServices'.

    File google-services.json is missing. The Google Services Plugin cannot function without it.

是否需要配置Firebase,获取google-services.json?

2024-09-23 10:52 负责人:无 分享
已邀请:
q***@126.com

q***@126.com

我也遇到了类似的错误, 有解决办法吗?

Caused by: org.gradle.api.GradleException: File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
[PackagePath]/app/src/release/google-services.json
[PackagePath]/app/src/google-services.json
[PackagePath]/app/src/Release/google-services.json
[PackagePath]/app/google-services.json

at com.google.gms.googleservices.GoogleServicesTask.action(GoogleServicesTask.java:119)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:236)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:221)

  • 3***@qq.com (作者)

    没有,官方根本不理会,不过你可以试试离线打包,就是稍微麻烦点

    2024-10-12 14:48

要回复问题请先登录注册