2

While clicking on UI-automatorviewer I'm getting below error:

/Users/XXXX/Library/Android/sdk/tools/bin/uiautomatorviewer ; exit;
-Djava.ext.dirs=/Users/bigdaddy/Library/Android/sdk/tools/lib/x86_64:/Users/XXXX/Library/Android/sdk/tools/lib is not supported.  Use -classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

PATH ARE LIKE THIS:

PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:${PATH}"
export PATH

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home
export JAVA_HOME

export PATH="/Users/XXXX/Library/Android/sdk/platform-tools":${PATH}"
export PATH="/Users/XXXX/Library/Android/sdk/tools":${PATH}"
export PATH="/Users/XXXX/Library/Android/sdk/tools/bin/":${PATH}"
ANDROID_HOME=/Users/XXXX/Library/Android/sdk
export ANDROID_HOME
1

I had the same problem.

I found that UIAutomatorViewer does not support JDK10, instead you need to downgrade to JDK8 (It's something to do with the fact it hasn't been updated in forever). If anyone knows the links to these, feel free to edit my response.

1

The issue seems to be with the JDK version you have installed.

From your Mac:

  1. Install JDK 8.
  2. After installing it, update the JAVA_HOME with your JDK version: JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk[version].jdk/Contents/Home export JAVA_HOME
  3. Start a new terminal window
  4. Attempt to launch the uiautomatorviewer

This worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.