简体   繁体   中英

ANDROID STUDIO - TV APP ( My android TV app only work on Emulator TV)

My android app run success on emulator. When i install my app on tv box, my app get crash. here is my Androidmanifest:

<manifest

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false" />

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

    <application
        android:name=".channel.App"
        android:allowBackup="true"
        android:hardwareAccelerated="false"
        android:icon="@drawable/iptv_logo"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:supportsRtl="true"
        android:theme="@style/Theme.IPTV"
        android:usesCleartextTraffic="true"
        tools:ignore="AllowBackup,UnusedAttribute">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="landscape"
            android:theme="@style/Theme.AppCompat.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.DEFAULT" />

                <action android:name="android.intent.action.VIEW" />
            </intent-filter>
        </activity>
        


        <provider
            android:name=".roomservice.Database.OrderProvider"
            android:authorities="com.example.iptv"
            android:exported="true" />

    </application>

</manifest>

When I install the application on my TV Box, the application crashes. TV box display message: Unfortunately, Myapp has stoped Thanks for your help

You should debug it and find the crash cause in logcat.

You can find a good guide below to connect your PC/laptop and AndroidTV/TV box to debug https://www.makeuseof.com/how-to-use-adb-on-android-tv/

Then, please share the log cat here to request support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM