Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have the same problem that you have.</p> <p>The reason why I get the error "can't load this type of class file" is simple.</p> <p>In the platform source, "/dalvik/vm/native/java_lang_VMClassLoader.cpp" which is related to the method "defineClass" always returns exception as follows. (version: ICS)</p> <p>Finally, I reached the conclusion that I can't load .dex in byte array format.</p> <p>Is there anyone who can load .dex by using byte array? (not using files)</p> <pre><code>/* * static Class defineClass(ClassLoader cl, String name, * byte[] data, int offset, int len) * throws ClassFormatError * * Convert an array of bytes to a Class object. */ static void Dalvik_java_lang_VMClassLoader_defineClass(const u4* args, JValue* pResult) { Object* loader = (Object*) args[0]; StringObject* nameObj = (StringObject*) args[1]; const u1* data = (const u1*) args[2]; int offset = args[3]; int len = args[4]; char* name = NULL; name = dvmCreateCstrFromString(nameObj); ALOGE("ERROR: defineClass(%p, %s, %p, %d, %d)", loader, name, data, offset, len); dvmThrowUnsupportedOperationException( "can't load this type of class file"); free(name); RETURN_VOID(); } /* * static Class defineClass(ClassLoader cl, byte[] data, int offset, * int len) * throws ClassFormatError * * Convert an array of bytes to a Class object. Deprecated version of * previous method, lacks name parameter. */ static void Dalvik_java_lang_VMClassLoader_defineClass2(const u4* args, JValue* pResult) { Object* loader = (Object*) args[0]; const u1* data = (const u1*) args[1]; int offset = args[2]; int len = args[3]; ALOGE("ERROR: defineClass(%p, %p, %d, %d)", loader, data, offset, len); dvmThrowUnsupportedOperationException( "can't load this type of class file"); RETURN_VOID(); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload