damonkohler / sl4a

SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.
Apache License 2.0
2.42k stars 804 forks source link

Dalvik cache location problems on Cyanogen #216

Open damonkohler opened 9 years ago

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

User reported the following error on Cyanogen:

#  dalvikvm -classpath ruboto.jar org.jruby.Main -e "puts 'hello'"
Dalvik VM unable to locate class 'org/jruby/Main'
java.lang.NoClassDefFoundError: org.jruby.Main
       at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: org.jruby.Main in loader
dalvik.system.PathClassLoader[ruboto.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)

Original issue reported on code.google.com by damonkoh...@gmail.com on 6 Sep 2010 at 7:43

Copied from original issue: damonkohler/android-scripting#419

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

[deleted comment]
damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

I'm having the exact same problem in CyanogenMod 6 on my Motorola Milestone.  
Did a logcat and found the error here:

E/dalvikvm( 6771): Can't open dex cache 
'/data/dalvik-cache/mnt@sdcard@com.googlecode.jrubyforandroid@extras@jruby@jruby
-complete-1.4.jar@classes.dex': No such file or directory
I/dalvikvm( 6771): Unable to open or create cache for 
/mnt/sdcard/com.googlecode.jrubyforandroid/extras/jruby/jruby-complete-1.4.jar 
(/data/dalvik-cache/mnt@sdcard@com.googlecode.jrubyforandroid@extras@jruby@jruby
-complete-1.4.jar@classes.dex)

With Root Explorer, I searched /data/dalvik-cache and found that the 
classes.dex files for SL4A and JRuby for Android are now located under 
/mnt/asec instead of /mnt/sdcard.

Hope this helps.

Original comment by nolanhay...@gmail.com on 4 Oct 2010 at 6:10

Attachments:

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

Managed to get around this with a hacky fix, started by another issue filed 
related to this.

You need to extract classes.dex from the file 
com.googlecode.jrubyforandroid/extras/jruby/jruby-complete-1.4.jar on your SD 
card, then copy it to 
/data/dalvik-cache/mnt@sdcard@com.googlecode.jrubyforandroid@extras@jruby@jruby-
complete-1.4.jar@classes.dex

then you need to
chmod 0777 
/data/dalvik-cache/mnt@sdcard@com.googlecode.jrubyforandroid@extras@jruby@jruby-
complete-1.4.jar@classes.dex

this should work. if it doesn't, do an ls -lah | grep jrubyforandroid. You 
should see one other entry besides the file you copied. It should say "system" 
and "app_XX". You need to run "chown system:app_XX 
/data/dalvik-cache/mnt@sdcard@com.googlecode.jrubyforandroid@extras@jruby@jruby-
complete-1.4.jar@classes.dex" where app_XX contains the numbers listed on the 
output of ls -lah.

JRuby is working again on my HTC Dream running CM6. Unfortunately it's still 
unbearably slow, starting the Hello World toast application takes 20.seconds!

Original comment by Gary13...@gmail.com on 18 Oct 2010 at 12:29

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

Issue 411 has been merged into this issue.

Original comment by damonkoh...@gmail.com on 6 Nov 2010 at 9:21

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

Issue 389 has been merged into this issue.

Original comment by damonkoh...@gmail.com on 6 Nov 2010 at 9:22

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

Quote:

I think it may be a permissions issue. SL4A has root permissions, but may not 
be invoking BeanShell or Rhino as root.

If I open up a shell in SL4A and type the following command:

dalvikvm -classpath 
/mnt/sdcard/com.googlecode.bshforandroid/extras/bsh/bsh-2.0b4-dx.jar 
bsh.Interpreter

I get the same ClassNotFoundException as in the SL4A UI. However, if I su to 
root and execute, I get a nice BeanShell prompt. 

From the thread at:
http://forum.cyanogenmod.com/topic/8481-sl4a-not-working-on-cyanogen/page__gopid
__85433#entry85433

Original comment by rasha...@gmail.com on 7 Nov 2010 at 6:50

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

same problem with froydvillain 1.5 (android 2.2)

Original comment by matt.zuk...@gmail.com on 16 Nov 2010 at 5:15

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

originally ran into this with jruby but it looks like rhino is also affected

Original comment by matt.zuk...@gmail.com on 18 Nov 2010 at 6:40

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:27

i've reported this on CMs issue tracker, so star it up and/or add your comments

http://code.google.com/p/cyanogenmod/issues/detail?id=3141

Original comment by safest...@gmail.com on 13 Mar 2011 at 1:17