android - Android Studio 断点变成“行号信息在类中不可用"
问题描述
问题:尝试调试我的 Android 应用程序时,触发代码时有效的断点被禁用。然后,断点永远不会被命中。当我将鼠标悬停时,出现错误消息“行号信息在类 <path.to.class> 中不可用。
需要注意的一些事项:
- 课程在 Kotlin 中
- 问题相对较新,可能有 1 周大
- Android 版本 4.0.1 和 Kotlin 1.4.0-release-Studio4.0-1
- 似乎与调用嵌套
suspend
函数有关。它们在同一个协程范围内。 - 当应用程序被杀死时,断点恢复正常。
我尝试过的事情:
- 摇篮配置。该构建已经是调试构建,因此这些没有效果。
shrinkResources false
minifyEnabled false
- 使缓存无效/重新启动
- 构建 > 清理项目
- 使断点在所有线程上停止
- 启用、禁用、启用开发人员选项和 USB 调试
- 重新安装应用程序
代码
// 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}" }
}
}
解决方案
推荐阅读
- python - 获取具有多个变量的列的假人
- google-cloud-platform - 用于 Minecraft 服务器的 Google VM RAM
- typescript - TypeScript:通用扩展对象,只有可选键
- html - 调整轮播项目的大小
- mysql - 在 mysql 中使用 webscraper 为数据库插入编写触发器......不断收到不同的错误
- javascript - 是的嵌套模式验证
- c++ - 将值传递到数组/数组中的值丢失时出错
- networking - 是否可以知道哪个输入门触发了 Omnet++ 的 handleMessage() 方法?
- powershell - ConvertFrom-Json 为 Powershell 中的某些部分提供 System.Object[]
- python - 如何用图像处理库opencv和python语言提取材料的轮廓(2D绘图)?