Android Studio跳过断点
我遇到了Android Studio跳过我的断点的问题。 我之前没有遇到过这个问题,最近才开始发生。
我在MAC上运行Android Studio 2.3.1,没有特殊的插件。 有任何想法吗? 这里是代码:
private fun getLatestZip(): File? { var fileName = context.fileList().find { it.toUpperCase().contains("MBTA_GTFS") } var dateTime = getGftsTimestamp() var file: File? if (dateTime == null) { file = downloadLatestGfts() // skips the break on this line if (file != null) { printGftsTimestamp() } else { Timber.e("Failed to download Gfts") // and goes straight to here } } else if (!fileName.isNullOrEmpty()) {....
编辑—这是一个视频,告诉你到底发生了什么事。 这可能是一个kotlin问题。 https://youtu.be/fJOIzD8ckv8
- Android的kotlin和房间持久性库不建设
- Kotlin / Anko防止按钮关闭警报对话框
- 在onCreateView android视图是null
- 使用kotlin&greendao的Android Studio 3.0 Proguard将返回ClassLookupException
- 尝试使用Android Studio生成Kotlin应用程序的问题
您需要在downloadLatestGfts()函数中放置断点,或按F8进入下一行(即file null check if语句)。
尝试运行代码把一个断点上线
if (dateTime == null)
并检查dateTime的值是否为空。 这可能是因为空值,控制直接到其他条件。
- 错误:未找到注释处理器'__gen.AnnotationProcessorWrapper_debug_android_databinding_annotationprocessor_ProcessDataBinding'
- 用Kotlin在android中声明变量类型的正确方法是什么?
- DataBinding错误在android微调
- 数据库如何在Kotlin中传递值?
- 在Kotlin Android中出现错误“未解决的参考”
- 如何在Android和JavaScript中使用kotlin中的可重用库?
- 在Android应用程序中使用kotlin静态类似的方法
- Kotlin并行协程
- 如何用copyToRealm插入对象RealmList