Network Checklist for Unity VR Apps

unity
Published

October 13, 2023

click here to read this in medium

Checklist for Internet Connection in Unity VR App Builds

Photo by XR Expo on Unsplash

While working on a Unity VR app for the Meta Quest, I encountered a peculiar issue. The app functioned seamlessly in debug mode on my development machine. However, when I built and installed it on the Meta Quest, the log highlighted an internet-related problem, stating, “cannot resolve the host name.” I’ve observed numerous threads on Unity communities discussing this very issue. In this article, I’ll share a checklist that has helped me address network connectivity challenges.

Check List:

  1. Ensure the VR device has an active Internet connection.
  2. Review the AndroidManifest.xml for the necessary network permissions.
  3. Explore the Meta support options.
Photo by Sara Kurig on Unsplash

Setps:

my source

Most of the time, the app should function correctly after these adjustments. If not, enable the manual Main Manifest and inspect the file for network permissions. This option can be found at: Player > Publishing Settings > Build

Look for these lines inside the <manifest> tag but outside the <application> tag:

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

Here’s an example of what your AndroidManifest.xml might look like:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="1"
android:versionName="1.0">

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

<application>
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
</application>
</manifest>

If the app still doesn’t connect, double-check the settings mentioned above.

Thank you for reading! I hope this guide proves helpful.

Pardhu Guttikonda - Medium