I am getting this error in the android studio since the last two days when I run any test cases.
Here are the error logs.
Caused by: java.lang.IllegalStateException: Could not self-attach to current VM using external process
at net.bytebuddy.agent.ByteBuddyAgent.installExternal(ByteBuddyAgent.java:675)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:606)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:586)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:538)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:515)
at io.mockk.proxy.jvm.JvmMockKAgentFactory.initInstrumentation(JvmMockKAgentFactory.kt:134)
at io.mockk.proxy.jvm.JvmMockKAgentFactory.init(JvmMockKAgentFactory.kt:34)
at io.mockk.impl.JvmMockKGateway.<init>(JvmMockKGateway.kt:46)
I have tried the below solutions but unfortunately nothing works for me.
rm -rfv ~/Library/Application Support/AndroidStudio*
rm -rfv ~/Library/Preferences/AndroidStudio*
rm -rfv ~/Library/Caches/AndroidStudio*
rm -rfv ~/Library/Logs/AndroidStudio*
rm -rfv ~/.AndroidStudio*
Changed the JDK versions(Currently using 11.0.13)
Tried with older versions of android studio
Can anyone help me to fix this. Thanks in advance.
Finally i got the solution to set the below line in .bash_profile in my mac.
export JDK_JAVA_OPTIONS="-Djdk.attach.allowAttachSelf=true"