android - monkeyrunner 导入操作系统数组索引outofbounds异常

标签 android exception ubuntu command-line monkeyrunner

我安装了 Pythonv2.6.5、Jythonv2.5.3 和 ADT22.01,但由于某种原因,无论是在 python 脚本中还是只是从 monkeyrunner 命令行中,当我只需输入 import os ,我得到一个 ArrayIndexOutofBoundsException .这是在 Ubuntu 10.04 (Lucid Lynx) 上运行的:

$ monkeyrunner
Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35) 
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_26
>>> import os
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "__pyclasspath__/os$py.class", line 50, in <module>
java.lang.ArrayIndexOutOfBoundsException: 8
    at org.python.objectweb.asm.ClassReader.a(Unknown Source)
    at org.python.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.python.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.python.core.AnnotationReader.<init>(AnnotationReader.java:44)
    at org.python.core.imp.readCode(imp.java:219)
    at org.python.core.util.importer.getModuleCode(importer.java:202)
    at org.python.core.util.importer.importer_load_module(importer.java:95)
    at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63)
    at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source)
    at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
    at org.python.core.imp.loadFromLoader(imp.java:518)
    at org.python.core.imp.find_module(imp.java:472)
    at org.python.core.imp.import_next(imp.java:718)
    at org.python.core.imp.import_module_level(imp.java:827)
    at org.python.core.imp.importName(imp.java:917)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importOneAs(imp.java:954)
    at os$py.f$0(/home/frank/hg/jython/jython/dist/Lib/os.py:705)
    at os$py.call_function(/home/frank/hg/jython/jython/dist/Lib/os.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.imp.createFromCode(imp.java:391)
    at org.python.core.util.importer.importer_load_module(importer.java:109)
    at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63)
    at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source)
    at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
    at org.python.core.imp.loadFromLoader(imp.java:518)
    at org.python.core.imp.find_module(imp.java:472)
    at org.python.core.imp.import_next(imp.java:718)
    at org.python.core.imp.import_module_level(imp.java:827)
    at org.python.core.imp.importName(imp.java:917)
    at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
    at org.python.core.PyObject.__call__(PyObject.java:357)
    at org.python.core.__builtin__.__import__(__builtin__.java:1173)
    at org.python.core.imp.importOne(imp.java:936)
    at org.python.pycode._pyx1.f$0(<stdin>:1)
    at org.python.pycode._pyx1.call_function(<stdin>)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1275)
    at org.python.core.Py.exec(Py.java:1319)
    at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:215)
    at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:89)
    at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:70)
    at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:46)
    at org.python.util.InteractiveConsole.push(InteractiveConsole.java:110)
    at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:90)
    at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:60)
    at com.android.monkeyrunner.ScriptRunner.console(ScriptRunner.java:193)
    at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:73)
    at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:189)

java.lang.ArrayIndexOutOfBoundsException: java.lang.ArrayIndexOutOfBoundsException: 8

关于我可能配置错误的任何想法?

最佳答案

通过删除工具目录并从 SDK Tools v 22.01 重新复制工具来修复它

关于android - monkeyrunner 导入操作系统数组索引outofbounds异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17114632/

相关文章:

php - 如何将 CodeIgniter System 文件夹添加到 Eclipse 项目 - Ubuntu

ubuntu - 在 Octave 中使用帮助时出现问题

android - Android 中的共享首选项?

Android Studio 2.2 预览版 Record Espresso Test 选项不可用

java - 无法在存储根目录中创建文件?

.net - C++/CLI 中跨模块边界的异常

c++ - C++ 中的构造函数和析构函数失败

java - 在 ubuntu 15.04 上安装 hadoop 2.7 无法找到或加载主类

android - 无法在 xamarin 中的 android Activity 之间传递数据

java - 在Java中进行SAX解析时捕获与XML无关的异常?