Uiautomatorviewer SWT异常 [英] Uiautomatorviewer SWT exception

查看:446
本文介绍了Uiautomatorviewer SWT异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为StackExchange建议我不要在

Since StackExchange advised me to not ask for help or clarification on a previously existing post, I am making a new thread.

在Windows 10x64上,我下载了 Eclipse SWT (在下载"页面的倒数第二部分)中,将我的ANDROID_SWT环境变量设置为<download location>\swt.jar,并尝试再次从cmd运行uiautomatorviewer,仅收到与以下情况相同的错误消息:我试图使用与Eclipse捆绑在一起的SWT:

On Windows 10x64 I downloaded the Eclipse SWT (in second-to-last section of Downloads page), set my ANDROID_SWT environment variable to <download location>\swt.jar, and have attempted to run uiautomatorviewer from cmd again, only to receive the same error message as when I tried to use the SWT bundled with eclipse:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Listener
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Listener
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 7 more

是否还有其他人遇到此错误,如果是,根本原因是什么?

Has anyone else encountered this error, and if so, what was the root cause?

提前感谢您的时间和帮助!

Thanks in advance for your time and help!

推荐答案

严格按照这些说明.我尝试下载Eclipse SWT来解决我遇到的其他问题时犯了一个错误.在CLASSPATHANDROID_SWT环境变量中设置此不同的SWT版本会导致此异常.

Precisely follow these instructions. I made the mistake of trying to download the Eclipse SWT in order to troubleshoot other issues I was having; setting this different SWT version in the CLASSPATH and ANDROID_SWT environment variables caused this exception.

这篇关于Uiautomatorviewer SWT异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆