I downloaded latest android SDK package (android-sdk_r12-windows.zip)
from website, when I used "sameAs" API in MonkeyImage object to
compare two Android pictures, please refer to below code:

from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice,
MonkeyImage
Pic1=MonkeyRunner.loadImageFromFile(path=./111.png')
Pic2=MonkeyRunner.loadImageFromFile(path='./222.png')
Pic2.sameAs(Pic1, 1.0)

The image comparision always failed and below message reported:

Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
       at
com.android.monkeyrunner.MonkeyImage.sameAs(MonkeyImage.java:138)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.ClassCastException: java.lang.ClassCastException:
org.python.core.PySingleton cannot be cast to
com.android.monkeyrunner.core.IMonkeyImage

I can verify that the PC image files are loaded successfully to
MonkeyImage object Pic1 and Pic2, because I can check it by
"writeToFile" API.

Who can help solve it? Thanks in advance!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to