【Unity】Attribute meta-data#com.google.android.play.billingclient.version 多版本库冲突

一、背景

1、Unity 2021.3.9f1
2、Max由6.0.1至最新版本6.1.0

二、问题描述

  1. 错误信息

Attribute meta-data#com.google.android.play.billingclient.version@value value=(6.1.0) from [com.android.billingclient:billing:6.1.0] AndroidManifest.xml:21:13-34
is also present at [:billing-5.2.1:] AndroidManifest.xml:25:13-34 value=(5.2.1).
Suggestion: add ‘tools:replace=“android:value”’ to element at AndroidManifest.xml:19:9-21:37 to override.
* What went wrong:
Execution failed for task ‘:launcher:processReleaseMainManifest’.
Manifest merger failed with multiple errors, see logs

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

三、解决方案

  1. 原因:

Max聚合安装了多个广告源,不确定是哪个广告的SDK依赖更高版本结算库,导致SDK依赖和IAP依赖冲突

  1. 解决方法
    (1)勾选Custom Main Gradle Template在这里插入图片描述
    (2)打开Assets/Plugins/Android/maintemplate.gradle,在dependencies依赖块里,添加如下设置,告知Gradle不要包含 Unity IAP 已包含的 billingclient 库。

dependencies {

// ** ADD THIS **
configurations.all {
exclude group: ‘com.android.billingclient’, module: ‘billing’}
}

  • 24
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值