Problem

An Android device fails to install applications after many successful installations.

Solution

When you install and uninstall applications on your automatic tests - android assigns a UID number to each application. The numbers range from 10000 to 19999. When you uninstall an app, Android does not release the numbers. Therefore, after 9999 installations (and removals), there are no more numbers to allocate and the next installation fails. In addition, extra folders are left behind. 

To solve the issue, you need to perform a factory reset on the device. For details, see https://code.google.com/p/android/issues/detail?id=74963.