android / android/tv-samples

Runtime exception: Unable to publish channel

Open
#42 6 comments 5 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
1.3k
Forks
396
PR merge metrics
No merged PRs in 30d

Description

I was trying to run the project at Android Studio 4.1.1 but it's got a runtime exception.

`2020-11-25 06:51:44.422 30804-30854/com.android.tv.classics E/TvLauncherUtils: Unable to publish channel
java.io.IOException: Failed to add logo, so channel (ID=51) 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)
2020-11-25 06:51:44.448 30804-30854/com.android.tv.classics E/PreviewChannel: Logo for preview channel (ID:12) not found.
java.io.FileNotFoundException: content://android.media.tv/channel/12/logo
at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:149)
at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:705)
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1687)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1503)
at android.content.ContentResolver.openInputStream(ContentResolver.java:1187)
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.updatePreviewChannel(PreviewChannelHelper.java:234)
at com.android.tv.classics.utils.TvLauncherUtils$Companion.upsertChannel(TvLauncherUtils.kt:212)
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)`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure in Android Studio 4.1.1, then read TvLauncherUtils.kt around upsertChannel lines 212 and 222 and the PreviewChannelHelper stack entries. Trace why the channel logo cannot be found; done means synchronization publishes the channel without the reported runtime exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.