Building to the Android device has been an annoying process for the last month or two:
Each morning, I have to do a random bunch of things to not get the
Unable to install APK!
error. This may include deleting the APK file on my machine, restarting the phone, restarting unity, and sometimes even my machine. (It might be that not any of these things actually fixes the problem, but that it just randomly starts working).
Once I have got the APK on the phone, it works fine for the rest of the day.
This, morning, however, I have not been able to get the APK file on the phone at all. I went through the usual steps several time, without any luck. If I build with logcat running, it looks like there exists some file that must be "destroyed":
Here is a snippet from the log
I/PackageHelper( 613): Size of container 19 MB 18583507 bytes
D/VoldCmdListener( 54): asec create smdl2tmp1 19 fat {} 10048
E/Vold ( 54): ASEC file '/mnt/secure/asec/smdl2tmp1.asec' currently exists - destroy it first! (No such device or address)
W/Vold ( 54): Returning OperationFailed - no handler for errno 98
E/PackageHelper( 613): Failed to create secure container smdl2tmp1
E/DefContainer( 613): Failed to create container smdl2tmp1
I/ActivityManager( 85): No longer want com.android.voicedialer (pid 403): hidden #16
D/dalvikvm( 85): GC_EXPLICIT freed 1878 objects / 85664 bytes in 71ms
D/AndroidRuntime( 606): Shutting down VM
D/jdwp ( 606): adbd disconnected
I/AndroidRuntime( 606): NOTE: attach of thread 'Binder Thread #3' failed
D/dalvikvm( 606): Compiler shutdown in progress - discarding request
- I found some advice about deleting the file using the terminal (!!!), unfortunately, it requires permissions.
- On another location I found help, suggesting switching to SupersUser by using the su command. Unfortunately, I can't (I need permissions).
- So on yet another location I found a method of replacing the su program, a whole process through the terminal.
This looks too scary for me to attempt to get my Unity build running. Is there a simpler way? As you can imagine, I am quite frustrated, since I cannot test my application at all on the device.