2016-07-21 127 views
1

我正在爲android做Daydream應用程序,但它立即崩潰。我不知道是什麼導致了這個問題。我認爲這與AndroidManifest有關,但對我來說看起來很好。我希望有人能幫助我,因爲它真的很煩人。附:我正在與Unity 5合作,所以也許根本不可能用Unity製作Daydream應用程序?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> 

回答

0

它可能是Manifest。

您錯過了重要的標籤。

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

,並確保沒有棉花糖的運行權限的問題,ALSI包括

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="22" 

您需要下載Google VR SDK團結才能夠properly開發Daydream App

下面是來自Google VR SDK的完整Manifest。

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

感謝您的awnser,但我並沒有爲Google VR製作應用程序。有2件白日夢的事情,這是VR和這個:http://www.greenbot.com/article/2151960/how-to-set-up-daydream-android-s-overlooked-customizable-docking-screen.html我正在爲第二個做白日夢的應用 – DutchDesigner

+0

我真的很抱歉,但是謝謝你的努力! – DutchDesigner

+0

@DutchDesigner哎呀。我不知道白天夢人有兩件事。你解釋第二個,因爲我仍然困惑。它做什麼,爲什麼需要Unity? – Programmer