Your mobile device has encountered an unexpected error (0xE8000001). That’s the error I got stuck on for the last 1.5 weeks when trying to deploy and test my iPhone application on my device instead of the simulator.
I surfed tons of forums and discussion boards but didn’t find any solution, but since this is something I really had to get past, I didn’t give up and tried out everything I could think about… with success!
The weird thing about this error is that it doesn’t occur the first time you deploy your application. Everything goes great until you try it a 2nd time (or sometimes it works a couple of times and then it just happens at random). I read rumors that if you restore your iPhone, you can deploy your app again 1 time (or a couple of times) and after that the error appears again.
These facts made me suspect that there is something left or changed on the device after the first time you install your application, so here’s what I did:
- I restored my iPhone and jailbroke it, installed SSH on it, connected to it from my laptop and started looking around. I made a full dump of the file system (list of files & dirs, file properties, file sizes,…) and then deployed my application a couple of times until I got the error.
- When I got the error I made a new dump of the file system and I wrote a little tool that compared the 2 lists from head to toe.
- After having found all the differences I started changing them back one by one and tested if the change fixed my problem.
- I quickly found out that the directory “/private/var/mobile/Media/PublicStaging” was holding a copy of my application and after deleting this copy, I could deploy again just fine.
I suppose this is a bug in the iPhone SDK, or maybe in v2.2 of the iPhone OS? I don’t know exactly, but if you encounter this error when deploying your app, here’s what to do:
1. jailbreak your iPhone (unless there’s another way to do step 2, then you can skip this step)
2. install SSH on it
3. every time you get the error, SSH to your iPhone (default root password on v2.2 is “alpine”) and delete your application folder inside “/private/var/mobile/Media/PublicStaging”
4. you can now deploy again
Oh and euhm… don’t forget to put SSH off again when you’re done, or change your default password, because you don’t want anyone to SSH into your iPhone when you’re on some public wifi, do you?
I’m glad to hear someone finally dug a little deeper into this issue. I guess for those of us who haven’t jailbroken our phones, we’ll have to wait for a bug fix (assuming it is a bug which in my experience I would agree with).
It was the first time I tried running my application on the device so I don’t know if this occurs in other SDK/OS versions as well. If it doesn’t (on the apple forums I can only find 2.2 related posts about it), I assume this is a bug and I hope they release a fix soon :/
I never had this problem with 2.1. I updated both the SDK and the iPhone OS at the same time so I would certainly place the blame on one of those two updates.
I ran into the same issue. As a workaround, without jailbreaking your iphone, just make sure you *always* remove the application first before re-installing it. Do not do the ‘replace’ operation. As long as I remove it first and then install it using the Xcode organizer, I have not had this problem.
Thanks a lot for the input Keith! I’m sure a lot of people will be very happy with your solution!
This happened to me twice. I never succeeded in jailbreaking. My solution was completely restore my iphone.
Your a genius. Thanks you so much for fixing my problem. I can’t tell you how much frustration went away with your helpful comment. THank you from the bottom of my iPhone’s little cyber heart. Rudy
Just ran across this webpage while searching for a solution to this problem.
I was able to fix it by restoring my iPhone. During the restore, I chose “no-backup” as I really wanted to install just the firmware and nothing else.
Sweet! I ran into this same problem myself… however, I was able to resolve the problem WITHOUT jailbreaking my phone, and WITHOUT restoring it either. How did I do it? I simply had to “Clean All Targets” (from the Build menu in Xcode). I hope this approach continues to work for me, and wasn’t just a one-time deal.
It just worked for me to remove the old application from my phone, then do a “clean all targets” and then “build and go”. yay!
Note to all desperate coders who don’t want to restore OR jailbreak:
You can just change your package identifier (com.company.app) slightly and it will “start anew” properly. You may need to restore/jailbreak eventually to recapture that first identifier, but you don’t have to slow down your development cycle multiple times for it (just when you’re doing final deployments).
oh man, i just have no words. thanks, it helps