Unity 整合 Google Ads 插件
环境为Unity 2020.1.4f1c1
Windows 10
步骤为
1下载最新google ads插件 Release Google Mobile Ads Unity Plugin v5.3.0 · googleads/googleads-mobile-unity
2导入下载到的插件到unity
3设置java_home变量为unity安装时自带的jdk路径如
C:\Program Files\Unity\Hub\Editor\2020.1.4f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
4重新启动电脑
5在菜单Assets-External Dependecy Mananger-Android Resolver中执行Force Resolve或者Resolve
6如果不成功,可以尝试vpn或者设置代理,重新Resolve,等待Resolve完成
7其余步骤可以参考,google ads 说明(参考文档1)
常见问题
1在iOS中,需要Cocoapods来整合插件,生成.xcworkspace文件,安装Cocoapods使用命令 sudo gem install cocoapods -n /usr/local/bin
2如果安装Cocoapods后,在更新版本时候,出现无法生成.xcworkspace文件的情况,先删除Cocoapods,然后重新安装, 删除命令 sudo gem uninstall cocoapods,如果提示错误
You don't have write permissions for the /usr/bin directory
将删除命令也加上-n后缀sudo gem uninstall cocoapods -n /usr/local/bin即可
参考文档
配置JAVA_HOME_追风者-CSDN博客
页:
[1]