iphone Location Services code that works on OS 4.1 in appstore - iphone

There's a bug in OS 4.1 that has broken location services for some iPhone apps ( https://devforums.apple.com/message/306250 ). Basically location services fails to turn on, and doesn't even ask the user for permission to get their location. The worst thing about the bug is that it doesn't occur when you're installing the app to a device from XCode, it occurs you when you're downloading from the App Store! This makes it almost impossible to test for a fix.
Not everyone's app has been affected, so I'm trying to find out what causes it.
Does anyone have any location services code that's NOT affected by this problem? In other words, who has code for an app that has location services working fine on OS 4.1 devices, when installed from the AppStore?
Thanks!
Tristan

I have found a workaround-Solution: Reset the location warning. (Settings > General > Reset > Reset Location Warnings)

I have seen this occur with apps I have developed when the device has installed a testing version provisioned under a distribution profile and then installs the final version submitted to the app store. The symptom is that Location Services never seems to initialize or ask for permissions and you wind up never being called back with a location or an error to handle.
We have verified that rebooting the device does NOT fix it, but that resetting the location warnings does. In our testing, this only affects devices that ran developer provisioned builds and not 'pristine' devices that only install the App Store build.

I worked through this with the apple help people. Resetting location warning didn't work. Resetting the network didn't work.
Basically, I reset the phone in itunes and set it up as a new phone. The location now works.

Related

How to simulate the AppStore update process on device/simulator

We have submitted an update version of our existing applications in the App Store recently. But we have received a issue from one of the users, saying that the app is not functioning properly after the update. So in order to replicate the same, what are the steps to reproduce, so that i can analyse the issue?
Any help will be appreciated.
To simulate this before pushing yoru updated version to the AppStore you can:
Download the old version of your app from the appstore
Run the updated version of your app from XCode on the same device.
What will happen behind the scenes is that your app will be updated in a way similar to the Appstore. Your app will be partially updated while your doucments folder will stay the same. (what usually causes problems)
This solution is better because it lets you check for problems before and update was pushed to the Appstore.
Yeah, I get this a lot. The solution is a bit annoying, but you need to keep a history of IPAs you've submitted so you can put the on your phone through iTunes (so not the simulator) and then, run your code on your device putting a breakpoint on your applicationDidFinishLaunching handler in your app delegate, and start tracing from there. You should be able to find the old app store version in your organiser from the last time you submitted, or, go through your SVN/GIT history and checkout the version tagged to your release version.
Many times in the past that has happened to me where I test a new revision and everything looks fine but when I submit an update and is approved, users start complaining about a crash or lost data.
This is way I approach the problem.
(This is most important step) You need to either have your old code or old binary installed on your actual apple device. (Physical iPhone / iPad)
Now go to iTunes and install your new update.
Attach your physical iPhone / iPad to you computer, Launch Xcode and start debugging it.
NOTE: There have been many times when things work perfectly in the Simulator but break on the actual device. Its always important to test your code on the real thing as that is what the users are going to be on.
All that is required is to have the version of the app that is in the app store on your device, then install the updated version to your device. You can debug it using Xcode when you install the new version.

CLLocationManager Permissions on iOS 4.3

I currently have an application that uses location services and is working great on devices running iOS5 and above. However, have been running into inconsistency issues with 4.3.x.
Problem:
When installing and running the app for the FIRST time, we get the usual 'Allow this app to use Location Services' dialogue to change the [CLLocationManager authorizationStatus]. However, when we uninstall the application (from the home screen) and reinstall the app, we never get this prompt again and somehow the OS has cached the users response for this app, despite this app being uninstalled and reinstalled freshly. On all other versions of iOS, we get the prompt as expected and the [CLLocationManager authorizationStatus] is set to kCLAuthorizationStatusNotDetermined as expected.
Can anyone tell me why with 4.3 the OS seems to remember the options for the app despite it being uninstalled? In order to rectify this issue currently, I have to manually reset all Location Services settings on the device through the settings menu.
If you need any information, or code snippets, please ask.
It turns out this is a 4.3 limitation and is apparent when running an application on any device iOS 4.3.
Apple must have decided this isn't a bug - which is strange seeing as when a user uninstalls an application, why does the OS remember that users selection of permission for a particular app?
No valid workaround available. Just have to live with it.

Finished Running on iPhone

I am trying to test my app on an iPhone 4S. When I build and run from Xcode, the project is successfully compiled but after that Xcode says:
Finished running MyApp.app on MyiPhone
The app perfectly work on the simulator and the provisioning profile works correctly (I tried to load an empty app and it works).
If I try to manually load the app I get this message:
The Info.plist for application at
/Users/*/Documents/App/AppName/DerivedData/AppName/Build/Products/Release-iphoneos/AppName.app
specifies a CFBundleExecutable of AppName, which does not exist.
Where is the problem?
The connection that XCode creates with the device is rather fragile, and can easily be corrupted if anything goes amiss in the debugging test, most commonly if the developer stops a build, while it is being moved to the device.
I have a routine of things I go through, when this occurs. If one doesn't work, I go further down the list.
Check your signing certificates
: This error can occur if you mess around with the certificates too much. Make sure your current scheme uses the Debug signing when making a debug build, and check in your application settings if the current debug signing certificate is a debug certificate. (Not AppStore, AdHoc or Enterprise).
Reestablish connection with the device
: Look under devices in your Organizer. Check if the device you are using is present and marked with a green bullet. If orange or grey, reconnect the device with the USB. For precaution, wait a couple of seconds from taking the cable out before you insert it. It should make no difference if you eject the cable from your mac, or the part connecting your iDevice.
Reactivate development on the iDevice
: Being unaware why this happends, some devices revert to a non-development stage from time to time. Clicking the "Enable development" under Organizer > Devices seems to clear this off.
Flushing XCode device connections
: Something that often is needed, you can simply shut down XCode (and to be safe, close the iPhone simulator as well) and start it up anew. Deleting the debug application present on the iDevice is also a good idea.
Restart your iDevice
: Tedious as it might seem, restarting your iDevice is sometimes needed, since the pipe held on the device might be corrupted.
Restarting your developer machine
: If everything else fails, a restart of your mac is often required. I have never experienced this error without having it fixed by now.
I hope this checklist will help you through.
Try cleaning the project.
SHIFT+CMD+K
Found the same bug in XCode 9 while running the project on iPhone 5s. Clean the project and it will work.
Clean.
Build.
Run.
It's work for me.
I had similar issue. When I run program on iPad2 it compiles and installs app on device, wait for some time, and display an alert. Then I followed steps below
1) Removed that application from device.
2) Disconnected iPad and tried again.
Then it successfully run in device. If this not resolved your issue, do
Rename your application to some thing else and try to run. It will run. Lastly you can make an "ipa" file with Ad Hod distribution and can test on device.
Looks like you are trying to run a release product on the device. You are probably signing it with production key. Run it as debug.
Maybe I'm totally off with this guess but the last time I got the same message was when I had some required hardware capabilities set in the Info.plist which the target device didn't comply with. (E.g. requiring a camera and trying to run the app on an iPad1.)
I've just finished chasing down a similar problem.
An app that worked on the device (iPad 1) and on the simulator stopped loading on the iPad but continued to function as before on the simulator. When "run" with the device as target, it compiles and then goes immediately to "Finished Running...".
I did all the usual bits - removed the app from the device, ran Product/Clean, removed derived data, shut computer and device down cold, but with no luck. Other development apps loaded and ran fine.
This app uses GameKit. When I removed the gameKit requirement from Info.plist, the app loaded and ran correctly on the device again - including the GameKit functionality (no kidding). When I added gameKit back in, it failed again. When I added the gameKit requirement to other apps, they failed to load to the device as well. It appears that something has happened to the gameKit setting on the device, although gameKit is there and functions as always. I'm suspicious that this one has to do with the state of the sandbox.
I've got to make a few changes to get the app running on the iPhone and I'll test that as well. I'll repost if I sort it out.
Si it seems that XCode build, ran and finished but the app failed to be deployed and was not even copied to the device.
In fact, there should be something in the XCode project that is broken. This is easily corrupted. The best move is to build a new project from scratch. Don't forget to add armv6 support if needed.
It works well for me!
Check the device log
It may occur, that you are using a provisioning profile, which does not allow one of the entitlements, listed for your target.
For example
entitlement 'entitlement-name' has value not permitted by provisioning profile 'Your Profile Name'
For me, the usual culprit is that I have an app store build already on my device.
Different/same version numbers might make things worse. I haven't looked into it too deeply since deleting the version that is already on my device usually fixes the issue.

Anyone else having problems installing iPhone Enterprise apps on released IOS 5?

Anyone having problems deploying Enterprise apps on iPhone/iPads running the released version of iOS 5 using the OTA ("over the air") methodology?
During the installation process, we get the alert box: "the app could not be installed at this time". Tapping the Retry button does nothing. In some cases, repeated tapping of the Retry button eventually results in a gray, empty launch icon being left on the home screen. No app installed. No other errors.
Anyone else seeing this or have a resolution?
The below description is a bit involved, but please bear with me as it may help others who run into the situation. I will post the resolution if get a resolution from Apple. So far, no joy there.
Our app refuses to install OTA on iOS 5. This same app WILL install on iPhone/iPad devices running iOS 4.x.x AND the same app will install on iOS 5 devices physically connected to a desktop machine using the iTunes app.
The Apple Developer forums under the IOS 5 Beta category complained about the problem but no indication of resolution as of last week just before the official release of iOS 5.
Cookies are set to be accepted.
Bowser cache and history cleared.
Using mobile safari originally installed with original iOS version 4.x.x.
System hardware and operating system configuration
iPad 2, iPhone 4 or any iPhone device running iOS 5 RELEASED version.
Browser and version
Mobile safari that is installed with iOS 4 on ipad2. Don't know if mobile safari upgrades with ios 5 upgrade.
Using a corporate wifi network. Yes, we are behind a firewall and use a proxy server. Since iOS4 devices install without problems, I don't think installation being blocked by the proxy or firewall.
Enterprise app built with Xcode 4 and ios5 sdk provided with it. Built to be backward compatible with iOS 4.0.
Distribution provisioning profile is correct as we have been using it for several weeks.
This app installs properly on iOS 4 devices both over the air and via iTunes application method.
This app installs properly on ios5 devices through the physical connection with iTunes application on the Mac desktop.
Steps to reproduce:
User types in the URL in mobile safari on iPhone/iPad running ios5.
The resulting webpage shows the download app link.
User taps on the link and is asked if they want to install the app.
User taps the yes, install button.
App proceeds to install.
A gray launch icon shows up on the home screen with the progress bar empty at the bottom of the icon.
Message below the icon indicates "loading".
Seconds later, user gets the "cannot download app at this time" error message as seen in screen shot attached.
Tapping the retry button results in the same action just described.
Tapping done results in the download stopping.
If you tap retry several times, user sometimes is left with the gray empty launch icon, which will not launch and cannot be deleted.
Note: In the apple developer forums, under the iOS 5 beta category, people are describing the exact same problem with no resolution.
Had the same problem, and was able to resolve it. However, the error noted is not specific to a single cause that handles every case... some detailed investigation needs to occur.
Your best bet is to connect the device to your Mac, and using the Organizer of xCode view the console logs while you are attempting to do a wireless deployment. There will be some useful information available -- please post the logs.
For my case -- the icon files were missing from the build, as a result of moving from xCode3 to xCode4 and also, the distribution plist was referencing an image that returned a 404. Both were logged in the console, but not very clearly.
Also, as a sanity check, manually verify the URL to your IPA file also.
I had this same problem and was sure everything was correct in my project; but restarting Xcode and doing a clean revealed my Enterprise scheme had somehow defaulted to the wrong provisioning profile.
Re-selecting the correct profile and re-archiving the app fixed the issue for me, I'm able to install an enterprise app on both iOS4 and 5.
I wanted to chime in after fighting this for a few hours. It is iOS 5 specific.
We had an htaccess password protection on the directory. Removing this allowed the app to finally download. So if you have htaccess, perhaps you can point the user to a parent directory that is password protected, then navigate to the subdirectory containing the app that isn't password protected. This is a temporary solution, apple needs to fix this.
Another thing to consider is the URL you specified in your over-the-air Application.plist file. I received the same error message ("-application- could not be installed at this time") because the URL I specified was too unspecific. Rather than writing "directory/directory/application.ipa", I had written "directory/directory/". You must include your application in the complete URL of the plist file's configuration.
If you didn't do this, don't fret! You don't have to rebuild the entire thing from step one, you can open your .plist file in any standard text editor and simply change the URL.
We had the same thing.
Our mistake was to point to a wrong 512.png icon in the manifest.
Which was no problem on iOS4 but turned out to stop iOS5 into a "...at this time" alert.
Wanted to chime in on my experience.
In my case, we were changing the address where the IPA file was hosted. Although I updated the PLIST file with the proper URL to the IPA file, iOS was still going after the old URL almost as if it cached the PLIST data. Creating a copy of the PLIST file and renaming it resolved the issue (data within the file remained unchanged)
I met the same problem today. The app can be installed in ios4, but failed in ios5 with "** could not be installed at this time" alert.
According to patricksan's suggestion, I download iPhone Configuration Utility 3.5 for Mac OS X, and try to catch the log while install the app through OTA.
The log helped me finally, one sentence of the log says entitlement 'get-task-allow' has value not permitted by a provisioning profile. It remind me that if the code signing identity in build settings of Project and Targets are correct, after checking them in Xcode, I found the code signing identity are not correct one, they should be iPhone distribution:.... other than iPhone developer:..... After correcting them, and re-Archiving the ipa file, it can be installed in iOS 5 now.
Check your Info.plist for Required device capabilities property. I recommend to delete completely this property if you haven't any restrictions on use.

XCode 3.2.5: Deploy Debug Build to iPhone iOS 4.2.1 is FAILING

I am having one of those horrible days where absolutely everything is broken.
I'm trying to deploy my application to my iPhone. I have done a full system restore to 4.2.1 on both devices. The iPhone is simply having none of it: http://cl.ly/3O1C242k210T2I0w253Q -- What's going wrong?
Organiser picks the iPhone up no problem, gives it the green light, but XCode won't deploy the app: 'No provisioned iOS device is connected'
I have tried:
rebooting the computer, restarting X code, plugging in the iPhone, attempting to deploy. pretty much every combination thereof.
organiser -> deleting and recreating Xcode's default provisioning profile
target settings -> making sure the correct provisioning profile is selected which it is
going onto developer.apple.com -> provisioning portal, and making sure X code automatic provisioning profile is there as it should be, which it is
putting the iPhone in to restore mode, and reinstalling the latest iOS
The only thing I can think of is that it is a UK locked phone, with a UK SIM inside, and when I turn it on it gives me some ' waiting for activation ' message: http://cl.ly/0I390x2Z3E3A040V2J2h so maybe it is possible that it never activates and this is somehow a barrier. can anyone confirm?
( I doubt it is this; I'm pretty sure the phone is capable of activating itself even tho I'm not in the UK, seeing as I have the correct SIM card in. I remember one time reinstalling iOS or something similar, and it needed the activation. so I think it does successfully activate. However, I don't know how to check whether activation has completed or not. )
But I have successfully deployed a load of apps to this device in the past. I can't understand why XCode is digging its heels in today?!
PS the only other thing I can think of Short of buying new hardware is reinstalling Xcode, which I guess I will have to try at some point. maybe even reinstalling my MacBook's OSX. but really I can't see how this would help...
I'd suggest checking your code-sign parameters. Maybe it's signed with app profile that doesn't have your device's UDID added through provisioning profile?
Someone on IRC got me to try deploying a default template app, and that worked.
I subsequently removed and reinstalled the SDK, and the problem has gone away.