tags:

views:

537

answers:

6

I installed iOS 4.1 just released today.

I downloaded my app to the Phone from the AppStore and ran it and it cant get GPS Location.

I download the new XCode and 4.1 SDK and recompiled under 4.1 and app works fine on 4.1 IPhone.

No code has been changed.

Why doesnt an app compiled under 4.0 work under 4.1.

BASE SDK was 4.0

IOS DEPLOYMENT TARGET : iOS 4.0

NEW Settings

BASE SDK was 4.1

IOS DEPLOYMENT TARGET : iOS 4.0

Bit annoy I need to resubmit even though I havent changed anything...another week of black hole app submission!

A: 

When you clicked 'Info' to access the build configuration to SDK4.1, did you have the project's title highlighted or the Target? It seems there are two sets of build configurations. I had the same GPS problem as you. I also thought I was using SDK4.1, but I actually wasn't.

Tristan
A: 

After 3 attempts at deploying to the App Store and lots of dissecting the project file I found the following:

The deployment target was different for BUILD and TARGET And base sdk only set in Debug in Target

I got the Debug/Release to work on my phone so presumed if relelase and Distribution had same settings should work in App Store.

But even after setting it and redeploying to appstore it failed to work (app loaded and no GPS).

I tried deleting the Provisioning Profile but didn't work.

Overnight phone lost power and when I restarted app was working.

so not sure if it was a weird combination of all 3.

iOs Deployment Target (IPHONEOS_DEPLOYMENT_TARGET = 4.0;): iOS 4.0
BASE SDK(SDKROOT = iphoneos4.1;): iOS 4.1
for BUILD (Debug/Release/Distribution) (Right click on top level in tree YourApp >> Info menu)
and TARGET (Debug/Release/Distribution) (Right click on Target >> YourApp >> Info menu)

Release the app on 4.0 to app store. 4.1 released Upgraded my app to check it. App ran ok, but failed to get GPS in a number of screens. Recompiled it under 4.1, NO CODE CHANGES, released to store, still wouldn't work.

Debug version ran ok on 4.1

Release didn't

Distribution (version from app store) versions didn't. Failed to get GPS.

Dissected the project file to see whats the difference.

Found that

Target and Build settings weren't identical.

IPHONEOS_DEPLOYMENT_TARGET = 4.0;

Was set for BUILD for Debug/Release and Distribution

but

for TARGET it was set for DEBUG to

IPHONEOS_DEPLOYMENT_TARGET = 3.0;

and NOT set at all in RELEASE and DEBUG

I deleted the build directory and set

IPHONEOS_DEPLOYMENT_TARGET = 4.0;
for BUILD (Debug/Release/Distribution) (Right click on top level in tree YourApp >> Info menu)
and TARGET (Debug/Release/Distribution) (Right click on Target >> YourApp >> Info menu)

Rebuilt Release version now work so had to hope setting same in Distribution would work. Released to app store. Was approved in 2 days both times. Tried it. App ran but no GPS. Tried deleting the provisioning profile, no luck. overnight phone lost power so restarted. Tried the app and it worked. So maybe

To check this yourself. Copy the YourApp.xcodeproj to a safe location. Rename so extention no longer .xcodeproj This becomes a folder. Open and it will have 3 files Build settings are in project.pbxproj

Scroll to the bottom: look for /* Begin XCConfigurationList section */

Notice theres two sections on for Build and one for Target

/* Build configuration list for PBXNativeTarget 

...

/* Build configuration list for PBXProject 

If youve done a Distribution build then each will have Debug/Release and Distribution settings

  1D6058940D05DD3E006BFB54 /* Debug */,
  1D6058950D05DD3E006BFB54 /* Release */,
  C55BCF5811ADCA470050ABDB /* Distribution */,

The 24 digit hex number point back up to section further up in the file. IF you lay the 3 sections (side by side in a table) you can see the differences.

Only differences TARGET (Debug, Release and Distribution)

1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
....
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
....
};
name = Debug;
};

not set for Release/Distribution

BUILD(set for Debug/Release/Distribution)

IPHONEOS_DEPLOYMENT_TARGET = 4.0;
SDKROOT = iphoneos4.1;
clearbrian
+1  A: 

developers using location services are noting problems on 4.1

https://devforums.apple.com/message/294717#294717

clearbrian
A: 

Hey it's me again. I'm replying to you on multiple forums.

Are you by any chance using this deprecated getDistanceFrom: method? It might be the culprit, although you'd expect it to work or not work consistently between XCode and the Appstore :/

https://developer.apple.com/library/ios/prerelease/#documentation/CoreLocation/Reference/CLLocation_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/occ/instm/CLLocation/getDistanceFrom:

UPDATE: Removing this deprecated method didn't fix the problem for me :-(

Tristan
cheers I have to do an update soon so will try an remove all of these.
clearbrian
when I test a new app from the app store. I do so on my dev phone (although I have 3 iphone ive only got one IP4). So I delete the app I was debugging against and download my app from the app store. You'd presume deleting an app would erase all its settings. I presume location services has settings somewhere so maybe its not erasing them all properly.
clearbrian
locationManager.headingAvailable is deprecated too
clearbrian
Hey dude, I'm not saying it is the cause of the problem, it's just a suspicion of mine. I was wondering if you were using it too, because that would be more evidence for it.
Tristan
Alrighty. Btw, I think you mentioned changing your deployment target to OS 4 in one of your other posts. I don't think that'll help the problem at all, and it would stop OS 3 users from using your app.
Tristan
A: 

Check your entitlements plist file (for us ent.plist). Ours used to have some mention of location services, and now it does not! No idea how that happened though.

Tristan
+1  A: 

Apple finally admitted its a problem in 4.1

https://devforums.apple.com/message/307257#307257 Some information that you may find helpful about this issue:

This issue only affects applications when the app is uninstalled and subsequently re-installed. It does not relate to distribution via the App Store vs. your own builds of the device. Rebooting the device will fix the problem. This issue is fixed in iOS 4.2.

https://devforums.apple.com/thread/70688?tstart=0

clearbrian