2016-07-21 108 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