new to Android, I’ve tried this on an emulator, and my Google Nexus One, but every time it gets to the “Pushing To Device” part of the build, I’m presented with the following error message.
Unable to install APK!
failed to copy 'Package.apk' to '/data/local/tmp/Package.apk': No space left on device
UnityEngine.Debug:LogError(Object)
PostProcessAndroidPlayer:UploadAndStartPlayer(String, String, String, String, String, Boolean, Single, Single, Boolean)
PostProcessAndroidPlayer:PostProcess(BuildTarget, String, String, String, String, String, String, BuildOptions)
UnityEditor.HostView:OnGUI()
The game is around 220MB, but I have a 2GB SD Card in my nexus one? Very, very confused.
Any suggestions?
Thanks.
PS - Tried it on the TouchPhases unity example and it builds fine, its just our main game we’re having problems with. Is there a problem with games that are bigger than 200MB?
Try formatting the card from the phone. Sometimes mine gets corrupt or something, and thinks it’s out of space. I think it may have to do with not ejecting it properly or something.
is the game set to install to SD?
Is your nexus on android 2.2+ so install to SD is present at all?
Otherwise it will not install anymore as you lack the required space to install. with all above given the install to the internal should be in the range of 10mb at max if I recall right with the rest being on the SD (the program executable code and startup data always need to be on the internal, applications can not be purely SD … the crux of HTC Desire and the reason I still hate HTC as even their sensation has gimicky internal storage sizes compared to the first generation iphone or the first generation wp7 devices)
If i remember correctly, the Apk is first pushed in the internal memory prior to installation on SD Card. Most smartphones. When you push the game to the device you usually get a message like
As you can see on th eerror message, its pushing the APK file first into internal memory
Unable to install APK!
failed to copy ‘Package.apk’ to ‘/data/local/tmp/Package.apk’: No space left on device
It’s unlikely that your N1 has enough space on it’s data partition. Anyway, you wouldn’t be able to upload/publish an APK that big in the Android Market, as it’s limited to 50 MB. You need Unity Pro + Unity Android Pro and make the base game small (preferably below 30 MB) and download the asset bundle on the SD Card directly.
There are some devices that have problems with APK files bigger than ~25-30 MB (i.e. HTC Desire, which has only 40 MB cache partition, which is usually filled with some other stuff, in my case (even though it was a custom rom) there were parts of dalvik cache, taking 17 MB, so only 23 MB left for downloads/installs and everything that was 25 MB or more failed back then until I flashed a A2SD+ ROM which moved huge parts of the internal stuff onto a SD card. Works only on rooted/customized phones, so unlikely 90% of your players will have this.
thanks for your responses. Turns out Tseng nailed it here. I came to this realisation too. Had to strip down a game from 200MB down to 47MB to get it to work correctly.
Android really does have a stupid installation process. What is the point of buying external storage if you still need to install to the internal memory first?
Anyway, got it to work by reducing the file size to below 50MB. Though that does have many implications for future projects.