Unity XR toolkit制作Quest VR游戏无法建立tcp/udp通信解决方法

编译安卓直装版的apk时,unity某些版本或某些xr interaction toolkit版本会导致apk没有网络权限,这unity真是死老冯了。

需要做三件事

第一

Go to Project Setting -> XR Plug-in Management -> Open XR

Under Android tab, in the OpenXR Feature Groups. Select the gear symbol for “Meta Quest Support” feature row. This will open the settings editor for that feature

In the settings editor, under “Feature Settings” section there is a sub-section called “Manifest Settings”

Uncheck the “Force Remove Internet” option under the “Manifest Setting” sub-section

第二

Set Internet Access to “Require” in the Projects Settings > Player > Android > Other Settings | Configuration

两步设置修改好后,clean build即可

第三

即使你已如此设置,unity仍然有可能会在导出apk包时去除网络权限,因此你可能还需要使用apk-editor-studio手动解包编译后的apk,手动向AndroidManifest.xml中添加以下两行:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

随后重新封包,并安装封包后的apk

参考:https://forum.unity.com/threads/unity-removes-android-permission-internet-in-the-build-apk-after-build-is-completed.1466654/

https://discussions.unity.com/t/unity-removes-android-permission-internet-in-the-build-apk-after-build-is-completed/924798/3?page=2


作 者:motorbottle
链 接: https://blog.motorbottle.site/archives/32
来 源:Motor's Blog
版 权 声 明:本博客所有文章除特别声明(如【转载】)外,均采用CC BY-NC-SA 4.0许可协议。文章版权归作者所有,未经允许请勿转载!


暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇