2017-04-10 99 views
0

我遇到了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

+0

看起来很像源代码和编译代码之间的不匹配。 您可以尝试将顶级和应用程序构建文件夹重命名为build.old,以强制重建所有内容。我发现这有助于工作室变得困惑(或我)。 –

回答

0

您需要在downloadLatestGfts()函数中放置断点或按F8进入下一行(即file null check if语句)。

+0

我按f8来逐步完成该功能。我甚至在'downloadLatestGfts()'功能中加入了断点。 – user664509

0

尝试运行的代码放在一个断点上线

if (dateTime == null) 

,检查日期时间的值是否为空。这可能是因为空值,控制直接到其他条件。