久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Android studio gradle 斷點在行中找不到可執行代碼

Android studio gradle breakpoint No executable code found at line(Android studio gradle 斷點在行中找不到可執行代碼)
本文介紹了Android studio gradle 斷點在行中找不到可執行代碼的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用 Android Studio 2.1.3 和 gradle 開發一個 android 應用程序.

問題是簡單方法中的斷點永遠不會被命中,盡管它必須被命中,因為在應用程序調試期間滿足條件.
首先,我認為這個問題與這個問題的答案中描述的問題有關:

這也不是唯一的情況.碰巧編譯器在 Stepping 時完全跳到了代碼的另一部分,而不是被調試的部分.

這里有什么合理的解釋嗎?Suspend: "thread" 和 "all" 都試過了,結果一樣.

更新 1:使用 Eclipse 重新創建項目,一切正常.還是很奇怪為什么用 Android studio 不行!

解決方案

使用 Eclipse 重新創建應用程序并觀察正確行為后,我返回 Android Studio 以檢查是否有任何我錯過的選項.

在嘗試了文件 -> 設置中的所有選項后,我得出結論,即時運行是導致我浪費如此多寶貴時間的邪惡.

我不明白它與我的問題有什么關系,但是在清除所有復選框后:

我最終得到了一個按照開發人員期望的方式執行的代碼:

I am developing an android application using Android Studio 2.1.3 and gradle.

The problem is that the breakpoint in a simple method is never hit, although it must be hit because the condition is met during application debugging.
First, I thought that the problem is related to the issue described in the answer for this question: BuildConfig.DEBUG always false when building library projects with gradle

To test this, I removed library project and integrated all my source code into the main app module. It solved nothing. To be noted that the following is the build.gradle, where minify is set to false for both debug/release:

apply plugin: 'com.android.application'  

android {  
    compileSdkVersion 23  
    buildToolsVersion "23.0.2"  
    defaultConfig {  
        applicationId "com.mycompany.mymobileapp"  
        minSdkVersion 21  
        targetSdkVersion 21  
        versionCode 1  
        versionName "1.0"  
    }  
    buildTypes {  
        release {  
            minifyEnabled false  
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'  
            debuggable true  
            jniDebuggable true  
            renderscriptDebuggable true  
            zipAlignEnabled false  
        }  
        debug {  
            debuggable true  
            minifyEnabled false  
            zipAlignEnabled false  
            jniDebuggable true  
            renderscriptDebuggable true  
        }  
    }  
    productFlavors {  
    }  
}  
  
dependencies {  
    compile fileTree(include: ['*.jar'], dir: 'libs')  
    testCompile 'junit:junit:4.12'  
    testCompile 'org.mockito:mockito-core:2.0.5-beta'  
    testCompile 'com.android.support:support-v4:23.1.1'  
    testCompile 'org.powermock:powermock-api-mockito:1.6.2'  
    testCompile 'org.powermock:powermock-module-junit4-rule-agent:1.6.2'  
    testCompile 'org.powermock:powermock-module-junit4-rule:1.6.2'  
    testCompile 'org.powermock:powermock-module-junit4:1.6.2'  
    compile 'com.android.support:appcompat-v7:23.1.1'  
}

Here is the screenshot with what Android Studio shows to me:

This is also not the only case. It happens that the compiler, while Stepping over, jumps to completely another part of the code than the one being debugged.

Is there any reasonable explanation here? Suspend: "thread" and "all" tried, same result.

UPDATE 1: Re-created the project using Eclipse, and everything works fine. It is still amazing why using Android studio this does not work!

解決方案

After re-creating the application using Eclipse and observing the correct behavior, I returned to Android Studio in order to check if there is any option that I missed.

After trying all the options from File -> Settings that I could, I made the conclusion that Instant Run is the evil that caused me to waste so much precious time.

I don't understand how it is related with my problem, but after clearing all check-boxes:

I ended up with a code that executes the way I as a developer expect:

這篇關于Android studio gradle 斷點在行中找不到可執行代碼的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現 IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當前風味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風味庫的多風味應用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 福利精品| 中文字幕免费在线 | 久久天天躁狠狠躁夜夜躁2014 | 中文字幕人成乱码在线观看 | 超碰地址 | 国产成人网 | 九九精品在线 | 欧美精品在线一区二区三区 | 久久久青草 | 亚洲a毛片 | 婷婷在线网站 | 久国久产久精永久网页 | 日韩一区不卡 | 男人的天堂中文字幕 | 欧美国产精品一区二区三区 | 97久久精品午夜一区二区 | 欧美在线视频网站 | 亚洲国产成人精品女人 | 国产电影一区 | 亚洲一区 | 免费在线观看毛片 | 午夜精品一区二区三区在线视 | 99re在线免费视频 | 亚洲欧美日韩精品久久亚洲区 | 毛片久久久 | 涩涩鲁亚洲精品一区二区 | 国产高清精品一区 | 日日操夜夜摸 | 精品一级毛片 | 日本久久久久久久久 | 在线播放亚洲 | 国产精品久久久久久久久免费高清 | 蜜臀久久99精品久久久久野外 | 日韩高清国产一区在线 | 国产精品一区在线 | 羞羞视频在线观看 | 成人高清视频在线观看 | 俺去俺来也www色官网cms | 一级黄色片免费在线观看 | 日韩一级精品视频在线观看 | 日韩在线播放第一页 |