C:\Users\Shruti>uiautomatorviewer -Djava.ext.dirs=C:\Program Files\Java\jdk-11.0.14\lib;..\lib is not supported. Use -classpath instead. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
First I had java 15 but I heard java 8 is compatible for uiautomatorviewer but it didn't helped then I uprgaded it to java 11 but same issue plz help
I couldn't make it work with Java 11 and I doubt it's possible to as there may be substantial differences in the APIs used, but I was able to run it using Java 8 while maintaining Java 11 as the default java. Simply open
<android-sdk>/tools/bin/uiautomatorviewerwith a text editor and replacewith
(or whatever your path to java 8 bin is located)