ClassicsKotlin tv sample launches briefly & then crashes
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 396
- PR merge metrics
- No merged PRs in 30d
Description
E/PreviewChannel: Logo for preview channel (ID:-1) not found.
java.io.FileNotFoundException: content://android.media.tv/channel/-1/logo
at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151)
at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:780)
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:2027)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1842)
at android.content.ContentResolver.openInputStream(ContentResolver.java:1518)
at androidx.tvprovider.media.tv.PreviewChannel.getLogo(PreviewChannel.java:175)
at androidx.tvprovider.media.tv.PreviewChannelHelper.addChannelLogo(PreviewChannelHelper.java:268)
at androidx.tvprovider.media.tv.PreviewChannelHelper.publishChannel(PreviewChannelHelper.java:132)
at com.android.tv.classics.utils.TvLauncherUtils$Companion.upsertChannel(TvLauncherUtils.kt:222)
at com.android.tv.classics.utils.TvLauncherUtils$Companion.upsertChannel$default(TvLauncherUtils.kt:157)
at com.android.tv.classics.workers.TvMediaSynchronizer$Companion.synchronize(TvMediaSynchronizer.kt:165)
at com.android.tv.classics.fragments.MediaBrowserFragment$onCreate$4.invokeSuspend(MediaBrowserFragment.kt:158)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
E/TvLauncherUtils: Unable to publish channel
java.io.IOException: Failed to add logo, so channel (ID=28) was not created
at androidx.tvprovider.media.tv.PreviewChannelHelper.publishChannel(PreviewChannelHelper.java:136)
at com.android.tv.classics.utils.TvLauncherUtils$Companion.upsertChannel(TvLauncherUtils.kt:222)
at com.android.tv.classics.utils.TvLauncherUtils$Companion.upsertChannel$default(TvLauncherUtils.kt:157)
at com.android.tv.classics.workers.TvMediaSynchronizer$Companion.synchronize(TvMediaSynchronizer.kt:165)
at com.android.tv.classics.fragments.MediaBrowserFragment$onCreate$4.invokeSuspend(MediaBrowserFragment.kt:158)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
E/PreviewChannel: Logo for preview channel (ID:-1) not found.
java.io.FileNotFoundException: content://android.media.tv/channel/-1/logo
at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151)
at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:780)
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:2027)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1842)
at android.content.ContentResolver.openInputStream(ContentResolver.java:1518)
at androidx.tvprovider.media.tv.PreviewChannel.getLogo(PreviewChannel.java:175)
at androidx.tvprovider.media.tv.PreviewChannelHelper.addChannelLogo(PreviewChannelHelper.java:268)
at androidx.tvprovider.media.tv.PreviewChannelHelper.publishChannel(PreviewChannelHelper.java:132)
at com.android.tv.classics.utils.TvLauncherUtils$Companion.upsertChannel(TvLauncherUtils.kt:222)
at com.android.tv.classics.utils.TvLauncherUtils$Companion.upsertChannel$default(TvLauncherUtils.kt:157)
at com.android.tv.classics.workers.TvMediaSynchronizer$Companion.synchronize(TvMediaSynchronizer.kt:165)
at com.android.tv.classics.fragments.MediaBrowserFragment$onCreate$4.invokeSuspend(MediaBrowserFragment.kt:158)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-3
Process: com.android.tv.classics, PID: 9841
java.lang.IllegalStateException: BitmapFactory returned a null Bitmap.
at coil.decode.BitmapFactoryDecoder.decode(BitmapFactoryDecoder.kt:152)
at coil.RealImageLoader$loadData$2.invokeSuspend(RealImageLoader.kt:345)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
E/TvLauncherUtils: Unable to publish channel
java.io.IOException: Failed to add logo, so channel (ID=29) was not created
at androidx.tvprovider.media.tv.PreviewChannelHelper.publishChannel(PreviewChannelHelper.java:136)
at com.android.tv.classics.utils.TvLauncherUtils$Companion.upsertChannel(TvLauncherUtils.kt:222)
at com.android.tv.classics.utils.TvLauncherUtils$Companion.upsertChannel$default(TvLauncherUtils.kt:157)
at com.android.tv.classics.workers.TvMediaSynchronizer$Companion.synchronize(TvMediaSynchronizer.kt:165)
at com.android.tv.classics.fragments.MediaBrowserFragment$onCreate$4.invokeSuspend(MediaBrowserFragment.kt:158)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
Contributor guide
Research direction
Start by reproducing the launch failure and reading TvLauncherUtils.kt around upsertChannel at line 222, then follow the call from TvMediaSynchronizer.kt line 165 and MediaBrowserFragment.kt line 158. Done means the ClassicsKotlin TV sample launches without the BitmapFactory crash and can publish its channels successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100