Daydream应用程序在启动时崩溃

时间:2016-07-21 17:05:06

标签: android unity3d crash android-manifest unity5

我正在为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>

1 个答案:

答案 0 :(得分:0)

它可能是清单。

您缺少重要的标签。

<!-- 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"

您需要为Unity下载 Google VR SDK 才能properly开发 Daydream应用

以下是Google VR SDK的完整清单。

<?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>