打包时AF-Android-SDK.jar引起的错误

Unity摊
d8: type `com.huawei.hms.pps.advertisingidclient` was not found, it is required for default or static interface methods desugaring of `java.lang.string com.appsflyer.internal.ag.ˏ(android.content.context)`
d8: type `com.appsflyer.oaidclient` was not found, it is required for default or static interface methods desugaring of `java.util.map com.appsflyer.appsflyerlibcore.ˎ(com.appsflyer.afevent)`

原因: appsflyer sdk中用了上面相关的类, 但没有引入类库, 网上和官网又搜不到.

解决: mainTemplate.gradle添加如下代码(关于禁用d8可自行google):
([rootProject] + (rootProject.subprojects as List)).each {
    ext {
        it.setProperty("android.enableR8.desugaring", false)
    }
}

你可能感兴趣的:(打包时AF-Android-SDK.jar引起的错误)