android - android构建后无法运行模拟器

标签 android linux android-emulator

我一直在尝试在构建 android 源代码后运行 android 模拟器,但我做不到。这是我所做的:

$ source build/envsetup.sh
$ lunch full-eng
$ make -j4

构建运行良好,但之后我无法运行模拟器。

$ emulator
emulator: ERROR: No initial system image for this configuration!

根据我的阅读,应该运行的模拟器应该在 out/host/linux-x86/bin/ 但是里面没有 emulator 可执行文件目录。所以我认为它试图启动错误的模拟器?

$ which emulator
/home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64/emulator

$ env | grep ANDROID
ANDROID_DEV_SCRIPTS=/home/kyle/AndroidSourceRepo/development/scripts:/home/kyle/AndroidSourc eRepo/prebuilts/devtools/tools
ANDROID_PRE_BUILD_PATHS=/usr/lib/jvm/java-7-openjdk-amd64/bin:
ANDROID_PRODUCT_OUT=/home/kyle/AndroidSourceRepo/out/target/product/generic
ANDROID_JAVA_TOOLCHAIN=/usr/lib/jvm/java-7-openjdk-amd64/bin
ANDROID_BUILD_TOP=/home/kyle/AndroidSourceRepo
ANDROID_BUILD_PATHS=/home/kyle/AndroidSourceRepo/out/host/linux-x86/bin:/home/kyle/AndroidSourceRepo/development/emulator/qtools:/home/kyle/AndroidSourceRepo/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin:/home/kyle/AndroidSourceRepo/prebuilts/gcc/linux-x86/:/home/kyle/AndroidSourceRepo/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin:/home/kyle/AndroidSourceRepo/development/scripts:/home/kyle/AndroidSourceRepo/prebuilts/devtools/tools:/home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64:
ANDROID_QTOOLS=/home/kyle/AndroidSourceRepo/development/emulator/qtools
ANDROID_TOOLCHAIN=/home/kyle/AndroidSourceRepo/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin
ANDROID_TOOLCHAIN_2ND_ARCH=/home/kyle/AndroidSourceRepo/prebuilts/gcc/linux-x86/
ANDROID_EMULATOR_PREBUILTS=/home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64
ANDROID_HOST_OUT=/home/kyle/AndroidSourceRepo/out/host/linux-x86
ANDROID_SET_JAVA_HOME=true

有什么建议吗?

$ emulator -verbose
emulator:Found ANDROID_PRODUCT_OUT: /home/kyle/AndroidSourceRepo/out/target/product/generic
emulator: Cannot find build properties file: /home/kyle/AndroidSourceRepo/out/target/product/generic/system/build.prop

emulator:Found build target architecture: <NULL>
emulator:Can't determine target AVD architecture: defaulting to arm
emulator:Using emulator-arm to emulate 'arm' CPUs
emulator:Found target-specific emulator binary: /home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64/emulator64-arm
emulator:Probing for: /home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64/libOpenglRender.so
emulator:Probing for: /home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64/lib/libOpenglRender.so
emulator:Probing for: /home/kyle/AndroidSourceRepo/prebuilts/android-emulator/lib/libOpenglRender.so
emulator:Probing for: /home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64/lib64OpenglRender.so
emulator:Probing for: /home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64/lib/lib64OpenglRender.so
emulator:Found OpenGLES emulation libraries in /home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64/lib
emulator:Setting LD_LIBRARY_PATH=/home/kyle/AndroidSourceRepo/prebuilts/android-emulator/linux-x86_64/lib:/opt/ros/hydro/lib:/opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/mpirt/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/ipp/../compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/ipp/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/tbb/lib/intel64/gcc4.4
emulator: found Android build root: /home/kyle/AndroidSourceRepo
emulator: found Android build out:  /home/kyle/AndroidSourceRepo/out/target/product/generic
emulator: Cannot find build properties file: /home/kyle/AndroidSourceRepo/out/target/product/generic/system/build.prop

emulator: Cannot find boot properties file: /home/kyle/AndroidSourceRepo/out/target/product/generic/boot.prop

emulator: Cannot find target CPU architecture, defaulting to 'arm'
emulator: Cannot find target CPU ABI, defaulting to 'armeabi'
emulator: Could not find target API sdkVersion / SDK version in build properties!
emulator: Default target API sdkVersion: 10000
emulator: using core hw config path: /home/kyle/AndroidSourceRepo/out/target/product/generic/hardware-qemu.ini
emulator: found skin-specific hardware.ini: /home/kyle/AndroidSourceRepo/development/tools/emulator/skins/HVGA/hardware.ini
emulator: autoconfig: -skin HVGA
emulator: autoconfig: -skindir /home/kyle/AndroidSourceRepo/development/tools/emulator/skins
emulator: found skin-specific hardware.ini: /home/kyle/AndroidSourceRepo/development/tools/emulator/skins/HVGA/hardware.ini
emulator: keyset loaded from: /home/kyle/.android/default.keyset
emulator: trying to load skin file '/home/kyle/AndroidSourceRepo/development/tools/emulator/skins/HVGA/layout'
emulator: skin network speed: 'full'
emulator: skin network delay: 'none'
emulator: autoconfig: -kernel /home/kyle/AndroidSourceRepo/prebuilts/qemu-kernel/arm/kernel-qemu
emulator: WARNING: Could not determine kernel device naming scheme. Assuming legacy
If this AVD doesn't boot, and uses a recent kernel (3.10 or above) try setting
'kernel.newDeviceNaming' to 'yes' in its configuration.

emulator: autoconfig: -ramdisk (null)
emulator: autoconfig: -sysdir /home/kyle/AndroidSourceRepo/out/target/product/generic
emulator: ERROR: No initial system image for this configuration!
[1]+  Done                    emulator -avd avd1

看起来有些文件丢失了,但我不确定如果源代码构建成功,为什么会发生这种情况?

最佳答案

我无法在本地复制这个。您确定完整构建已成功完成吗?

如果构建在最终系统镜像完成之前中断,则可以解释错误。

尝试使用 -verbose 选项(即“emulator -verbose”),这将打印模拟器正在做什么/它正在探测哪些文件,并提供有关错误的更多详细信息。

关于android - android构建后无法运行模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23850662/

相关文章:

java - 在没有支持库的情况下使用 FragmentStatePagerAdapter

android - Android 中的 AdMob Facebook 中介无法正常工作

linux - 如何在没有 XML 解析器的情况下使用 shell 脚本根据模式获取子字符串

android - 来自 Android 模拟器的 VPN 连接失败

Android Studio 卡住 'Connecting to emulator'

java - 从 Fragment 类外部更新 View 的 arrayAdapter

android - 从 adb 在后台运行 logcat

linux -/dev/input 文件已创建,但不包含数据流

regex - 两个看似相同的 sed 命令,一个有效,另一个无效。你能告诉我为什么吗?

android - 在 Android 模拟器中模拟 NFC 标签