0

我安装了 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

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

4

1 回答 1

1

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

于 2013-06-14T18:45:39.923 回答