我从源代码构建 SDK。我想使用以下脚本:
img=MonkeyRunner.loadImageFromFile(path='/home/alsu/monkeyrunner/device.png')
img_1=device.takeSnapshot()
img_1.sameAs(img, 1)
但是会出现这个错误:
File "/home/semc/monkey/out/host/linux-x86/sdk/android-sdk_eng.semc_linux-x86/tools/test.py", line 23, in <module>
if img_1.sameAs(img,1):
at com.android.monkeyrunner.MonkeyImage.sameAs(MonkeyImage.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
java.lang.ClassCastException: java.lang.ClassCastException: org.python.core.PySingleton cannot be cast to com.android.monkeyrunner.core.IMonkeyImage
请帮忙。