Skip to content
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

华为获取报错 Lcom/huawei/hms/ads/identifier/AdvertisingIdClient #67

Closed
houkhan opened this issue Aug 11, 2023 · 6 comments
Closed

Comments

@houkhan
Copy link

houkhan commented Aug 11, 2023

错误信息
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/huawei/hms/ads/identifier/AdvertisingIdClient;
at com.github.gzuliyujiang.oaid.impl.HuaweiImpl.doGet(HuaweiImpl.java:66)
at com.github.gzuliyujiang.oaid.DeviceID.getOAID(DeviceID.java:127)
at com.nextjoy.star.main.activity.SplashActivity.initOaid(SplashActivity.kt:114)
at com.nextjoy.star.main.activity.SplashActivity.getPermission(SplashActivity.kt:89)
at com.nextjoy.star.main.activity.SplashActivity.initViewDate(SplashActivity.kt:85)
at com.nextjoy.star.main.activity.SplashActivity.initView(SplashActivity.kt:76)
at com.nextjoy.base.activity.BaseActivity.onCreate(BaseActivity.kt:44)
at com.nextjoy.star.main.activity.SplashActivity.onCreate(SplashActivity.kt:41)

我的gradle配置如下
// OAID
implementation(deps.OAIDHelper) {
// 排除掉本项目依赖的华为官方广告标识服务SDK
// 也即是使用移动安全联盟SDK依赖的华为官方广告标识服务SDK
exclude group: 'com.huawei.hms', module: 'ads-identifier'
}

@liyujiang-gzu
Copy link
Member

java.lang.NoClassDefFoundError:

你没有使用移动安全联盟SDK,无需排除华为官方广告标识服务SDK,去掉exclude group: 'com.huawei.hms', module: 'ads-identifier'

@liupe
Copy link

liupe commented Aug 18, 2023

移动安全联盟SDK有新版本集成了华为最新的官方广告标识服务SDK吗?我们的移动安全联盟sdk版本用的华为sdk还是旧的,跟华为官方的广告标识服务sdk版本冲突了。

@daquanzheng
Copy link

我也发生了以上问题 用二楼的方法移除exclude部分,发生编译错误 Failed to resolve: com.huawei.hms:ads-identifier:3.4.62.300错误,暂时不知道如何解决。

@liyujiang-gzu
Copy link
Member

我也发生了以上问题 用二楼的方法移除exclude部分,发生编译错误 Failed to resolve: com.huawei.hms:ads-identifier:3.4.62.300错误,暂时不知道如何解决。

点击 file -> invalid caches and restart 试试

@liyujiang-gzu
Copy link
Member

我也发生了以上问题 用二楼的方法移除exclude部分,发生编译错误 Failed to resolve: com.huawei.hms:ads-identifier:3.4.62.300错误,暂时不知道如何解决。

不排除华为SDK,若出现Failed to resolve: com.huawei.hms...,添加华为SDK仓库试试:

    repositories {
        maven {url 'https://developer.huawei.com/repo/'}
    }

@daquanzheng
Copy link

@liyujiang-gzu 问题得到解决 非常感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants