【发布时间】:2011-09-17 19:17:17
【问题描述】:
我正在测试 Jython for Android,取自 http://code.google.com/p/jython-for-android/
不幸的是,我在启动过程中遇到了问题...我尝试导入 我的一个项目和 onCreate 方法中的所有库 在我的活动中,我输入了以下代码:
PythonInterpreter interpreter = new PythonInterpreter();
interpreter.exec("print 'hello from Jython!' ");
这段代码应该可以工作(就像标准的 java 那样),但我明白了:
Traceback (innermost last):
(no code object) at line 0
java.lang.NullPointerException
at org.python.core.BytecodeLoader.makeCode(BytecodeLoader.java:104)
at org.python.core.Py.compile_flags(Py.java:1685)
at org.python.core.Py.compile_flags(Py.java:1698)
at org.python.core.Py.compile_flags(Py.java:1706)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:135)
at org.python.util.InteractiveConsole.interact(JythonForAndroidTest.java:29)
我还从 repo 下载了最后一个版本,但没有任何变化...... 我将构建目标设置为 2.1update...
可能是什么?有人对这个库有任何经验吗?
提前致谢^^
干杯
【问题讨论】:
-
使用 tinypy 和 NDK 可能会更好。我确定部分 Java 运行时未实现(动态运行新代码)未在 Android 中实现
-
这不是我要找的东西,但无论如何是个好主意^^