pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

Android studio gradle 斷點(diǎn)在行中找不到可執(zhí)行代碼

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

問題描述

我正在使用 Android Studio 2.1.3 和 gradle 開發(fā)一個 android 應(yīng)用程序.

問題是簡單方法中的斷點(diǎn)永遠(yuǎn)不會被命中,盡管它必須被命中,因?yàn)樵趹?yīng)用程序調(diào)試期間滿足條件.
首先,我認(rèn)為這個問題與這個問題的答案中描述的問題有關(guān):

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

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

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

解決方案

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

在嘗試了文件 -> 設(shè)置中的所有選項(xiàng)后,我得出結(jié)論,即時運(yùn)行是導(dǎo)致我浪費(fèi)如此多寶貴時間的邪惡.

我不明白它與我的問題有什么關(guān)系,但是在清除所有復(fù)選框后:

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

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:

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

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

相關(guān)文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現(xiàn) IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當(dāng)前風(fēng)味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復(fù)“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風(fēng)味庫的多風(fēng)味應(yīng)用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運(yùn)行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: CCE素质教育博览会 | CCE素博会 | 教育展 | 美育展 | 科教展 | 素质教育展 | 上海乾拓贸易有限公司-日本SMC电磁阀_德国FESTO电磁阀_德国FESTO气缸 | 铆钉机|旋铆机|东莞旋铆机厂家|鸿佰专业生产气压/油压/自动铆钉机 | 电脑知识|软件|系统|数据库|服务器|编程开发|网络运营|知识问答|技术教程文章 - 好吧啦网 | 深圳3D打印服务-3D打印加工-手板模型加工厂-悟空打印坊 | 烟气换热器_GGH烟气换热器_空气预热器_高温气气换热器-青岛康景辉 | 微水泥_硅藻泥_艺术涂料_艺术漆_艺术漆加盟-青岛泥之韵环保壁材 武汉EPS线条_EPS装饰线条_EPS构件_湖北博欧EPS线条厂家 | 无机纤维喷涂棉-喷涂棉施工工程-山东华泉建筑工程有限公司▲ | 塑胶地板-商用PVC地板-pvc地板革-安耐宝pvc塑胶地板厂家 | 大白菜官网,大白菜winpe,大白菜U盘装系统, u盘启动盘制作工具 | 网站建设,北京网站建设,北京网站建设公司,网站系统开发,北京网站制作公司,响应式网站,做网站公司,海淀做网站,朝阳做网站,昌平做网站,建站公司 | 四合院设计_四合院装修_四合院会所设计-四合院古建设计与建造中心1 | 卫生型双针压力表-高温防腐差压表-安徽康泰电气有限公司 | 茅茅虫AI论文写作助手-免费AIGC论文查重_写毕业论文降重 | China plate rolling machine manufacturer,cone rolling machine-Saint Fighter | 筛分机|振动筛分机|气流筛分机|筛分机厂家-新乡市大汉振动机械有限公司 | 无硅导热垫片-碳纤维导热垫片-导热相变材料厂家-东莞市盛元新材料科技有限公司 | 全自动真空上料机_粉末真空上料机_气动真空上料机-南京奥威环保科技设备有限公司 | 青岛美佳乐清洁工程有限公司|青岛油烟管道清洗|酒店|企事业单位|学校工厂厨房|青岛油烟管道清洗 插针变压器-家用电器变压器-工业空调变压器-CD型电抗器-余姚市中驰电器有限公司 | 智能交通网_智能交通系统_ITS_交通监控_卫星导航_智能交通行业 | LED太阳能中国结|发光红灯笼|灯杆造型灯|节日灯|太阳能灯笼|LED路灯杆装饰造型灯-北京中海轩光电 | 高空重型升降平台_高空液压举升平台_高空作业平台_移动式升降机-河南华鹰机械设备有限公司 | 天一线缆邯郸有限公司_煤矿用电缆厂家_矿用光缆厂家_矿用控制电缆_矿用通信电缆-天一线缆邯郸有限公司 | 章丘丰源机械有限公司 - 三叶罗茨风机,罗茨鼓风机,罗茨风机 | 北京遮阳网-防尘盖土网-盖土草坪-迷彩网-防尘网生产厂家-京兴科技 | 万烁建筑设计院-建筑设计公司加盟,设计院加盟分公司,市政设计加盟 | 油罐车_加油机_加油卷盘_加油机卷盘_罐车人孔盖_各类球阀_海底阀等车用配件厂家-湖北华特专用设备有限公司 | 螺纹三通快插接头-弯通快插接头-宁波舜驰气动科技有限公司 | 油罐车_加油机_加油卷盘_加油机卷盘_罐车人孔盖_各类球阀_海底阀等车用配件厂家-湖北华特专用设备有限公司 | 冰晶石|碱性嫩黄闪蒸干燥机-有机垃圾烘干设备-草酸钙盘式干燥机-常州市宝康干燥 | LED灯杆屏_LED广告机_户外LED广告机_智慧灯杆_智慧路灯-太龙智显科技(深圳)有限公司 | 优考试_免费在线考试系统_培训考试系统_题库系统_组卷答题系统_匡优考试 | 广东成考网-广东成人高考网 | 安德建奇火花机-阿奇夏米尔慢走丝|高维|发那科-北京杰森柏汇 | 光照全温振荡器(智能型)-恒隆仪器 | 水厂污泥地磅|污泥处理地磅厂家|地磅无人值守称重系统升级改造|地磅自动称重系统维修-河南成辉电子科技有限公司 | 国产频谱分析仪-国产网络分析仪-上海坚融实业有限公司 | 匀胶机旋涂仪-声扫显微镜-工业水浸超声-安赛斯(北京)科技有限公司 | 车牌识别道闸_停车场收费系统_人脸识别考勤机_速通门闸机_充电桩厂家_中全清茂官网 | 东莞压铸厂_精密压铸_锌合金压铸_铝合金压铸_压铸件加工_东莞祥宇金属制品 | 德国UST优斯特氢气检漏仪-德国舒赐乙烷检测仪-北京泽钏 |