Unity接入穿山甲广告报错 You need to replace the BUAdSDK.bundle file with the x.x.x version

今天升级穿山甲广告遇到一些报错,使用的Unity SDK 版本是 V4.3.0.1 ,iOS SDK版本是4.3.0.3,使用的是手动接入的方式。

编译时先是出现两个报错分别是:

BUToUnitySplashAd.mm

 slot.splashButtonType = adSlot->splashButtonType == 2 ? BUSplashButtonType_DownloadBar:BUSplashButtonType_FullScreen;;

BUToUnityExpressSplashAd.mm 

  slot.splashButtonType = adSlot->splashButtonType == 2 ? BUSplashButtonType_DownloadBar:BUSplashButtonType_FullScreen;

应该是unity sdk 和ios sdk接口不一致导致。删掉上面的两行代码可以正常编译

编译成功运行Crash,出现如下报错:

​
Terminating app due to uncaught exception 'BUAdSDK.bundle Warning', reason: 'You need to replace the BUAdSDK.bundle file with the 4.3.0.3 version '

​

怀疑是sdk版本不一致导致的问题。去官方群询问历史版本的下载地址,官方客服没给,回复说请用最新版本。反馈了该问题后,对方给的解决方式是,Clean工程然后重新导入BUAdSDK.bundle。

查看了Xcode工程的Frameworks/UnionPlatform/Plugins/iOS文件夹,发现BUAdSDK.bundle确实没有导入该文件。于是手动复制到该文件夹,并添加到工程中,之后可以成功运行。

所以问题就是,为什么这个文件没有成功导入到Xcode工程中。

 在Unity中点击BUAdSDK.bundle查看Inspector。Inspector显示空白,重新import,发现是其他Editor脚本报错。处理后再次import,Inspector显示正常,发现Select platforms for plugin并没有选中iOS平台。选中iOS平台之后再次导出工程,就可以正常运行了。

猜你喜欢

转载自blog.csdn.net/shaobing32/article/details/123357635