本文介绍了运行Monkey Runner脚本时出现NoClassDefFoundError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在应用程序中第一次运行 monkeyRunner脚本,但出现以下错误:
I am running first time monkey runner script in my application but i got this following error:
D:\android softwares\AndroidSDK\tools>monkeyrunner.bat test1.py
Exception in thread "main" java.lang.NoClassDefFoundError: com/android/chimpchat
/ChimpChat
at com.android.monkeyrunner.MonkeyRunnerStarter.<init>(MonkeyRunnerStart
er.java:60)
at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter
.java:188)
Caused by: java.lang.ClassNotFoundException: com.android.chimpchat.ChimpChat
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 2 more
但是我无法解决这个问题.请帮忙...
But i am unable to sort out this issue. Please help...
这是我的脚本:
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
device.installPackage('myfile.apk')
package = 'com.example.android.myapplication'
runComponent = 'com.example.android.myapplication/.Home'
device.startActivity(component=runComponent )
device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP)
result = device.takeSnapshot()
result.writeToFile('/shot1.png','png')
谢谢,拉姆.
推荐答案
按照此,r15已修复.
As per this, r15 has a fix which is out.
这篇关于运行Monkey Runner脚本时出现NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!