2013-02-19 5 views
2

이 가이드에 따라 Ubuntu x64에서 Dalvik VM을 빌드하고 실행하고 싶습니다 : PATH/TO/AOSP/dalvik/docs/hello-world.html.경로에서 클래스 "Foo"를 찾지 못했습니다 : DexPathList

내 코드 지점 & 호스트 시스템은 다음과 같이이다 :

============================================ 
PLATFORM_VERSION_CODENAME=AOSP 
PLATFORM_VERSION=4.2.1.2.4.8.16.32.64 
TARGET_PRODUCT=full_x86 
TARGET_BUILD_VARIANT=eng 
TARGET_BUILD_TYPE=release 
TARGET_BUILD_APPS= 
TARGET_ARCH=x86 
TARGET_ARCH_VARIANT=x86 
HOST_ARCH=x86 
HOST_OS=linux 
HOST_OS_EXTRA=Linux-3.0.0-28-generic-x86_64-with-Ubuntu-11.10-oneiric 
HOST_BUILD_TYPE=release 
BUILD_ID=OPENMASTER 
OUT_DIR=out 
============================================ 

첫째, 우분투에 달빅을 짓고 있어요 :

source build/envsetup.sh 
lunch 2[full_x86-eng] 
make dalvikvm core dexopt ext framework android.policy services 

는 그럼 난 자바 코드를 컴파일하고 패키지. 그 후

나는이 같은 실행하지만, 실패

[email protected]:~/dev/src/android/git/aosp$ ./rund -cp Foo.jar Foo 

어떤 몸이 몇 가지 단서를 줄 수 있습니까?

I/dalvikvm(10102): DexOpt: mismatch dep name: '/home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/framework/core.odex' vs. '/system/framework/core.odex' 
E/dalvikvm(10102): /home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/framework/ext.jar odex has stale dependencies 
I/dalvikvm(10102): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory 
I/dalvikvm(10102): DexOpt: mismatch dep name: '/home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/framework/core.odex' vs. '/system/framework/core.odex' 
E/dalvikvm(10102): /home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/framework/framework.jar odex has stale dependencies 
I/dalvikvm(10102): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory 
I/dalvikvm(10102): DexOpt: mismatch dep name: '/home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/framework/core.odex' vs. '/system/framework/core.odex' 
E/dalvikvm(10102): /home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/framework/android.policy.jar odex has stale dependencies 
I/dalvikvm(10102): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory 
I/dalvikvm(10102): DexOpt: mismatch dep name: '/home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/framework/core.odex' vs. '/system/framework/core.odex' 
E/dalvikvm(10102): /home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/framework/services.jar odex has stale dependencies 
I/dalvikvm(10102): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory 
E/dalvikvm(10105): execv '/home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/bin/dexopt' failed: No such file or directory 
W/dalvikvm(10102): DexOpt: --- END 'Foo.jar' --- status=0x0100, process failed 
E/dalvikvm(10102): Unable to extract+optimize DEX from 'Foo.jar' 
Dalvik VM unable to locate class 'Foo' 
W/dalvikvm(10102): threadid=1: thread exiting with uncaught exception (group=0xf5a1d9c8) 
java.lang.NoClassDefFoundError: Foo 
    at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "Foo" on path: DexPathList[[zip file "Foo.jar"],nativeLibraryDirectories=[/home/guohai/dev/src/android/git/aosp/out/target/product/generic_x86/system/lib]] 
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 
    ... 1 more 

답변

1

를 내 시작 스크립트의 ANDROID_ROOT이 작동 변경 후 : followes로

로그입니다. 해결 방법은 다음과 같습니다.

#!/bin/sh 

# base directory, at top of source tree; replace with absolute path 
base=`pwd` 

# configure root dir of interesting stuff 
root=$base/out/host/linux-x86 
export ANDROID_ROOT=$root 

# configure bootclasspath 
bootpath=$base/out/target/product/generic_x86/system/framework 
export BOOTCLASSPATH=$bootpath/core.jar:$bootpath/ext.jar:$bootpath/framework.jar:$bootpath/android.policy.jar:$bootpath/services.jar 

export LD_LIBRARY_PATH=$bootpath/lib:$LD_LIBRARY_PATH 

# this is where we create the dalvik-cache directory; make sure it exists 
export ANDROID_DATA=/tmp/dalvik_$USER 
mkdir -p $ANDROID_DATA/dalvik-cache 

exec $root/bin/dalvikvm -Xdexopt:none [email protected] 
관련 문제