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. AlertDialog and GLSurfaceView

Hi,

Could someone please advise if it is possible to add a GLSurfaceView
to an AlertDialog?  It seems to work fine with other types of View but
the GLSurfaceView seems to cause problems.  Maybe this is not
supported but the reference documentation doesn't appear to indicate
that only cetain types of View are supported?

Thanks.

-- 

2. Build broken after latest updates.

I accepted updates today including the HoneyComb SDKs and version 10
of the ADT plugin and DDMS.

Now all my builds in Eclipse are broken. They have hundreds of errors
saying that R cannot be resolved

I've already tried Project Clean, which is the only trick I know for
weird build errors.

The projects include a library project and two projects which depend
on it.

What magic do I have to do to make these things build again?

It would sure be disappointing to not make any more updates to my app
ever again.

Nathan

-- 

3. Starting an intent, then pressing the back button, how to resume the Handler that was running?

4. How to play sound again without delay?

5. on search button click in a tab, open a new tabview dynamically consisting mapview locating the location .

6. is SaveRestoreState.java in 2.2?

7. Toast not disappearing