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!
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;
developers using location services are noting problems on 4.1
https://devforums.apple.com/message/294717#294717
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
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 :-(
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.
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.
Related
I got the project from my team and i am working on it when ever i restart the system my Xcode not runs the project, but i am able to run other projects easily .... after i run the project with the changes i do it shows me
"Cannot run on the selected destination- The selected destination does not support the architecture for which the selected software is build. Switch to a destination that supports that architecture in order to run the selected software."
And if i run the original project it runs fine then i have to again copy and paste the codes that i did in the project after that it runs fine, but when i open my Mac the next day it does not runs and again i have to start from the original project, What is happening i don't know why after Restarting or Shut Down the project does not runs.
I am using Xcode 4.5.2 on iMac 21.5-inch - Software OS X 10.8.2 (12C60)(Mountain Loin)
Processor 2.5 Ghz Intel Core i5, Memory 4 GB 1333 MHz DDR3.
Project target is iOS SDK 6.0 (on iOS 6 simulator).
Does Not runs on Simulator and on Device also.
Sometimes just runs on the simulator but not on Device.
I have tried :
Restarting the Mac.
Cleared Derived Data.
Reinstalling Xcode.
But still can't figure out .. Nothing helps .. plz Help me on this ...
I think that if the project finds some cache memory problem then after restarting the system it some times start working fine or in case of same project with different destination with some minute changes you are running then it some times hanged in the device or simulator for that we have to need to switch off the device and restart again then after it start working fine. And if the project code is in iOS 5.0 and the IPod/IPhone device os is 6.0 then it does not show in the device section for running. For that first you have to run the device to the xcode with ios 6.0 and then it start working fine . But here, you have to notice that for each and every time after switch off you have to run the device first with xcode 6.0. But in your case some build target problem which is not clear to me . So , if you provide the details of bug then it will be easy for understand.
Check under Build Settings > Architectures and set Architectures to Standard (armv7) or ${ARCHS_STANDARD_32_BIT} for all your profiles.
Set Base SDK to Latest iOS().
Set Build Active Architecture Only to NO for all profiles.
Set Valid Architectures to armv6 armv7 for all profiles. You may have to add either depending on what is already available.
I have solve the problem using the below steps.
Close the Xcode
Delete the application from device
Restart the device
then re-run the application
it working fine..
Just installed Xcode 4.2 for Snow Leopard and started to developer a new project. The app successfully runs on iPhone4 but isn't on iPhone3G. The code gets build, compiled, ran and finished. I just get a message "Finished running ...". Here's the settings that I have set both on Project and Target Build settings:
Build otions->GCC_VERSION = Apple LLVM 3
Architectures->ARCHS = "armv6 armv7"
Architectures->SDKROOT = "Latest iOS5"
Deployment->IPHONEOS_DEPLOYMENT_TARGET = "iOS 3.1"
Linking->OTHER_LDFLAGS->Debug->Any architecture |Any SDK = "-ObjC -all_load"
Any ideas or suggestions what else should I try?
This problem appears to happen when creating new projects with Xcode 4.2. When creating such projects, Xcode adds one hidden key in app plist file, that restricts device to run on armv7 architecture only. You need to delete that key. Also, you need to replace "standard (armv7)" to "armv6 armvv7" value in ARCHS build setting, both in project and targets build settings. And also to check ONLY_ACTIVE_ARCH is set to NO.
I have seen 'finished running...' in my code too with an iPhone 4. Whenever that happens, I do a clean build and also uninstall the app from my iPhone. Post that, things start working again.
I'm new to xCode development and struggling my way through the provisioning system trying to run a Hello World app on a real device. I went through al steps and everything seems fine but one thing:
When i click my device (Iphone 3G running IOS 4.2.1) in the xCode organizer the following message is displayed under Software Version: Xcode cannot find the software image to install this version...
Also the provisioning profiles show no status in the organizer (both in the library and on the device). On the provisioning portal they have the status active.
I hope someone can help me, thanks!!
ps. i am working with xcode 4
Update: OK, I've found the solution -> set deployment target to 4.2 in info tab: https://discussions.apple.com/thread/2780316?start=0&tstar
The message "xcode cannot find the software image to install this version" seen in the organiser window... This is just a notification rather than a problematic error.
If you want to eliminate this message anyway, I found I was able to do this by running restore within iTunes. Part of that process involves downloading some stuff, which I presume is the 'software image'.
But, as explained in Technical Q&A QA1569 "This message does not prevent you from using the device for development purposes. The only effect is the inability to reinstall the OS currently on the device using Xcode." ...and that has been my experience. Back in the main Xcode window you're still able to click 'run' and send the app to the device to run.
...and it will run assuming everything else is set-up OK, but there are various other gotchas related to Xcode 4.2 and v4 devices:
As mentioned by Overbeeke you should ensure the 'deployment target'
of your project is set down to the desired version (the minimum
version of the devices you want to support) Additionally I would
point out that the 'SDK version' should normally remain set to the
latest (it's whatever SDK Xcode on your machine is using)
As mentioned by Kenneth Lam, in the new Xcode you need to frig around
with "armv6/armv7" settings if you want to support earlier models of
iPhone. Follow these instructions to add the right "Architecture" armv6 setting. Additionally I would point out (as per this answer further down) that there is a setting called "Required device capabilities" from which you need to remove 'armv7'. This is in your app's plist file.
I'm saying all this like I'm an expert, but I still can't get it to work on a v3.1.3 device :-)
I think Xcode 4 requires that you are running the latest iOS to use that feature, but you don't need it to install apps on a device. I have run my apps on an iPod Touch 1G (which can't be upgraded to iOS 4.3) with the same iOS as you and it worked.
Have you added your device to the provisioning profile?
What I did is opened the organizer, right click on the device on the left pane and select "Add device to provisioning profile" where you will be asked for your Apple ID (within xcode) and it will add the device to your profile without you leaving xcode, much simpler than using the online portal.
Xcode 4.2 only builds armv7 targets by default. (Iphone 3G running IOS 4.2.1 is armv6) Add armv6 build targets by following these excellent instructions from Nick "Warning: iPhone apps should include an armv6 architecture" even with build config set
just an update, to update the iOS deployment target, click your project in the left pane, the one with the blue 'A' icon. click the build settings tab (not info), instead of showing "basic," show "all." iOS deployment target is in the deployment section.
There could be a number of things, but i would make sure that that your deployment taget in build settings is at or below your target . Check the "deployment section" in the build settings of your project. The default sets the deployment to the highest iOS version, if the ios version is below what is set you will not be able to run the app on that device.
I want to test my app on my itouch which has ios 4.2.1 .
I have completed the steps for provisioning profile/certificate. So under Organizer,
when I select my device, I am seeing the provisioning profile
and under Developer profile, I see 2 entries; iPhone Developer and iPhone Distributor
Now I want to just test the app on my device (NOT looking for steps to submit the app for distribution at this stage)
I think there are some Project settings that I need to do under XCode. But I am unable to figure it out. Please provide me the steps to test on device.
My XCode ver is 3.2.5
I was hitting an issue following this and the documentation where my app would not deploy to my iPhone 3G running iOS 4.2.1 using XCode 4.2. I hope this helps others who end up on this question trying to get their apps to deploy to a real device through XCode.
I kept fiddling with the Base SDK setting along with the Deployment Target setting in the project and target settings area. However, I had them correct to start with so that wasn't the answer (I want to target iOS 3.2+, so I kept all set to that). In addition, I messed with the provisioning profiles, certificates, etc. multiple times even though they looked right to me. They weren't the issue, either.
The key was changing the architecture settings that are scattered throughout the interface.
First, since I am testing it on an iPhone 3G, I needed to support the armv6 architecture as well as armv7 for later models. So I added "armv6" to the "Valid Architectures" entry on the project's "Build Settings" tab.
Next, I made sure it was showing "armv6 armv7" under "Architectures" in the "Build Settings" tab of the target for my project.
Finally, I clicked on the -Info.plist file for my project and removed the "armv7" entry for the "Required device capabilities" that is put there by default for new projects in XCode 4.2.
After this, my app ran successfully on the device using Command + R for Run.
Double click your app under targets in Xcode
Make sure that for the configuration 'Development' you have the right development provisioning
profiles selected.
click on the properties tag and make sure that the identifier is the same as the identifier used in
the development profile.
clean all targets, in Xcode make sure you are building for Device, Debug, and than click 'build and run'.
If the development profile is on your iPhone and you have installed it into Xcode correctly it should work. However sometimes after installing a profile on your iPhone it doesn't register everywhere it needs to and I have found that this is fixed by restarting the iPhone (not Xcode).
Good luck.
I've created a iPhone static library project with two targets like this
Project
--> Library (Device) target
--> Library (simulator) target
The device target has the SDK set to the device so it produces an armv6/7 library and the simulator target is set to the simulator SDK so it produces an i386 library.
The issue I'm having is that the SDK settings on the targets keep getting overridden by the XCode active target setting. i.e. if I build the device target, but the XCode window is showing the active SDK as being the simlulator, XCode will build a simulator library instead of a device library, ignoring the settings of the target. Although it will put it into the *-iphoneos/ directory in the build directories!
I originally had the same issue with another static library project, and after a lot of playing around got everything to work correctly. i.e. The targets ignore the XCode active SDK because they have their own specifications of what to build.
The problem is that I don't know what made it work in that project and I have not been able to reproduce the issue in it either.
Does anyone have any ideas as to what is going on?
ciao
Derek
OK, I think I've figured it out.
Set the project SDK to the general setting, ie. Simulator SDK so that you get the APIs and libraries correct during coding.
Set each target to the SKD it needs to build. ie. device SDK or simulator SDK.
Leave XCodes SDK set to current SDK, effectively telling it to not override the targets.