正常用unity出aab包,最后用插件拆一下包,上传商店就不会提示大于150mb
-
下载谷歌插件 https://github.com/google/play-unity-plugins 导入工程
-
命令行打包设置EditorUserBuildSettings.buildAppBundle=true或unity打包勾选BuildAppBundle(Google Play),正常出包
-
拆分aab包 AppBundleBuilder builder = AppBundlePublisher.GetBundleBuilder(); if (builder == null) { ThrowException("create appBundleBuilder fail"); } else { string tempResPath = builder.WorkingDirectoryPath + "\\tmp.aab"; Debug.Log("temp aab path " + tempResPath); File.Move(aabPath, tempResPath); Debug.Log("开始拆分aab"); builder.CreateBundle(aabPath, AssetPackConfigSerializer.LoadConfig()); // 删除临时文件夹 Directory.Delete(builder.WorkingDirectoryPath, true); }
-
完成 (如果unity打出的aab可以运行,拆包后崩溃,可以看下打包参数是否设置了压缩)