将 Eclipse 用于 androidSDK,当我开始运行时,我收到警告:数据分区已在使用中。改变不会持久!

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6854262/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:43:26  来源:igfitidea点击:

Using Eclipse for androidSDK, when I go to run, I get WARNING: Data partition already in use. Changes will not persist!

javaandroideclipse

提问by JiminyCricket

I am completely new to Java, and Android, and eclipse. When doing the initial Hello, Android tutorial, I go to run and get the following:

我对 Java、Android 和 Eclipse 完全陌生。在做最初的你好,Android 教程时,我去运行并得到以下内容:

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

回答by john-w

Goto DDMS perspective, click on the down arrow next to the screen capture camera icon and select reset adb from the dropdown menu.

转到 DDMS 透视图,单击屏幕捕获相机图标旁边的向下箭头,然后从下拉菜单中选择重置 adb。

My apk file was not deploying either, resetting adb sorted it out. :)

我的 apk 文件也没有部署,重置 adb 将其整理出来。:)

回答by Thomas

Even easier fix: In Windows open command prompt (cmd.exe). In Linux open Terminal. Locate adb.exein SDK folder ..\android-sdk\platform-tools\abd.exe

更简单的修复:在 Windows 中打开命令提示符 (cmd.exe)。在 Linux 中打开终端。adb.exe在 SDK 文件夹中找到..\android-sdk\platform-tools\abd.exe

cd <sdk directory> (move to the folder listed above)
dir (to make sure abd.exe is in that directory)
adb kill-server (stop the abd service, won't return anything)
adb start-server (start the abd service back up, should give a couple of readings)

Then retest, problem solved!

然后重新测试,问题解决!

回答by Arrch

I just had the same problem, that's why I found myself here.

我只是遇到了同样的问题,这就是我发现自己在这里的原因。

What I did is to run cmd then adb kill-server, then open task manager in windows and kill the emulator-x86.exe process. Then re-run the project, it should work fine.

我所做的是运行 cmd 然后 adb kill-server,然后在 Windows 中打开任务管理器并杀死 emulator-x86.exe 进程。然后重新运行项目,它应该可以正常工作。

I guess adb kill-server isn't even necessary.

我想 adb kill-server 甚至没有必要。

回答by VonC

If you consider this tutorial about "Read/Write Android Emulator sdcard.img in Windows", check that this virtual disk isn't somehow already mounted:

如果您考虑有关“在 Windows 中读取/写入 Android 模拟器 sdcard.img”的教程,请检查此虚拟磁盘是否尚未安装:

mounting image disk

挂载镜像盘

If ImDisk complains of the file being in use, close the emulator.
They won't run together.
Unmounting the image in Android does not allow the image to be mounted in Windows, the emulator must be shut down in order to free the image from its locked state

如果 ImDisk 抱怨文件正在使用中,请关闭模拟器。
他们不会一起跑。
在 Android 中卸载映像不允许在 Windows 中挂载映像,必须关闭模拟器才能将映像从锁定状态中释放出来

The OP JiminyCricketconfirms it was some kind of "resource lock":

OP JiminyCricket确认这是某种“资源锁”的:

Simple restart of my OS fixed it. Thanks!

简单重启我的操作系统就修复了它。谢谢!

回答by Sterling Diaz

Delete that AVD and create a new one. That worked for me, and it's the simplest way, with no configuration at all.

删除那个 AVD 并创建一个新的。这对我有用,而且是最简单的方法,根本不需要配置。

回答by vinsoft

Delete pid file from all blow directories
.android\avd\[your_device].avd\cache.img.lock &
hardware-qemu.ini.lock &
sdcard.img.lock &
userdata-qemu.img.lock directories

Then start AVD.

回答by Kathirvel

Just Restart Your Android SDK and Eclipse If it not works even restarting PC just delete that Android virtual device and create new one using AVD.

只需重新启动您的 Android SDK 和 Eclipse 如果即使重新启动 PC 也不起作用,只需删除该 Android 虚拟设备并使用 AVD 创建新的虚拟设备。

Hope It Helps !!

希望能帮助到你 !!

回答by Mohsen

Make sure that no proxy software is preventing Eclipse from connecting to the internet.

确保没有代理软件阻止 Eclipse 连接到 Internet。

My problem was solved by doing this!

我的问题通过这样做解决了!

回答by BurninLeo

For me it worked to simply create a new virtual Android device in the Eclipse -> Window -> AVD Manager.

对我来说,只需在 Eclipse -> Window -> AVD Manager 中创建一个新的虚拟 Android 设备即可。

回答by user1375987

One solution for this is to simply clean your projects. From the menu PROJECT>CLEAN...Clean All projects.

对此的一种解决方案是简单地清理您的项目。从菜单 PROJECT>CLEAN...清除所有项目。

This worked for me when rebooting eclipse did not.

当重新启动 eclipse 没有时,这对我有用。

I take it back... this was temporary and incomplete. Even rebooting my eclipse and my system did not help until I killed the adb service, restarted it per the suggestions here. Now everything seems clean (knock on wood)

我收回...这是暂时的和不完整的。即使重新启动我的 eclipse 和我的系统也没有帮助,直到我杀死了 adb 服务,按照这里的建议重新启动它。现在一切看起来都很干净(敲木头)