Closed saschaledermann closed 1 year ago
Try this: In Unity Editor
<uses-permission android:name="android.permission.INTERNET" />
These steps did not resolve the issue. However the necessary line <uses-permission android:name="android.permission.INTERNET" />
was not present in the manifest. This is the current manifest:
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="32" android:compileSdkVersionCodename="12" android:installLocation="auto" package="com.BFH.las2.CPVRPackageDev" platformBuildVersionCode="32" platformBuildVersionName="12">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>
<uses-feature android:glEsVersion="0x00030000"/>
<uses-feature android:name="android.hardware.vulkan.version" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false"/>
<uses-permission android:name="com.oculus.permission.HAND_TRACKING"/>
<uses-feature android:name="oculus.software.handtracking" android:required="false"/>
<uses-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1"/>
<application android:extractNativeLibs="true" android:icon="@mipmap/app_icon" android:label="@string/app_name">
<meta-data android:name="unity.splash-mode" android:value="0"/>
<meta-data android:name="unity.splash-enable" android:value="true"/>
<meta-data android:name="unity.launch-fullscreen" android:value="true"/>
<meta-data android:name="unity.allow-resizable-window" android:value="false"/>
<meta-data android:name="notch.config" android:value="portrait|landscape"/>
<meta-data android:name="unity.auto-report-fully-drawn" android:value="true"/>
<activity android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:exported="true" android:hardwareAccelerated="false" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:resizeableActivity="false" android:screenOrientation="fullUser" android:theme="@style/UnityThemeSelector">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN"/>
<category android:name="com.oculus.intent.category.VR"/>
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true"/>
<meta-data android:name="notch_support" android:value="true"/>
<meta-data android:name="com.oculus.vr.focusaware" android:value="true"/>
</activity>
<meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2|cambria"/>
</application>
</manifest>
The resulting error is: System.Net.mail.SmtpException: Message could not be sent. ---> System.Net.Sockets.SocketException
Will try to get the permission into the build, but already witnessed the re-enabling by unity.
Fixed the issue by changing the option "Internet Access" from "Auto" to "Require" in the Player Settings. Then unchecking the flag in the OpenXR settings described by @DPelts.
With these two options set the permission <uses-permission android:name="android.permission.INTERNET" />
shows up in the AndroidManifest.xml in the build.
A useful too for debugging was the apktool which allows you to unpack the apk to view the built AndroidManifest.xml.
Sending a screenshot by email does currently not work on a Quest 2 build. The caught exception is: SocketException, Unable to resolve 'smtp.google.com' However, sending an email in playmode does work fine.
A possible cause could be that the app does not have the required permissions to use the network. Some permissions were already added to the Androidmanifest.xml, which did not end up fixing the issue. To troubleshoot it further, a script should be written, which sends network requests (ICMP) to different endpoints like localhost, default gateway and some external addresses (switch.ch, google.com).