但是,我的Foo程序没有运行; dalvikvm抱怨如下:
Dalvik VM unable to locate class ‘Foo’
java.lang.NoClassDefFoundError: Foo
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Foo in loader dalvik.system.PathClassLoader[/mnt/sdcard/foo.jar]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
… 1 more
在dalvikvm调用期间,Logcat提供了更多信息:
D/dalvikvm( 1361): creating instr width table
E/dalvikvm( 1361): Can’t open dex cache ‘/data/dalvik-cache/mnt@sdcard@foo.jar@classes.dex’: No such file or directory
I/dalvikvm( 1361): Unable to open or create cache for /mnt/sdcard/foo.jar (/data
/dalvik-cache/mnt@sdcard@foo.jar@classes.dex)
W/dalvikvm( 1361): threadid=1: thread exiting with uncaught exception (group=0x4
001e9a8)
有没有人知道我做错了什么?
解决方法
It’s trying to create a .odex file in /data/dalvik-cache. You’ll
need to be running as root,or have an unprotected
/data/dalvik-cache.
一旦我植入我的设备(例如使用SuperOneClick),它就可以了!
@domen的评论:你实际上不必是root.您可以设置ANDROID_DATA环境变量,它会将缓存放在那里.即mkdir / data / local / tmp / dalvik-cache,export ANDROID_DATA = / data / local / tmp.