在Unity 3D中创建oculus go清单后构建失败 [英] Build failed after creating oculus go manifest in Unity 3D

查看:126
本文介绍了在Unity 3D中创建oculus go清单后构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试发布使用Unity 3D的Oculus GO应用程序构建.我遵循OVR说明来发布此类应用程序,该说明可在此处找到:

I am trying to publish an Oculus GO application build with Unity 3D. I follow the OVR instructions for publishing such apps which can be found here: https://developer.oculus.com/documentation/mobilesdk/latest/concepts/mobile-native-manifest/

说明中提到您必须使用Oculus->工具->创建商店兼容的AndroidManifest.xml,然后在其中填充应用程序的详细信息.

The instructions mention that you have to use Oculus -> Tools -> Create Store Compatible AndroidManifest.xml and then fill it with the details of your application.

Oculus工具生成的AndroidManifest.xml文件如下:

The AndroidManifest.xml file the Oculus Tool produces is the following:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="auto">
    <application
        android:allowBackup="false">
        <activity
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
            android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
            android:launchMode="singleTask"
            android:name="com.unity3d.player.UnityPlayerActivity"
            android:excludeFromRecents="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.INFO"/>
            </intent-filter>
        </activity>
        <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
    </application>
</manifest>

我的清单文件根据上述Oculus网站上的说明进行编辑(例如,添加软件包名称等)后,如下所示:

My manifest file after editing it based on the instructions on the Oculus website above (e.g. adding package name etc) looks like:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="xx.xx.xx"
          android:versionCode="1" 
          android:versionName="1.0" 
    android:installLocation="auto">
    <application>
      <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
        <activity
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
            android:configChanges="density|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode"
            android:launchMode="singleTask"
            android:name="com.unity3d.player.UnityPlayerActivity"
            android:excludeFromRecents="true"
            android:resizeableActivity="false"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.INFO"/>
            </intent-filter>
        </activity>
        <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
    </application>
  <uses-sdk android:minSdkVersion="21"/>
  <uses-feature android:glEsVersion="0x00030001" />
</manifest>

当我尝试构建应用程序时,它显示以下错误:

When I try to build the application it shows the following error:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.XR.Oculus.OculusManifest.UpdateOrCreateNameValueElementsInTag (System.Xml.XmlDocument doc, System.String parentPath, System.String tag, System.String firstName, System.String firstValue, System.String secondName, System.String secondValue, System.String thirdName, System.String thirdValue) (at Library/PackageCache/com.unity.xr.oculus.android@1.38.2/Editor/OculusBuildProcessor.cs:60)
UnityEditor.XR.Oculus.OculusManifest.OnPostGenerateGradleAndroidProject (System.String path) (at Library/PackageCache/com.unity.xr.oculus.android@1.38.2/Editor/OculusBuildProcessor.cs:102)
UnityEditor.Android.AndroidBuildPipelineInterfaces.OnGeneratePlatformProjectPostprocess (System.String path, System.Boolean strict) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Android/AndroidPostGenerateGradleProject.cs:39)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

我不得不提到,如果我在不使用通过Oculus Tool创建的AndroidManifest.xml文件的情况下构建应用程序,则构建起来就很好.

I have to mention that if I build the application without using this AndroidManifest.xml file created using the Oculus Tool it builds just fine.

推荐答案

我已经解决了这个问题

1-从我的项目中删除AndroidManifest

1-Delete the AndroidManifest from my project

2-在AndroidManifest.OVRSubmission中进行编辑

2-Edit in AndroidManifest.OVRSubmission

<category android:name="android.intent.category.INFO"/>
 change this line with 
<category android:name="android.intent.category.LAUNCHER"/>

这篇关于在Unity 3D中创建oculus go清单后构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆