UniwebView Recompile
现在项目接入UniwebView同时需要接入其他SDk,所以这里记录一下UniwebView的重编译过程。仅供参考。有点东西想吐槽,这个插件是中国人写的但是文档并不友好。最后呼吁支持正版,花点钱支持一下这个项目。哈哈
解决方案如下
- 解压 Assets/UniWebView/Source.zip 下脚本,复制到新工程中
因为采用AndroidStudio Labrary打包的方式所以可以直接导出 aar的包,省去了很多麻烦。最终的unity工程直接添加aar进行编译
在Unity工程中的Build.Gradle脚本的
dependencies
下添加:1
compile(name: 'uniwebview-release', ext: 'aar')
删除在unity工程的libs下与aar之中重复的jar包。
题外话
- You need the SDK of Android installed. Please refer to the Android developer site for more information.
- You need Apache Ant installed to compile java from command line. This tool is installed on Mac by default, you can run which ant in terminal to confirm if it is installed. If not, please refer to this post or the ant’s official site for more information to install it.
- Download the UniWebView’s customize compile script package from here and unzip it to a folder (we will call it “compile folder” later). This package is for Unix based system (such as Mac), but you can adapt it for Windows if needed easily.
- And of course, you need the source code of UniWebView Android, which is bundled with this package under the folder /Assets/UniWebView/Source/Android/ after you import it.
我并没有采用ant构建而是使用Gradle构建Labrary 下面是查看本机ant环境的小技巧
这里我检查了下本机Ant是否存在which ant
1 | keyle@keyles-MacBook-Pro ~/keylexiao/source/_posts which ant |
如果像我一样没有ant就用 SDKMan 安装一下
1 | keyle@keyles-MacBook-Pro ~/keylexiao/source/_posts sdk install ant |
本文标题:UniwebView Recompile
文章作者:Keyle
发布时间:2017-09-06
最后更新:2024-08-20
原始链接:https://vrast.cn/posts/bc9c7b23/
版权声明:©Keyle's Blog. 本站采用署名-非商业性使用-相同方式共享 4.0 国际进行许可