我正在为 Android 制作 Daydream 应用程序,但它立即崩溃。我不知道是什么导致了这个问题。我认为它与 AndroidManifest 有关,但对我来说看起来不错。我希望有人能帮助我,因为这真的很烦人。附:我正在使用 Unity 5,所以也许根本不可能使用 Unity 制作 Daydream 应用程序?
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<application
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:debuggable="true">
android:label="@string/app_name"
android:supportsRtl="true"
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:label="@string/app_name">
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<service
android:name=".MyDream"
android:exported="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:permission="android.permission.BIND_DREAM_SERVICE">
<intent-filter>
<action android:name="android.service.dreams.DreamService" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
</application>
</manifest>
最佳答案
它可能是 list 。
您缺少其中的重要标签。
<!-- VR feature tags. -->
<uses-feature android:name="android.software.vr.mode" android:required="false"/>
<uses-feature android:name="android.hardware.vr.high_performance" android:required="false"/>
还有
<uses-feature android:glEsVersion="0x00020000" />
并且为了确保不存在 Marshmallow 的运行时权限问题,alsi include
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="22"
您需要下载Google VR SDK Unity 能够 properly开发Daydream 应用程序。
以下是 Google VR SDK 的完整 list 。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:icon="@drawable/app_icon"
android:label="@string/app_name">
<activity android:name="com.google.unity.GoogleUnityActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:launchMode="singleTask"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="com.google.intent.category.CARDBOARD" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<meta-data android:name="IMMERSIVE_MODE" android:value="true" />
</application>
<!-- Set target sdk version to Lollipop to prevent issues with Marshmallow's runtime permissions. -->
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="22" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true"/>
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="true"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- VR feature tags. -->
<uses-feature android:name="android.software.vr.mode" android:required="false"/>
<uses-feature android:name="android.hardware.vr.high_performance" android:required="false"/>
</manifest>
关于android - Daydream 应用程序启动时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38510306/