Error Installing iPhone App on Device - iphone

I set up all my certificates and keys today and am trying to run my project on my iPhone.
I'm encountering this strange error:
Your mobile device has encountered an unexpected error (0xE800003A) during the install phase: Verifying application
Poking around the Apple Developer forums, I've attempted to set new certificates and provisioning profiles as well as editing Info.plist, but no matter what I do I can't seem to run the app on my device.
The only think I can currently think of is that my project name in Xcode differs slightly from my development provisioning profile (it uses a question mark), but I've named it according to Apple's conventions: com.mycompany.myapp, so I'm unsure if that's the problem.
Any ideas?
Edit: I've hard restarted the phone, rebooted Xcode, cleaed my targets, set up a new wildcard App ID and respective provisioning profile and still nothing. Any other ideas?

It turned out that I had 2 certs in keychain that were simultaneously overwriting each other! I hope this helps people in the future.

You should create a wildcard app ID; com.mycompany.*. That may help.

I've encountered this on many occasions. What i do is clean all targets, shut down xcode, and hard reboot my phone.

This is a different error than the more common problem of getting the cert wrong...
Restore the phone (using the XCode Organizer to reload the latest OS), to be safe do not restore from backup when you sync with iTunes the first time (it'll still keep your number when you sync even if you don't use the backup). I've had to do this a very few times, the last one was when it was in the middle of deployment when I unhooked the phone from the cable (had to answer a call).
Try the reboot (of the phone) first, hooking it up with XCode off. But if that does not solve things, restore is the way.

The console tab in the XCode Organizer sometimes gives helpful hints as to what happens during the install phase. In one case my problem was my app already existing on the phone. I deleted my app and the install succeeded.
Regardless, it looks like a lot of error messages are bundled into this one cryptic message and to really diagnose what is going on, I found the Console tab very useful...

One other thing to try is reinstalling the iPhone SDK. I ran into an error like this when I first got my developer key and this was the only way around.

Just want to say to everyone, when you go to edit Targets-> be sure to set "configuration" in the top left corner to "All Configurations" or the correct config you are building for (Debug or Release). You might think you have things set correctly but it will be for the wrong configuration.

I've seen that error on a correctly provisioned device that has had success installing apps from XCode before, and I've had luck restarting the device and trying again. Maybe that will help.

Try running in Release mode instead of Debug. I have a working project with this problem. No idea what the issue was, but running it in Release mode works, but Debug mode produces the error code.

I have a support ticket open with Apple dev support for the same problem, and (FWIW) I'll post their recommendations if and when they can get my toolchain working.

Try this: (source: http://ephemera.lifewithalacrity.com/iphone_development/)
Even though this is supposedly only for Distribution builds, it helped me to be able to install my Debug version on my iPhone again, after it mysteriously broke yesterday.
"just triple check that all the code signing in your project properties are clear or default"
Note, this is the PROJECT properties as opposed to the TARGET properties. I set my Code Signing Provisioning Profile back to the default and removed the Code Signing Identity string.

Related

entitlement 'application-identifier' has value not permitted by a provisioning profile

I know this question is being asked several times, but I guess currently, I am little frustrated with this entire signing concept, which tends to be so tedious than even coding and sometimes hilarious how Apple have really messed it up in different versions. When I try to build the distribution ipa file from XCode 4.2, the ipa builds fine and can be installed successfully, however in XCode 4.3.2, the app never gets installed but gives me the error: Jun
: entitlement 'application-identifier' has value not permitted by a provisioning profile
Now, I am trying to build it through xcodebuild using my mobile.provision and everything seams to look fine until ipa is being generated. However, when installing the app through itunes, this is the error that keeps getting generated. After surfing through blogs/google_search/etc it seams there might be some issue with entitlements which I have no clue how to go and fix this or what might be an issue there anyways?
I hope someone can direct me to the right direction regarding a fix for this.
Thanks
The way I solved my problem was first, I was not signing the build with proper provisioning. You can indicate the path of the mobileprovision, or if its being added then simply you can goto XCode Organizer and select the correct provision, right click and show the provision in the finder. If you reflect the names in Organizer and in finder are totally different, and I am not sure why apple tends to keep it like that but that's where one error occurred. After that when I tried compiling and installing the ipa on the device, I encountered another error as "entitlement 'application-identifier' has value not permitted by a provisioning profile" as it is not a group member. After going through different blogs and searches it seamed like in Apple's technical note it indicated that if you are building your app for distribution the parameter in dist.plist file "get-task-allow" should be set to as FALSE. Although it indicates that in XCode 4.2, since entitlements is being taken care for you, the type of compilation you choose should reflect to that as well, but apparently that didn't reflected to FALSE. So after switching that to false, the ipa finally got installed to the device. Again, this is for enterprise distribution purpose, so hope in future this may help someone and save some hassle.
I fixed the problem for iOS10 enterprise deployment by removing my app extensions from my app, they were being code-signed differently to the app and was causing this issue.

Why do I get "could not be added to your itunes library because it is not a valid app" error when trying to install Ad-Hoc build?

I've recently upgraded my Mac to Lion, and also Xcode 4.
In Build Settings, I've set "Code Signing" for "Release" to be "iPhone Distribution" which matches our Ad-Hoc provisioning file (which we've used in the past, on Snow Leopard/Xcode 3).
I have deleted the old Entitlements file (as it's apparently no longer used by Xcode 4).
In the Scheme section, I've set Archive to use the Release build.
I'm building with Product > Archive.
I'm saving the file by going into the Organiser and clicking Share, then making sure the same Ad-Hoc provisioning is selected.
I'm sending the resulting IPA file to my boss, who has previously installed this app. When he tries to install it, he gets the message "[appname] could not be added to your itunes library because it is not a valid app".
I've been trying every combination of settings I can think, but we just cannot get this to work. I can find this error only twice in Google - once from someone with a jailbroken phone and another posted in comments of an article, someone having the same issue, but there are no responses.
Any help would be really appreciated.
Edit: Same thing happens trying to drag the IPA into iTunes on the Mac that created it! :(
Edit2: Just taken another (almost identical) project and tried a build without "Modernizing" the project, or selected any of the new options in Xcode (icons, launch images, orientation etc.), and this build works. I'm going to work through each of the things I did with the original app with this one, testing at each step. Hopefully should be able to isolate which step is breaking the compiled app!
(also posted to Apple Dev Forums)
I believe I've tracked this down... It seemed to be happening really intermittently, so it's taken some time (I'd reproduce it, roll back the change, confirm it worked, then re-apply the change, for it to then work again!).
However, after much cleaning/restart/etc., I believe it's related to the "Build" version in the target settings (there are now two version fields, "Version" and "Build"). It seems that if "Build" is blank, then this error occurs.
Unfortunately, changing this value doesn't seem to rebuild properly, so sometimes if you change it, then Archive, you still get the previous value. Manually cleaning before Archiving seems to work around this.
The value gets written into the plist file as CFBundleVersion.
Recently I suffered a problem with an Ad-Hoc installation using TestFlight service, the message in the log didn't help too much:
Jul 25 12:52:39 MyiPad installd[477] <Error>: 0x10059c000 init_pack_state: Archive we've been requested to install is 0 bytes. That can't be a valid ipa.
After many tests, I found this question and the problem was the same, the Build field was empty (this answer save my day :-) )
So, if anyone else has this problem on TestFlight, I hope my answer allows to find this page easier ;-)
I also faced the same issue. After doing some research found below answers as:
App Version and Build version should not blank.
Don't put special characters in my app bundle name.
And also there was no issues with my provisioning profiles.
After debugging found that there was name mismatch in my scheme name and info.plist file name. In my project, I have 3 schemes like a,b,c and only one a-info.plist file. I was creating IPA for different scheme like 'b'.
In your scenario, if you have created multiple schemes then check your Info.plist name. That should have to be same as your scheme name (for which you are creating an IPA).
Example. The scheme name is 'myScheme' then your Info.plist file name as 'myScheme-Info.plist'.
Hope this will help you.
I got the same message ("not a valid app"). In my case, I was FTPing the built app to a web server then I would be able to OTA provision it. I was not swapping to binary mode before I was putting the file, so the .ipa file got corrupted on the way. Took me most of the evening to figure that stupid mistake out...
ok.. do one thing.. Open info.plist.. Go to bundle identifier and change bundle identifier name. It needs to be unique.. something like "com.yourcompany.projectname" and create and try to install the ipa.. It should work
I came across this question while researching a similar problem so I'll answer here even though the cases are not identical, because others will search for the same error message.
I had an ad-hoc app that everyone in the development team could install fine, except one person, who got the error from iTunes:
X is not a valid app
He had been able to install earlier versions of this app. Rebuilding the app, changing the version number and changing the build number had no effect, he still could not install but others could.
I fixed it by creating a brand new Xcode project, either copying the files or copying and pasting the content of the files from the old project to the new one, and rebuilding the app and signing it in exactly the same way as the old project. It worked.
I had a similar issue while trying to create an .ipa for adHoc distribution for one of the Old project (built a year ago by ex-developer). After a lot of research in google and following the above solutions it didn't worked out for me somereason.
Later after following this link - here. By replacing the .plist file with the existing working projects (obviously - the relevant icons/bundle display name/identifier) and renaming with the current .plist name. It worked for me.
I literally spent about 3-4 hours to fix this issue. Hope it helps some one.
environment was native - iOS app.
add......
"Application requires iPhone environment" in your info.plist or if added give it value "YES".
Check "Build" and "Version" in general are not empty....
hope this will work
Importing the project contents in to a new Project solved the issue for me.
For me, we were trying to do an enterprise build of a very old app, from iOS 5.
After confirming profiles and everything else was fine, debug builds work correctly, I noticed the general consensus was around issues with the info.plist file.
I compared the info.plist with another app and sure enough,
Application requires iPhone environment = NO
Basically this key needs to always be set to YES for iOS apps regardless whether its for iPhone, iTouch or iPad...
It may not be limited to that key for everyone but make sure the info.plist looks similar to working apps.
Bundle version
Bundle versions string, short
should always be present!
right.. but I guess it is clashing with earlier bundle identifier( this happens because you have upgraded the Xcode). Did you try and change the existing bundle identifier name and install ? I had identical problem and wasted 3-4 days.. I changed existing bundle identifier name and it worked.. Also you may want to check Bundle name and Bundle version are present in info.plist

IPhone Development Profile Expired

I really combed this site and others. I read and re-read the related links here and the Apple docs. I'm sorry, but either I am obviously missing something right under my nose, or this Apple profile/certificate stuff is a bit convoluted. Here it is:
I have a product in the App Store.
I have updated it several times and users like it.
My development profile recently expired just when I was improving the app for its next release.
I can run the app in the simulator.
I can compile and put the distribution build on my iPhone just fine.
I went to the Apple portal and renewed the development profile.
I downloaded it and installed it in Xcode.
I see it in the Organize window.
I see it on my iPhone.
I CANNOT put the debug build on my iPhone to debug or run with Instruments. The message is that either there is not a valid signed profile or it is untrusted.
I subsequently tried to download and install the certificate to my Mac's keychain.
Still no success.
I checked the code signing section of Project settings and also for the target and the root. All appears to indicate that it is using the expected development profile for debug.
Yes, I had deleted the old profile from my iPhone, from the Organizer. I cleaned the Xcode cache and all targets. I have done all of this several times and in varying sequences to try to cover every possibility.
I am ready to do anything to be able to debug with Instruments in order to check for leaks or high memory usage. Even though the distribution compile runs fine on my iPhone and plays well with other running processes, I will not release anything without a leaks/memory test.
Any ideas will be appreciated. If I missed something obvious, please forgive me - it was not due to just posting a question without searching for similar postings.
Thanks!
All problems solved! I am very happy this all happened because I learned so much about Xcode, keychains, certs and provisioning. Unfortunately, there is not a simple answer. Here are the highlights:
I needed to recreate the ad-hoc profile and install it on my device. (That was MY BIG oversight and the reason the dist build no longer ran on my device.)
Between the very first time I created my profiles and the date my development profile expired, I upgraded to the 3.1.3 Xcode SDK.
It seems that this now means you need 2 entitlements files; a debug version with the get-task-allow checked and a distribution version with get-task-allow unchecked. Each need to be set in the respective settings.
In Project settings, I needed to set both my working directory and intermediate directory to the build product directory.
BIGGIE - I had to double click on the target and reset the appropriate code signing profile. There was an old profile name still there for some reason! Now, I can debug, and drop my distribution on my device without a hitch.
So, in summary, I believe that my original problem (not being able to debug after renewing my dev profile) and the problem that resulted from all my efforts to fix the first were caused by:
the fact that I upgraded to 3.1.3 during my dev cycle
my own oversight (I apologize to Apple for my criticism)
an Xcode quirk (the old profile name hanging around in target settings).
I hope this helps others. The best advise I can give is to take a day off and then create a new empty project, going through the same process step by step.
Thank you all!!
Try re-creating your development mobileprovision file on Apple's site. Be sure to delete all old copies from Organizer (including those on the iPhone itself).

No provisioned iPhone connected....!

Hii all,
I tried to test my application on the simulator and it fails. Just the day before it was working fine. i checked in the organizer window.. all the provision certificates are installed, but still the color is Orange,. its not working. and when i try to debug the application it shows "No provisioned iPhone connected" error.
I got the same problem before, at that time i changed the name of the folder which specify the iphone version, but unfortunately i don't remember now where that folder is. Can anyone help me please.. or is there any alternative.
Thanks,
Shibin
There are (at least) two possibilities here. As Alex says, if you are trying to run on the Simulator then you need to switch your active SDK to one of the Simulator options. The screen shot is of a rather old version of the SDK but the principle is the same.
If, on the other hand, you are trying to run on a phone that has worked before you usually just need to reboot your handset. Sometimes the process that the debugger connects to gets in a state and doesn't respond. Restarting usually works.
You can the No provisioned device connected error only when you try to test on the device. Did you check the active configuration of your project? In order to run the Simulator you should have the corresponding build configuration selected. See the screenshot: alt text http://img255.imageshack.us/img255/7594/xcodeconfig.png
So you are seeing orange color status of the iphone in organizer? If it is the problem simply switch off your device and switch-on again. Try reconnecting the device. This solves my same problem most of the time.
Hope this helps.

iPhone Device Debugging

Is it possible to actually use the Xcode debugger when running an iPhone app on the device rather than the simulator? i.e., can I have the device stop at breakpoints that I set in my code and step through the code as it runs on the device?
EDIT: I should mention that I am a registered developer with Apple and have a valid certificate. In fact, I can build and run iPhone applications on my device just fine. However, even in Debug mode, my application will not stop on breakpoints or output to the console when I run it on my device. If it helps, my application will function normally in debug mode (e.g., stopping at breakpoints) when I run in the simulator.
EDIT 2: I've tried resetting my phone, completely removing and reinstalling Xcode, creating a new project, changing all the settings mentioned in the answers on this page (as well as others), cleaning and building my project, Build and Debug... If I click Pause, it says "Error from Debugger: Quit". :( Maybe I'll try to debug on this device using Xcode on another computer and see what happens.
EDIT 3: Well, I tried using another computer using a fresh install of Xcode in a new project, and I still can't get device debugging to work. I have a suspicion that it's my iPhone or cable perhaps? I'd like to think that I'm not so incompetent that I've missed something so embarrassingly obvious, but I've double- and triple-checked all of the suggestions mentioned here.
EDIT 4: FINALLY got device debugging to work. I have a feeling that something low-level on my device was causing issues...nothing I did worked on my system. However, I installed Xcode on another system and device debugging on the same device (with the same cable) worked flawlessly. Directly after that, device debugging began working on my original machine, leading me to believe that some strange hardware flag was screwed up and somehow "reset" on the second machine. In any case, it works now... Thanks for all the help. :)
Also, I'm unsure if it's better to leave this question unanswered or pick the most "helpful" answer...
Yes -- just use a device build. You have to get certificates and provision it.
This is a good description:
http://boga.wordpress.com/2008/07/16/debugging-ipod-provision-profilescertificates/
Make sure to start debugging by pressing "Cmd-Y"... and not "Cmd-R" :-)
You may try last trick in case nothing can help.
If your application launched successful on your device from XCode but did not stop at breakpoints - try press "pause" button after start in debug mode. If you will see application paused properly (do not react to user's action) add new breakpoint then press "run" to continue application execution. In some cases it may helps to stop at new breakpoint.
Yes, just set your project to build for the Device.
If you need to setup debugging for jailbroken iPhone (up to 2.2.1) (not pay 99 to Apple yet) follow next steps:
Install MobileInstallationPatch for your iPhone via Cydia (use Search Tab)
Switch off PROVISIONING_PROFILE at XCode: Go to /Developer/Platforms/iPhoneOS.platform/Info.plist, add next keys:
<key>PROVISIONING_PROFILE_ALLOWED</key>
<string>NO</string>
<key>PROVISIONING_PROFILE_REQUIRED</key>
<string>NO</string>
You may also add these keys to any
project particularly at XCode, Project
Build Settings, User-Defined
variables.
Add key to your project Info.plist at XCode
SignerIdentity = Apple iPhone OS Application Signing
Don't forget to install and add to your project settings self-signing certificate from Apple
http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW2
"Build and Go", you can connect iPhone and start debugging.
Important! You may need to install and launch at least one legal app (any free one) from App Store first (before "Build and Go" step). Otherwise your application will be successfully installed by XCode to your device but may not be launched. Try this troubleshoot first in case of problem with app launching.
Yes. Debugger and performance tools work fine on the device. That's where I do most of my debugging.
Xcode>preferences>debugging uncheck load symbols lazily
fixed the breakpoints not holding in device problem for me.