Trying to debug Annotation Processor in android st

2020-07-26 10:50发布

Using Android Studio 3.1.3

gradle 3.1.2

Runnung Remote build with default config with 5005 port

and

in gradle.properties file

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

always getting error:

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

1条回答
Anthone
2楼-- · 2020-07-26 11:49

How I made it work -

Step 1 Run the below command in the terminal

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

Step 2 Go to run -> Edit Configurations -> '+' in the top left corner -> Remote -> Give a name to this configuration, and ensure that the port number is 5005 -> OK.

Step 3 Select your configuration from the drop-down & debug.

查看更多
登录 后发表回答