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)"
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.
来源:https://stackoverflow.com/questions/50929242/trying-to-debug-annotation-processor-in-android-studio-end-up-getting-exception