DexClassLoader를 통해 외부 라이브러리를로드하려고하는 프로젝트에서 작업하고 있습니다. 이것은 2.3에서 아주 잘 작동 :Android Honeycomb의 DexClassLoader
02-23 09:30:58.221: ERROR/dalvikvm(8022): Can't open dex cache '/data/
dalvik-cache/
[email protected]@[email protected]@[email protected]':
No such file or directory
02-23 09:30:58.221: INFO/dalvikvm(8022): Unable to open or create
cache for /data/data/at.mSystem.client/files/
mSystem_Client_FormularLibrary.jar (/data/dalvik-cache/
[email protected]@[email protected]@[email protected])
02-23 09:30:58.231: WARN/System.err(8022):
java.lang.ClassNotFoundException:
at.mSystem.client.formular.contract.ContractListFormularDisplay in
loader [email protected]
02-23 09:30:58.241: WARN/System.err(8022): at
dalvik.system.DexClassLoader.findClass(DexClassLoader.java:240)
02-23 09:30:58.241: WARN/System.err(8022): at
java.lang.ClassLoader.loadClass(ClassLoader.java:548)
02-23 09:30:58.261: WARN/System.err(8022): at
java.lang.ClassLoader.loadClass(ClassLoader.java:508)
02-23 09:30:58.261: WARN/System.err(8022): at
at.mSystem.client.system.formularmodule.formular.FormularDisplayLoader.getDisplay(FormularDisplayLoader.java:
35)
: 포트에 벌집이 응용 프로그램을 시도 할 때 (이 응용 프로그램에 대한 실제 대상이 태블릿이기 때문에)
public class FormularDisplayLoader {
public final static String PATH ="/data/data/at.mSystem.client/files/mSystem_Client_FormularLibrary.jar";
private DexClassLoader classLoader;
public FormularDisplayLoader(Context context){
this.context = context;
this.classLoader = new DexClassLoader("/data/data/at.mSystem.client/
files/mSystem_Client_FormularLibrary.jar",
context.getFilesDir().getAbsolutePath(),
null,
FormularDisplayLoader.class.getClassLoader());
}
public View getDisplay(String className) throws ErrorCodeException{
try {
Class c = classLoader.loadClass(className);
Method m = c.getMethod("getDisplay", Context.class);
View ret = (View) m.invoke(c.newInstance(), context);
return ret;
} catch (Exception e) {
e.printStackTrace();
throw new
ErrorCodeException(FormularErrorCode.NO_DISPLAY_AVAILABLE_FOR_FORMULAR);
}
}
}
를 불행하게도, DexClassLoader는 예외가 발생합니다 내 예제에서 (dexOutputDir)의 context.getFilesDir(). getAbsolutePath() 값이 "/ data/data/ at.mSystem.client/files"이므로 DexClassLoader가 두 번째 매개 변수를 무시하는 것처럼 보입니다.
해결 방법에 대해 알고 싶습니까? 아니면 이런 종류의 벌집 버그입니까 ?
감사, 변경 내역을 보면
롤랜드
답변이 없지만 동일한 문제가 발생하고 있음을 알려 드리고자합니다. – gotosleep
Android의 문제 추적기에 티켓을 개설했습니다. http://code.google.com/p/android/issues/detail?id=15893 – gotosleep
당일에 Google에 제출 한 사람이 '그래, 내부 버그 3439372. 예약 됨 Honeycomb의 다음 정비 릴리스 " –