代码之家  ›  专栏  ›  技术社区  ›  joe

Android TV 7版应用程序崩溃+

  •  0
  • joe  · 技术社区  · 7 年前

    我有一个手机应用程序需要在安卓电视上运行。我没有电视来测试它,所以我正在通过模拟器进行测试。

    该应用程序在Android版本上运行良好<7(棉花糖、棒棒糖)。但当我在模拟器中打开它,上面有牛轧糖时,应用程序不断崩溃,我得到一个错误,上面写着:“Leanback Launcher不断停止”。

    这是我的清单,所以如果你能快速看一下,并建议我把什么放在里面,使它工作?

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="------">
    
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    
    <permission android:name="android.permission.REBOOT" />
    
    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera"
        android:required="true" />
    
    <application
        android:name="-----"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher_2"
        android:label="@string/app_nameMain"
        android:launchMode="singleTask"
        android:theme="@style/AppTheme"
        tools:replace="android:label">
        <service android:name=".services.AutoUpdaterService" />
    
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    
        <receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    
                <category android:name="com.codepath.gcmquickstart" />
            </intent-filter>
        </receiver>
    
        <service
            android:name=".services.ZipaGcmListenerService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </service>
        <service
            android:name=".services.ZipaInstanceIDListenerService"
            android:exported="false">
    
            <!-- <intent-filter> -->
            <!-- <action android:name="com.google.android.c2dm.intent.RECEIVE" /> -->
            <!-- </intent-filter> -->
        </service>
    
        <receiver android:name=".broadcasts.ConnectionChangeReceiver">
            <intent-filter>
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
                <action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
            </intent-filter>
        </receiver>
    
        <activity
            android:name=".activities.LauncherActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:launchMode="singleTask"
            android:theme="@style/App.Theme.Translucent"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.AlarmTriggerActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:excludeFromRecents="true"
            android:label=""
            android:launchMode="singleInstance"
            android:theme="@style/App.Theme.Translucent"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.LogInActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.BrowserManagerActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/MyHomeCustomTheme"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.WizardActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.DeviceManagerActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="adjustPan" />
    
        <service android:name="com.zipato.mqtt.MqttService" />
    
        <activity
            android:name=".activities.RegisterActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="adjustPan" />
        <!-- <activity -->
        <!-- android:name=".activities.ShakeSettingActivity" -->
        <!-- android:configChanges="keyboardHidden|orientation|screenSize" -->
        <!-- android:windowSoftInputMode="adjustPan"/> -->
        <activity
            android:name=".activities.PasswordRecoveryActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.CameraActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="CameraActivity"
            android:launchMode="singleTop"
            android:screenOrientation="landscape"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.DiscoveryActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.ScreenShotActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.MjpegStreamActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:label="CameraActivity"
            android:launchMode="singleTop"
            android:screenOrientation="landscape"
            android:theme="@style/AppTheme"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.ShowVCMenu"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:launchMode="singleTop"
            android:windowSoftInputMode="adjustPan">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activities.BrowserManagerActivity" />
        </activity>
        <activity
            android:name=".activities.ShowDialogActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/App.Theme.Dialog"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.WidgetConfigSwitch"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/App.Theme.Dialog"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.WidgetConfigLevel"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/App.Theme.Dialog"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.WidgetConfigRGBW"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/App.Theme.Dialog"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.WidgetConfigSecurity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/App.Theme.Dialog"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.WidgetConfigThermostat"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/App.Theme.Dialog"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.WidgetEventHandlerActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:excludeFromRecents="true"
            android:label=""
            android:launchMode="singleInstance"
            android:theme="@style/App.Theme.Dialog"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.CreateWeatherActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:excludeFromRecents="true"
            android:launchMode="singleInstance"
            android:windowSoftInputMode="adjustPan" />
    
        <receiver
            android:name=".broadcasts.ThermostatWidgetProvider"
            android:label="@string/zipato_thermostat_widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
    
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/thermostat_appwidget_info" />
        </receiver>
        <receiver
            android:name=".broadcasts.SecurityWidgetProvider"
            android:label="@string/zipato_security_widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
    
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/security_appwidget_info" />
        </receiver>
        <receiver
            android:name=".broadcasts.SwitchWidgetProvider"
            android:label="@string/zipato_switch_widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
    
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/switch_appwidget_info" />
        </receiver>
        <receiver
            android:name=".broadcasts.RGBWidgetProvider"
            android:label="@string/zipato_rgb_widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
    
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/rgb_appwiget_info" />
        </receiver>
        <receiver
            android:name=".broadcasts.LevelWidgetProvider"
            android:label="@string/zipato_level_widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
    
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/level_appwidget_info" />
        </receiver>
        <receiver
            android:name=".broadcasts.StartDevicesWidgetProvider"
            android:label="@string/zipato_start_dev_widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
    
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/start_dev_app_widget_info" />
        </receiver>
        <receiver
            android:name=".broadcasts.StartRoomsWidgetProvider"
            android:label="@string/zipato_start_rooms_widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
    
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/start_room_app_widget_info" />
        </receiver>
        <receiver
            android:name=".broadcasts.StartScenesWidgetProvider"
            android:label="@string/zipato_start_scenes_widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
    
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/start_scenes_app_widget_info" />
        </receiver>
        <receiver
            android:name=".broadcasts.StartFavoriteWidgetProvider"
            android:label="@string/zipato_start_fav_widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
    
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/start_fav_app_widget_info" />
        </receiver>
    
        <service
            android:name=".services.WidgetService"
            android:exported="false">
    
            <!-- <intent-filter> -->
            <!-- <action android:name="com.google.android.c2dm.intent.RECEIVE" /> -->
            <!-- </intent-filter> -->
        </service>
    
        <activity
            android:name=".activities.WebViewActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.AccountSettingsActivity"
            android:theme="@style/MyCustomTheme"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.AccountContactsActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/MyCustomTheme"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.AccountContactsAddEdit"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/MyCustomTheme"
            android:windowSoftInputMode="stateHidden|adjustResize" />
        <activity
            android:name=".activities.ActivityUsers"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/MyCustomTheme"
            android:windowSoftInputMode="stateHidden|adjustResize" />
        <activity
            android:name=".activities.ActivityUsersEdit"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/MyCustomTheme"
            android:windowSoftInputMode="stateHidden|adjustResize" />
        <activity
            android:name=".activities.ActivityGeneralSettings"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@style/MyCustomTheme"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".activities.WalletActivity"
            android:theme="@style/MyCustomTheme" />
        <activity
            android:name=".activities.WalletWebViewActivity"
            android:theme="@style/MyCustomTheme" />
        <activity
            android:name=".activities.DeviceManActivity"
            android:theme="@style/MyCustomTheme" />
        <activity
            android:name=".activities.DeviceEndpointsActivity"
            android:theme="@style/MyCustomTheme" />
        <activity
            android:name=".activities.DeviceClusterEndpointActivity"
            android:theme="@style/MyCustomTheme" />
    </application>
    

    LauncherActivity是我的默认启动器,我应该添加:

    <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
    

    在其意图过滤器内?此外,我认为我还应该添加此权限:

     <uses-feature android:name="android.software.leanback"
        android:required="false" />
    

    应用程序标签中的这个东西:

    android:banner="@drawable/banner"
    

    还有什么别的事吗?或者这完全错了?

    1 回复  |  直到 7 年前
        1
  •  1
  •   ReyAnthonyRenacia    7 年前

    这个问题已经在这个谷歌论坛上得到了解决 Why do Apps that stream live TV crash under Android 7.0 Nougat on Nexus 5x? 综上所述,你正在运行的应用程序尚未更新/尚未准备好用于Nougat-Android的更高版本。其他支持牛轧糖的应用程序似乎运行良好。