the_man_slim
the_man_slim

Reputation: 1215

Problems running Android emulator: "Warning: data partition already in use"

I seem to have some problems with the Android emulator. I followed all instructions to build it properly, and I can run the emulator like so:

emulator -sysdir out/target/product/generic/ \
 -system out/target/product/generic/system.img \
 -ramdisk out/target/product/generic/ramdisk.img \
 -kernel kernel-goldfish-xattr-2.6.29 \ 
 -sdcard tdroidsd.img -skindir development/tools/emulator/skins \
 -data out/target/product/generic/userdata.img \
 -skin WVGA800 \
 -memory 512 -partition-size 500

This works fine to launch the emulator. However, whenever I start it, I get the following warning:

WARNING: Data partition already in use. Changes will not persist!

This is a major pain because any application that I install disappears whenever I reboot or kill the emulator.

I see that there are numerous topics relating to this on stackoverflow, and I've checked the following:

I should note that I'm not using Eclipse in the slightest and that I am on a Linux machine (Gentoo).

Running with verbose shows the following:

emulator: autoconfig: -initdata out/target/product/generic/userdata.img
disk.ramdisk.path = out/target/product/generic/ramdisk.img
disk.systemPartition.initPath = out/target/product/generic/system.img
disk.systemPartition.size = 500m
disk.dataPartition.path = out/target/product/generic/out/target/product/generic/userdata.img
disk.dataPartition.size = 500m
avd.name = <build>

It appears that the disk.dataPartition.path setting is getting garbled somehow but I'm not sure why. I have the following in my .bashrc

 export PATH="~/bin:$PATH"
 export ANDROID_PRODUCT_OUT="~/tdroid/tdroid-4.1.1_r6/out/target/product/generic"
 export PATH="~/tdroid/tdroid-4.1.1_r6/system/core:$PATH"
 export ANDROID_BIN="~/tdroid/tdroid-4.1.1_r6/out/host/linux-x86/bin"
 export ANDROID_QTOOLS="~/tdroid/tdroid-4.1.1_r6/development/emulator/qtools"
 export ANDROID_TOOLCHAIN="~/tdroid/tdroid-4.1.1_r6/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin"
 export ANDROID_EABI_TOOLCHAIN="~/tdroid/tdroid-4.1.1_r6/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin"
 export ANDROID_HOST_OUT="~/tdroid/tdroid-4.1.1_r6/out/host/linux-x86"
 PATH=$ANDROID_BIN:$PATH
 PATH=$ANDROID_HOST_OUT:$PATH

If anyone can direct me through some of this mess I'd greatly appreciate it!

Upvotes: 3

Views: 3814

Answers (2)

Dave Rager
Dave Rager

Reputation: 8160

I found this question searching for the same issue. The garbled disk.dataPartition.path you mentioned led me to play around with the paths more. I dropped the sysdir path from the system.img and the userdata.img. Note the path is still needed for the ramdisk.img and sdcard.img. Once I made this change the error went away. Here's my updated script.

emulator \
   -sysdir img/ \
   -system system.img \
   -ramdisk img/ramdisk.img \
   -data userdata.img \
   -kernel prebuilts/qemu-kernel/arm/kernel-qemu-armv7 \
   -sdcard img/sdcard.img \
   -skindir sdk/emulator/skins \
   -skin WVGA800 \
   -memory 512 \
   -partition-size 1024

Upvotes: 1

Curro
Curro

Reputation: 1

I had the same problem, I solved it using relative path to sysdir for data argument.

Upvotes: 0

Related Questions