Android 模拟器上没有剩余空间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2332797/
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
No space left on Android Emulator
提问by Tom
I have been developing my app for around two months, in the last week i have started getting the following error when trying to compile and run the app from Eclipse:
我已经开发了大约两个月的应用程序,上周我在尝试从 Eclipse 编译和运行应用程序时开始收到以下错误:
java.io.IOException: Unable to upload file: No space left on device
The APK comes out at 3.6Mb and the emulator is a recently created fresh one with 512Mb SD card and other specs identical to the G1.
APK 的大小为 3.6Mb,模拟器是最近创建的新模拟器,带有 512Mb SD 卡和与 G1 相同的其他规格。
Can anyone suggest a reason this might be happening?
任何人都可以提出可能发生这种情况的原因吗?
采纳答案by jeffgzx9
I've had that happen before, and I solved it by creating a new virtual device as Mr. Hedlund suggests. I didn't spend time trying to figure out why it happened, but creating the new device allowed my app to upload. My application is nearly twice as big as yours, and it uploads fine most of the time. Try deleting and re-creating the emulator as Mr. Hedlund suggests. It's worked for me on several occasions... Being new at Android development, I'm suspicious that I've been running into that issue due to resource leaks, but I haven't chased the problem down yet because I'm still concentrating on getting my app to work correctly... Hope this helps!
我以前遇到过这种情况,我按照 Hedlund 先生的建议创建了一个新的虚拟设备来解决它。我没有花时间去弄清楚为什么会发生这种情况,但是创建新设备允许我的应用程序上传。我的应用程序几乎是你的两倍大,而且大部分时间都可以正常上传。尝试按照 Hedlund 先生的建议删除并重新创建模拟器。它对我有用过几次......作为Android开发的新手,我怀疑由于资源泄漏我一直在遇到这个问题,但我还没有解决这个问题,因为我仍然集中注意力让我的应用程序正常工作...希望这会有所帮助!
回答by Mudit Jain
The apps are installed in /data/apps. Make sure that your data partition size is big enough to support your app. The command for running the emulator will be
应用程序安装在 /data/apps 中。确保您的数据分区大小足以支持您的应用程序。运行模拟器的命令将是
emulator.exe -avd <AvdName> -partition-size 512 -no-snapshot-load
Partition size will set size of system and data images in MB. You can change 512 to a greater value depending on your needs. -no-snapshot-load ensures that you are not booting from a snapshot and thus you see the new partition size.
分区大小将以 MB 为单位设置系统和数据映像的大小。您可以根据需要将 512 更改为更大的值。-no-snapshot-load 确保您不是从快照启动,因此您会看到新的分区大小。
回答by Jay Bhaskar
wipe data from avd manager. it will fix the problem. for visual assistance you can follow http://wikistack.com/no-space-left-on-device-android-studio/
从 avd 管理器中擦除数据。它将解决问题。如需视觉帮助,您可以关注http://wikistack.com/no-space-left-on-device-android-studio/
回答by Ali Ashraf
This happens because, you dont have free space in the drive where you are creating your Emulator, try deleting few items of that drive and it would get launched, make sure you have 1 gb (for precautions) data free in the drive. It worked for me
发生这种情况是因为,您在创建模拟器的驱动器中没有可用空间,请尝试删除该驱动器的几个项目,它会启动,确保驱动器中有 1 GB(为预防措施)可用数据。它对我有用
回答by Jason Shah
I encountered this issue as well. After recreating the AVD multiple times and still encountering the failure, I double-checked the size of the .apk. It had ballooned to 46MB because I accidentally included a set of camera images in the 'assets' folder. After removing those, the size dropped to <1MB. Make sure to double (and triple) check that you only have the files you need in the directory structure.
我也遇到了这个问题。在多次重新创建 AVD 仍然遇到失败后,我再次检查了 .apk 的大小。它已经膨胀到 46MB,因为我不小心在“资产”文件夹中包含了一组相机图像。删除这些后,大小下降到 <1MB。确保双重(和三次)检查目录结构中是否只有您需要的文件。
回答by dxh
Applications are not stored on the SD card, so that should not be a part of the equation. I've never seen a device fill upp like that, but just create a new virtual device, I guess...?
应用程序不存储在 SD 卡上,因此不应将其作为等式的一部分。我从来没有见过像这样填充的设备,但我想只是创建一个新的虚拟设备......?