PathClassLoader failed in SDK 1.0, worked in 0.9

by Dana Li » Fri, 26 Sep 2008 14:47:34 GMT


Sponsored Links
 Hi, We had used the PathClassLoader to load class from a dynamically loaded
apk file, however, it worked in SDK 0.9 but failed in SDK 1.0. Not sure what
is the reason, Anybody has any clue on it ?

The error message is something like:

09-26 00:03:34.928: ERROR/dalvikvm(312): Can't open dex cache
'/data/dalvik-cache/[EMAIL PROTECTED]@classes.dex': No such file or directory
09-26 00:03:34.928: INFO/dalvikvm(312): Unable to open or create cache for
/data/data/....................apk'

We tried to wiped out the emulator and signed the new apk and both failed.

Any clue?

Googling gave me we are not alone, somebody also said it broke his code
---------------------------------------
In SDK 0.9 my coding is work fine... but when I port it to SDK 1.0...
I having some problem below...

can anyone guide me to port it???

1) PathClassLoader loader = new PathClassLoader(
"/data/data/org.beo/beo.mylib/myLib.apk",
ClassLoader.getSystemClassLoader());

Class calledClass = null;

calledClass = loader.loadClass("beo.mylib.beoware");

I fail to load into system...

-------------------------------

Appreciate any hint or help. It's so bad that Android is not open source !
Everything is in a black hole......

Dana Li

--~--~---------~--~----~------------~-------~--~----~



PathClassLoader failed in SDK 1.0, worked in 0.9

by Wesley » Fri, 26 Sep 2008 15:41:31 GMT


 hi,

FYI,

I working on this since the 1st sdk release last year Dec...
Now I cannot make any further progress because of this problem... and yet...

no one is offer any solution or any guide for me...

I also dunno what can I do next...
one error, destroy my idea of my whole year project...
haiz...

I try to load class by using defineClass method... dalvikvm give an error of
defineClass and unsupportedTypeClass exception...

any others suggestion for me...??? any idea how to load class...??? just a
simple one will do... others error I can try to figure out by myself...

I just need a light...


wesley.





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


PathClassLoader failed in SDK 1.0, worked in 0.9

by Lia » Fri, 26 Sep 2008 20:54:04 GMT


 Hi,

I was experiencing something similar, when porting from SDK 0.9 to
1.0.
I got error ".....Can't open dex cache  ..... Unable to open or create
cache for......" when loading custom classes with DexFile.
I solved the problem in my environment by simply starting the abd
console and changing rights in the cache folder:
    cd /data/dalvik-cache/
    chmod 777 .
Hope this helps.

                     Cheers,
                     Lia.

--~--~---------~--~----~------------~-------~--~----~



PathClassLoader failed in SDK 1.0, worked in 0.9

by Dana Li » Sat, 27 Sep 2008 06:39:11 GMT


 Thanks Lia, it seems to be working. Is this a bug in the SDK or
intentionally?

DL






-- 
Dana

--~--~---------~--~----~------------~-------~--~----~



PathClassLoader failed in SDK 1.0, worked in 0.9

by Wesley » Tue, 30 Sep 2008 13:48:59 GMT


 hi Lia,

Thanks for the guide... It's worked (/data/dalvik-cache/)... but now...

may I ask one more questions???

if I got the error below, how??? I try to change mode(chmod 777) is not
working...

09-30 05:41:09.305: INFO/WESLEY(2340): java.io.IOException: Couldn't open
/data/data/com.basic.ui/cache_/widget.xml

thanks agains...



wesley.





--~--~---------~--~----~------------~-------~--~----~



PathClassLoader failed in SDK 1.0, worked in 0.9

by MoggoDude » Thu, 16 Oct 2008 18:27:37 GMT


 



My application relies on dynamic loading of classes using
PathClassLoader as well. My
main concern is the permissions that are going to be set on /data/
dalvic-cache in a
target device, such as the new HTC G1 phone. If the permissions are
the same as in the
emulator, very high chance that users will not be able to shell in an
issue chmod 777
commands (can't expect users to perform such tasks either). This would
render our
application inoperable. I am going to do some more research, try and
find out what the
permissions on the /data/dalvic-cache in HTC G1 will be. If I find out
any info, I'll
post it in this blog.

Cheers,
      MoggoDude
--~--~---------~--~----~------------~-------~--~----~



PathClassLoader failed in SDK 1.0, worked in 0.9

by MoggoDude » Wed, 22 Oct 2008 14:45:44 GMT


 Hi Guys,
        Just sending this update on the PathClassLoader problem. I
started a blog in the android-internals group,



PathClassLoader failed in SDK 1.0, worked in 0.9

by Wesley » Wed, 22 Oct 2008 15:48:28 GMT


 hi,

sound bad...
if this is the case means my app/idea is not going to work????


wesley.




> 



PathClassLoader failed in SDK 1.0, worked in 0.9

by Daniel Janev » Thu, 30 Oct 2008 23:30:45 GMT


 


> >



Other Threads

1. problem with displaying path (urgent)

Hi every body

I wrote an application which contains a list view, when i click on
list my application will move to another list when i click on that
list it will move to another activity like that my application will
work. Now my problem is i would like to display the path on the top of
my application means that iam in this acativity like that

eg: list 1(main activity) when i click on list it is moving to another
list (next activity) when i click on that list it will move to another
activity, now i have to display path as shown in bracket (/main
activity/secondactivity/another activity) if i come back from third
activity to second activity my path also need to changed dynamically.

can any one help me to get rid of this problem.

thank you
sabs

--

2. Dynamic Spinner

Hi,
I am working on android i am able to draw simple spinner.
But my application needs dynamic spinner mean in a one view there may
be one or four spinner need it depends upon application needs.
So how we can draw dynamic Spinner without using XML.

Thanks & Regards
Vilas Talewale

--

3. how to save xml file in android

4. String arrays do not allow illegal java names as values.

5. Services, Intents and Wakelocks

6. Recording from MIC (merry xmas everyone)

7. To Stop or lock an app for a particular time