,android,android-studio,kotlin,android-studio-4.0"/>

首页 > 解决方案 > Android Studio 断点变成“行号信息在类中不可用"

问题描述

禁用图标问题:尝试调试我的 Android 应用程序时,触发代码时有效的断点被禁用。然后,断点永远不会被命中。当我将鼠标悬停时,出现错误消息“行号信息在类 <path.to.class> 中不可用。

需要注意的一些事项:

  1. 课程在 Kotlin 中
  2. 问题相对较新,可能有 1 周大
  3. Android 版本 4.0.1 和 Kotlin 1.4.0-release-Studio4.0-1
  4. 似乎与调用嵌套suspend函数有关。它们在同一个协程范围内。
  5. 当应用程序被杀死时,断点恢复正常。

我尝试过的事情:

  1. 摇篮配置。该构建已经是调试构建,因此这些没有效果。
shrinkResources false
minifyEnabled false
  1. 使缓存无效/重新启动
  2. 构建 > 清理项目
  3. 使断点在所有线程上停止
  4. 启用、禁用、启用开发人员选项和 USB 调试
  5. 重新安装应用程序

代码

// the function-level breakpoint will be hit in the calling scope. can only debug if I manually enter the scope.
private suspend fun processDownloads(item: DownloadQueueItem, asset: Asset, downloadUrls: Map<String, List<String>>) {
        try {
            downloadManager.emit(DownloadEvent.DOWNLOADING(asset.compositeId, asset.id))

            for (assetType in downloadUrls.keys) {
   
                downloadUrls[assetType]?.forEach { assetUrl ->
// both suspend functions below will not be hit unless scope entered manually
                    yield()
                    downloadAsset(asset, downloadMap, assetType, assetUrl)
                }
            }
        } catch (t: Throwable) {
            loge(t) { "error downloading asset: ${t.message}" }
        }
    }

标签: androidandroid-studiokotlinandroid-studio-4.0

解决方案


推荐阅读