我试图通过IChimpDevice获取android HierarchyViewer,我的代码看起来像这样
public HierarchyViewer GetHierarchyViewer()
{
return mDevice.getHierarchyViewer();
}
我已经用这种方式初始化了mDevice:
mDevice = mChimpchat.waitForConnection(TIMEOUT, ".*");
if ( mDevice == null ) {
throw new RuntimeException("Couldn't connect.");
}
mDevice.wake();
当我致电getHierarchyViewer()
时,我得到了这个例外:
Exception in thread "main" java.lang.NoClassDefFoundError: com/android/hierarchyviewerlib/device/DeviceBridge
at com.android.chimpchat.hierarchyviewer.HierarchyViewer.setupViewServer(HierarchyViewer.java:46)
at com.android.chimpchat.hierarchyviewer.HierarchyViewer.<init>(HierarchyViewer.java:42)
at com.android.chimpchat.adb.AdbChimpDevice.getHierarchyViewer(AdbChimpDevice.java:96)
at ChimpChatWrapper.GetHierarchyViewer(ChimpChatWrapper.java:44)
at ViewService.main(ViewService.java:17)
有人可以帮助解释为什么找不到DeviceBridge类吗?