INSTALL_FAILED_INSUFFICIENT_STORAGE

Monkey Forums/Monkey Bug Reports/INSTALL_FAILED_INSUFFICIENT_STORAGE

Midimaster(Posted 2013) [#1]
since I updated to V69 I get this error messages at the end of the build process, when the previous build had an error and crashed on the smartphone.

The message is strange, because the apps are very small and cannot really cause an "out of memory" problem. And all other functions and apps of the smartphone work perfect.

After a message like this I always have to restart the smartphone to be able to install any further builds.



install:
     [echo] Installing C:\Monkey\ScoreTrainer\TestDpi.build\android\bin\MonkeyGame-debug.apk onto default emulator or device...
     [exec] 	pkg: /data/local/tmp/MonkeyGame-debug.apk
     [exec] Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
     [exec] 3403 KB/s (54453 bytes in 0.015s)



bram(Posted 2013) [#2]
It sounds like a locked file issue. Maybe the App is still open, and you should shut it down with a task manager?


marksibly(Posted 2013) [#3]
First google result is: http://stackoverflow.com/questions/4709137/solution-android-install-failed-insufficient-storage-error

Sounds like a common problem, but I'm not sure what Monkey can do to help.


Midimaster(Posted 2013) [#4]
I know this google results. But I never got this problem with V66. And it cannot really be caused by "insufficient storage" or the question of use of internal or external space. There is a lot of space on both.

For me it feels like a problem with the the "build protocol". Do you reserve any further space except the app's?

I will test, if I can install any app (f.e. from folder "downloads") in those moments. I think it is only impossible for the monkey builder.


marksibly(Posted 2013) [#5]
> And it cannot really be caused by "insufficient storage" or the question of use of internal or external space.

To me it sounds like yet another bit of 'weirdness' in Android...an intermittent problem without any apparent cause.

Have you tried looking for a bunch of tmp log files, as per the SO thread? I know it *shouldn't* matter if the device reports XYZ space available, but if it fixes the problem for someone, it's worth a shot - and there are a few things to try in that thread.

>For me it feels like a problem with the the "build protocol". Do you reserve any further space except the app's?

The build process for Android hasn't changed for many versions now, and it'd doesn't 'reserve space' or anything like that.

But you haven't really given me much to go on - "it doesn't work" alone is kind of hard to work with.

Have you 'tweaked' the target in any way - eg: edited the manifest?

Does it happen with bananas samples?

What device are you using?

Can you post an apk somewhere for people/me to try?

[edit]The only thing I can find in the manifest that may affect this is installLocation="auto", but that's been there for ages and sounds right to me.[/edit]


Midimaster(Posted 2013) [#6]
As long as nobody else reports this problem, it looks like a problem only on my target. I did want to publish this message for testing this...

The cause is 100% clear. It is caused by any bug in my code. If the previous build was finished by a crash or with any error message, there is no chance to do any other build.

"tmp log files"? "SO thread"? What is this?

I have not more than the 5 lines above. The build process runs perfect, there is only this message, which prevents from installing the app on the device.

It happens after any error message. So the banana samples never run into this, but if I add a minimal bug into the files and start the resulting app, the further build of any file, also perfect ones, will stop with the lines above.

There is no need to change the manifest. It has nothing to do with the "installLocation". I tested all combinations.... It depents not on a certain apk...

The device is a "Samsung Galaxy S5300 Android 2.3.6"

I'm not very firm in debugging or log things on android. If you tell me what to do, I will do the tests on my device...

I can live with this "behavior". But perhaps we find somebody else, who has this problem too...

thank you


bram(Posted 2013) [#7]
I have a Samsung phone, too. I had a problem where my device went offline after a while. I could check this by starting 'adb devices' from a command prompt. Basically, the build succeeded, but I wasn't able to install the apk on my device. On forums people suggested to use another (non-Samsung) USB cable. That didn't work for me. I now build to my Dropbox folder, and on my device (S2), I install the .apk directly from Dropbox. It works nicely, and I don't need a cable at all anymore.


MikeHart(Posted 2013) [#8]
Midimaster, I experience the same errors with my HTC Desire with 2.3.x on it. After I have upgraded to this version, installing market apps on my phone is like a lottery game. And that has nothing to do with Monkey. Even I seem to have enough ram, the installation fails 4 out of 5 times because of surposingly not enough ram.

What I have experienced with Monkey is that sometimes after one build, it looses the connection somehow. Then I need to disconnet it and reconnect it again.


Midimaster(Posted 2013) [#9]
"went offline" means: went offline for monkey/PC?

My device is still online after those bugs: A second after I got the log message "INSTALL_FAILED_INSUFFICIENT_STORAGE" the device starts the app. But it is the prior build of this app. So I can say, there was a contact to the device to start the app!

Dropbox is a internet storage, or? Where can I change the "target dir" of the builds? Building it to dropbox, installing new on the device isn't intuitiv any more, or? It is a little bit like me: Have to restart the smartphone before each build...

In this contect it would already be very helpful, if monkey would not install and run the app when I only selected "Build" and not "Build & Run"

At the moment to prevent continously have to restart the device, I plug out the USB cable before each build. And if it run without error messages I give "plug-in" a try.

Do you know, that monkey also will start the app, if there was a JAVA code error during the build?


MikeHart(Posted 2013) [#10]
Btw, that link Mark have posted explains how you can view your data on your phone:

http://stackoverflow.com/questions/4709137/solution-android-install-failed-insufficient-storage-error

Android is a biest when it comes developing for it. You need to get to know the SDK tools too. Putting your money on Monkey alone, or any other tool will lead you only that far.


MikeHart(Posted 2013) [#11]
Yes offline ment that it says no device was found.


bram(Posted 2013) [#12]
When I run 'adb devices' it tells me the device is offline. When I replug the USB, it becomes active again. It looks like some kind of sleepmode.
I didn't investigate it further, but found a workaround.
The build pipeline I use is not as bad as restarting the phone for each new build.
1. my project folder is in my PC's dropbox folder
2. on my mobile, i have the dropbox app opened, already in the build/android/bin folder
3. when I press build (F7), it updates the 'apk' file in the bin folder
4. i wait for the apk file to be uploaded to dropbox, and open it from the phone
5. it asks if i want to overwrite, i press 'yes' and then 'open' and it runs
6. When i close the app, (KEY_ESC->Error('')), it returns to the dropbox app.
This process takes about maybe 20 seconds from the moment i press 'run' in the ide. I still think that is too long for small tweaks, so I run the app in html5 first until the new bugs are solved, and then i run it to the phone.
The big advantage is, I don't need a cable. I work on my couch with a laptop, so that works well for me.


Midimaster(Posted 2013) [#13]
Can I see these /data folders only from the "adb shell"?

Because, if I look directly on my smartphone I see a folder named /data, but there is no /klog folder inside, and there are no big log files anywhere.

What do I have to do to use "adb shell"? I never started eclipse, I'm only using monkey! Is it a command tool? Is it dangerous?


MikeHart(Posted 2013) [#14]
adb is a command line tool that ships with your android sdk. Locate it, open your terminal and just type adb. If you don't want to read through the Android SDK docs, then it will give you a list of what you can do with it. I use it regulary to install apps with it (not monkey).


MikeHart(Posted 2013) [#15]
bram, nice approach. I have to look into this.


Midimaster(Posted 2013) [#16]
ok back...

I tried to have a look inside my smartphone with the adb tool, but....

I am able to start the console with the command "adb" for seeing help

It is also possible to start" adb bugreport". Then I get 10.000 lines of text and at the end I have only 200 remaining in the screen. What do I do wrong?


It is also possible to start" adb logcat". Then I get 1.000 line of text and at the end A get 5 new lines every second. But I cannot finish this process....

It is also possible to start " adb shell". I receive a "$" prompt.
After writing "ls -l" I get a directory. And if I write "cd /sdcard" followed by "ls -l", I can see the directory of sd card. But if I write "cd /data" followed by "ls -l" i get "opendir failed. Permission denied". So how can I see, what is inside the /data/klog or destroy it?


bram(Posted 2013) [#17]
Maybe some folders are not accessible until you 'root' the device? You shouldn't need to have to do that, though. I used 'adb devices' to see the status of my device.


Midimaster(Posted 2013) [#18]
I found a banana app, which causes the problem too: the "mak/suspendtest/suspendtest.monkey" has a option for stopping the app with an Runtime error. If I do this, the following build generates the message.

I also detected if I open the smartphones task manager and use the option RAM-Manager to empty the RAM ( not Memory!) I can continue with building.