Android Studio 4.1调试器断点不起作用。

huangapple go评论57阅读模式
英文:

Android Studio 4.1 debugger break points not working

问题

在将我的Android Studio从4.0版本更新到4.1版本后,调试器断点不再起作用:

英文:

After updating my android studio from version 4.0 to 4.1 the debugger break points don't work anymore:

Android Studio 4.1调试器断点不起作用。

答案1

得分: 17

我不得不回滚。没有人有时间处理这个破事...

  1. 卸载 Android Studio
  2. 重启
  3. 下载并安装 AS 4.0.2:https://redirector.gvt1.com/edgedl/android/studio/install/4.0.2.0/android-studio-ide-193.6821437-windows.exe 或 https://developer.android.com/studio/archive
  4. 在 build.gradle 中将 Gradle classpath 更改为 4.0.2

现在一切都好了...

英文:

I had to rollback. No one has time for this sh**...

  1. Uninstall Android Studio
  2. Reboot
  3. Download & Install AS 4.0.2: https://redirector.gvt1.com/edgedl/android/studio/install/4.0.2.0/android-studio-ide-193.6821437-windows.exe or https://developer.android.com/studio/archive
  4. Change Gradle classpath to 4.0.2 in build.gradle

All better now...

答案2

得分: 3

我会尝试以下操作:

  • 尝试使用应用程序运行时的“附加调试器”选项,可以在工具栏上找到按钮,或者通过查找操作(cmd/ctrl shift + a 并键入“将调试器附加到Android进程”)来执行。

  • 确保在您当前使用的变体的模块/build.gradle 中设置了 debuggable true(检查构建变体选项卡)。

  • 确保Android Gradle插件指向与Android Studio相同的版本,即 com.android.tools.build:gradle:4.1.0 适用于Android Studio 4.1。

  • 清除数据,卸载应用程序,并从Android Studio中运行“无效缓存并重新启动”。

  • 确保您没有同时运行稳定版和Canary版本的Android Studio(我过去因此遇到了调试器问题)。

  • 重新启动adb?(adb kill-server && adb start-server)。

  • 重新启动/切换模拟器/设备?

  • 重新启动计算机?

  • 如果以上所有方法都失败了,我还会尝试使用这个脚本:https://github.com/rock3r/deep-clean

英文:

I would try the following:

  • Try the 'attach debugger' option with the app running, via the button on the toolbar, or finding the action (cmd/ctrl shift + a and type 'attach debugger to android process').

  • Make sure that debuggable true is set in your module/build.gradle for the flavor you are currently using, (Check the build variants tab).

  • Be sure that the Android Gradle Plugin points to the same version that Android Studio has, this is com.android.tools.build:gradle:4.1.0 for Android Studio 4.1.

  • Clear data, uninstall the app, and run 'Invalidate Caches & restart' from Android Studio.

  • Make sure you don't have the stable and the canary versions of A.S running (I faced debugger issues in the past because of that).

  • Restart adb? (adb kill-server && adb start-server).

  • Reboot / Switch the emulator / device?.

  • Reboot the computer?.

  • If all of the above fails, I would also try this script: https://github.com/rock3r/deep-clean

答案3

得分: 1

在我的情况下,只有在模拟器上进行调试时才会发生。在真实设备上进行调试或单元测试是有效的。

英文:

In my case it only happens when debugging on the emulator. Debugging on a real device or unit tests works.

答案4

得分: 1

重启Android Studio中的ADB设备菜单

Android Studio 4.1调试器断点不起作用。

Android Studio 4.1调试器断点不起作用。

英文:

Restart ADB in menú dispositives Android Studio

Android Studio 4.1调试器断点不起作用。

Android Studio 4.1调试器断点不起作用。

答案5

得分: 0

我正在使用Android Studio 4.1。以下步骤适用于我。##

  • 在<yourapp>/.gradle中删除 .gradle 文件夹
  • 使用 Build > clean project 清理项目
  • 使用 Build > Rebuild project 重新构建项目

现在尝试调试代码。

希望这能有所帮助!

英文:

I'm using Android Studio 4.1. Following steps worked for me.

  • delete the .gradle folder in <yourapp>/.gradle
  • clean the project using Build > clean project
  • rebuild the project using Build > Rebuild project

Now try to debug the code.

I hope this helps!

答案6

得分: 0

在我的情况下,我添加了:

debug {
    minifyEnabled true
    shrinkResources true
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

在应用级别的 gradle 的 buildTypes 中。我只是移除了这部分,然后我就能够进行调试了。就是这样。

英文:

In my case I added

debug {
    minifyEnabled true
    shrinkResources true
    proguardFiles getDefaultProguardFile(&#39;proguard-android-optimize.txt&#39;), &#39;proguard-rules.pro&#39;
}

in buildTypes of app level gradle.
I just removed this and then I am able to debug. That's it.

huangapple
  • 本文由 发表于 2020年10月16日 18:41:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/64387607.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定