-
-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
华为鸿蒙4.0手机不能使用DeviceIdentifier.getOAID(this);方法 #86
Comments
目测是华为的SDK没打包进去 |
也有可能混小问题,华为SDK被混淆了,找不到相关类:-keep class com.hihonor.ads.** {; } 和 -keep interface com.huawei.hms.** {;} |
本库模块专用的混淆规则(注:“repeackage”拼写是历史遗留问题) -keep class repeackage.com.uodis.opendevice.aidl.** { ; } -keep interface repeackage.com.uodis.opendevice.aidl.* { ; } -keep class repeackage.com.asus.msa.SupplementaryDID.* { ; } -keep interface repeackage.com.asus.msa.SupplementaryDID.* { ; } -keep class repeackage.com.bun.lib.* { ; } -keep interface repeackage.com.bun.lib.* { ; } -keep class repeackage.com.heytap.openid.* { ; } -keep interface repeackage.com.heytap.openid.* { ; } -keep class repeackage.com.samsung.android.deviceidservice.* { ; } -keep interface repeackage.com.samsung.android.deviceidservice.* { ; } -keep class repeackage.com.zui.deviceidservice.* { ; } -keep interface repeackage.com.zui.deviceidservice.* { ; } -keep class repeackage.com.coolpad.deviceidsupport.* { ; } -keep interface repeackage.com.coolpad.deviceidsupport.* { ; } -keep class repeackage.com.android.creator.* { ; } -keep interface repeackage.com.android.creator.* { ; } -keep class repeackage.com.google.android.gms.ads.identifier.internal.* { ; } -keep interface repeackage.com.google.android.gms.ads.identifier.internal. { ; } -keep class repeackage.com.oplus.stdid.* {; } -keep interface repeackage.com.oplus.stdid.** {; } -keep class com.huawei.hms.ads.** {; } -keep interface com.huawei.hms.ads.** {; } -keep class com.hihonor.ads.** {; } -keep interface com.hihonor.ads.** {; } -keep class repeackage.com.qiku.id.** { ; } -keep interface repeackage.com.qiku.id.* { *; } |
|
是需要在混淆文件里把这两行去掉吗? |
但是试了下作者提供的安装包,或者直接用源码编译,又什么问题没有,直接就可以获取到,只要即成到自己的项目里就会出问题。只有华为和荣耀是这样,其它手机没问题。 |
是要加入,keep表示不混淆 |
检查下是不是华为和荣耀的SDK运行时依赖被排除了,没打包进去 |
我用的不是原生安卓项目,是在uniapp-X项目里面引用这个库,还不知道怎么排查 |
implementation ('com.github.gzu-liyujiang:Android_CN_OAID:4.2.9', {\r\nexclude group: 'com.huawei.hms', module: 'ads-identifier'\r\nexclude group: 'com.hihonor.mcs', module: 'ads-identifier'\r\nrepositories { maven { url 'https://developer.huawei.com/repo' } }\r\nruntimeOnly 'com.huawei.hms:ads-identifier:3.4.62.300'\r\nrepositories { maven { url 'https://developer.hihonor.com/repo' } }\r\nruntimeOnly 'com.hihonor.mcs:ads-identifier:1.0.2.301'\r\n}) 你这个配置好像有问题,估计是没依赖到华为荣耀的SDK |
唉,终于搞定了,感谢作者 |
是啥解决方案 |
就是没依赖到荣华SDK,直接把离线把aar扔进去就完事了 |
1 similar comment
就是没依赖到荣华SDK,直接把离线把aar扔进去就完事了 |
哪里有离线aar |
官方明确不提供离线下载的,需要自己想办法搞到。我的办法就是建一个demo,按官方的指引进行集成,然后在本机gradle某个缓存目录下会缓存下这个aar,把它复制出来就行了。实在找不到的话,留个邮箱,我发你一份也行。 |
你好大佬,求发一份。。找了半天没找到,我也遇到同样问题。[email protected] |
[email protected] 麻烦发份,谢谢... |
[email protected] 谢谢大佬! |
[email protected] 需要一份,谢谢大佬。 |
[email protected] 需要一份,谢谢大佬。 |
一使用这个方法就报错:
Didn't find class "com.huawei.hms.ads.identifier.AdvertisingIdClient" on path: DexPathList
Failed resolution of: Lcom/huawei/hms/ads/identifier/AdvertisingIdClient;
其它方法都正常,唯独oaid的两个报错。
build.gradle配置如下:
implementation ('com.github.gzu-liyujiang:Android_CN_OAID:4.2.9', {\r\nexclude group: 'com.huawei.hms', module: 'ads-identifier'\r\nexclude group: 'com.hihonor.mcs', module: 'ads-identifier'\r\nrepositories { maven { url 'https://developer.huawei.com/repo' } }\r\nruntimeOnly 'com.huawei.hms:ads-identifier:3.4.62.300'\r\nrepositories { maven { url 'https://developer.hihonor.com/repo' } }\r\nruntimeOnly 'com.hihonor.mcs:ads-identifier:1.0.2.301'\r\n})
The text was updated successfully, but these errors were encountered: