gpt4 book ai didi

android - Unity 对应用程序 Split 的支持

转载 作者:行者123 更新时间:2023-11-29 23:38:08 26 4
gpt4 key购买 nike

我刚刚使用 Unity3D 为 Android 构建了一个应用程序。该应用重 200mb。在测试期间,我曾经构建一个始终有效的 apk。现在我将它上传到 PlayStore,我必须使用 Unity 的内置拆分功能创建一个 apk 和一个 obb 文件。

我的问题是现在该应用无法运行。似乎没有正确加载 obb 文件,应用程序找不到文件。

我在 StreamingAssets 文件夹中有一些 Assets 是动态加载的,但应用程序似乎无法将它们与其他场景一起找到。

我尝试解决此问题但没有成功:

  • 添加了READ_EXTERNAL_STORAGE权限
  • 添加了WRITE_EXTERNAL_STORAGE权限
  • 添加了一个插件来强制权限对话框Unity Android Permissions
  • 在android list 中设置为false unityplayer.SkipPermissionsDialog
  • 在我的项目中添加了 GooglePlayObbDownloader,但由于缺少许可证,它似乎使应用程序崩溃。 (我无法取回许可证)

我做错了什么?我有一个可以工作的应用程序,然后我在 Player Settings > Publishing Settings 中启用了Split Application Binary 然后它停止工作了。禁用该功能后,该应用可以运行,但无法将其上传到 Google Play,因为它有 100MB 的文件限制。

最佳答案

您提到使用 UniWebView。该文档建议将您的 Web 文件放在 Assets/Plugins/Android/assets/ 文件夹中。

If you are using "Split Application Binary" for Android build (obb files), you should not put your local HTML files under StreamingAssets folder. Instead, you need to put them to Assets/Plugins/Android/assets/ and then you can use the same way as you did for normal streaming assets resource to load it from the new location.

https://docs.uniwebview.com/guide/loading-local-files.html#using-split-application-binary .

不幸的是,这只会将文件从 .obb 文件移动到 .apk 文件,这可能会使您再次超过 100mb 的限制。

关于android - Unity 对应用程序 Split 的支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52079506/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com