android - 尝试在 android studio 中调试注释处理器最终会出现异常

标签 android annotations android-annotations java-annotations

使用 Android Studio 3.1.3

渐变 3.1.2

使用默认配置和 5005 端口运行远程构建

在 gradle.properties 文件中

org.gradle.daemon=假 org.gradle.jvmargs= -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

总是报错:

Error running 'APT': Unable to open debugger port (127.0.0.0:5005): java.net.ConnectException "Operation timed out (Connection timed out)"

最佳答案

我是如何让它发挥作用的——

第一步在终端中运行以下命令

./gradlew --no-daemon -Dorg.gradle.debug=true :app:clean :app:compileDebugJavaWithJavac

第2步 Go to run -> Edit Configurations -> 左上角的'+' -> Remote -> 为此配置命名,并确保端口号为 5005 -> OK

第 3 步从下拉菜单中选择您的配置并进行调试。

关于android - 尝试在 android studio 中调试注释处理器最终会出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50929242/

相关文章:

android - 使用动态 URL 改造 HTTP Get

java - 测试中的自定义注释

android - @AfterViews 相当于 onCreate 还是 onPostCreate?

android - Android 中的颜色深度

android - 方案主机无法在 android Lollipop 上运行,单击链接以打开应用程序

java - 无法解决 Android Studio 2.1 上的运行时错误

Android Listview 异步图像加载

java - 基于 Spring 注释的 DI 与 xml 配置?

Android 注释和 MonkeyTalk?

android - Roboguice、AndroidAnnotations 和线程间的事件