当我尝试在模拟器上运行时,我遇到了应用程序大小的问题。我使用的图像目前占用 11MB 的空间。首先,启动模拟器时,上传文件需要大约一分钟,然后显示此错误:
[2011-10-24 11:29:50 - MyApp] Failed to install MyApp.apk on device 'emulator-5554': No space left on device
[2011-10-24 11:29:50 - MyApp] com.android.ddmlib.SyncException: No space left on device
[2011-10-24 11:29:50 - MyApp] Launch canceled!
当我查看文件夹时,应用程序的整个文件夹占用37MB。最大的一个是 /bin 文件夹。有两个文件 MyApp.apk (12MB) 和 resources.ap_(12 MB),在 bin/packagename/- 文件夹中向下一步,有 85 个文件,其名称类似于我的 StartActivity,从 Start$1.class 到 Start$85.class 计算。在我的 Start.java 中是主屏幕,其中显示了一些图像,但有很多带有意图的 onClickListeners。
这是正常现象还是可能是这个原因?
之前,我还遇到过一些其他错误,例如 INSTALL_FAILED_MEDIA_UNAVAILABLE 错误和 INSTALL_FAILED_INSUFFICIENT_STORAGE。
从那时起,我在 stackoverflow.com 上找到了一些线程,并且在模拟器设置中做了一些更改,例如在命令行中添加:
emulator.exe -avd 2TabGalaxy3.2GoogleAPI -partition-size 16384 -no-snapshot-load
(16384 可以吗?因为 1024mb 的大小不够)
我还检查“擦除用户数据”并编辑 AVD:
SD Card Size: 256MB
SD Card support : yes
Max VM application heap size: 192
Device Ram Size: 192
但我总是收到相同类型的错误,即空间不足。
有人知道解决办法吗?
我读到 apk 文件的最大大小为 50MB。这是正确的?
I'm having trouble with the size of my application when trying to run on the emulator. I'm using images that take, for now, 11MB of space. First, when starting the emulator, it takes almost a minute to upload the file, then this error is shown:
[2011-10-24 11:29:50 - MyApp] Failed to install MyApp.apk on device 'emulator-5554': No space left on device
[2011-10-24 11:29:50 - MyApp] com.android.ddmlib.SyncException: No space left on device
[2011-10-24 11:29:50 - MyApp] Launch canceled!
When I'm looking into my folder, the whole folder of the app takes 37MB. The biggest one is the /bin-folder. There are the two files MyApp.apk (12MB) and resources.ap_(12 MB) and, one step down in the bin/packagename/-folder, there are 85 files, named like my StartActivity, numerated from Start$1.class up to Start$85.class. In my Start.java is the HomeScreen, where some images are shown, but many many onClickListeners with Intents.
Is that normal or could this be the reason?
Before, I've got some other errors, like the INSTALL_FAILED_MEDIA_UNAVAILABLE error and INSTALL_FAILED_INSUFFICIENT_STORAGE.
Since then, I've found some threads on stackoverflow.com and I've done some changes in the emulator-settings, like adding in the commandline:
emulator.exe -avd 2TabGalaxy3.2GoogleAPI -partition-size 16384 -no-snapshot-load
(16384 is ok? cause 1024mb wouldn't be enough size)
I've also checked "Wipe User Data" and edited the AVD:
SD Card Size: 256MB
SD Card support : yes
Max VM application heap size: 192
Device Ram Size: 192
But I'm always getting the same types of errors, which say that there isn't enough space.
Anyone knows a solution?
I've read that the maximum size of the apk-file is 50MB. That's right?
发布评论
评论(2)
我认为您的模拟器上的空间可能已用完。
在我的模拟器中,我有大约 35mb 的可用空间。
我不确定这是否有帮助(但可以尝试一下:
您可以尝试更新清单文件,在清单标记中添加 android:installLocation="preferExternal" ,如下例所示:
这样,如果可用,您的应用程序应该是或者
您可以尝试按照此帖子操作:http://androidforums.com/desire-tips-tricks/160560-force-apps-install-sd-without-root.html 它解释了如何强制 android 安装所有软件包外部SD(这更像是一种解决方法)。
I think that probably you runned out of space on your emulator.
In my emulator i have ~35mb of free space.
I'm not sure if that help (but it could be a try:
You can try to update you manifest file adding android:installLocation="preferExternal" in the manifest tag like in this EXAMPLE:
In that way if available your application should be isntalled in the external SD Card.
Or you can try to follow this post: http://androidforums.com/desire-tips-tricks/160560-force-apps-install-sd-without-root.html it explains how to force android to install all packages on External SD (it is more a workaround).
所以,至少我不能说到底是什么错误,但 Ivan 和 Michell Bak 的提示结合起来对我有帮助。
我删除了旧的模拟器并创建了一个新的模拟器,其中我输入了 32 MB 作为 SD 卡的大小,添加到命令行的设备配置中
,并将其添加到 Android 清单中:
现在错误消失了。非常感谢!
So, at least I can't say what exactly has been the mistake, but a combination of Ivan's and Michell Bak's tips helped me.
I deleted the old emulators and created a new one, where I entered 32 MB for the size of the SD card, added in the device configurations in the command line
and added this in the Android Manifest:
Now the errors are gone. Thank you very much!