Mac App crashed queue: com.apple.CoreLocation.0x7fc93e530920 - xcode

So I am trying to make my app work on iOS and MacOS. Which to say it does run on both. However when I submitted it to Apple, they seemed to of made it crash. Due to the following
Crashed Thread: 3 Dispatch queue: com.apple.CoreLocation.0x7fc93e530920
Now I can tell it is due to CoreLocation, But I am wondering why did it not crash on my mac when I tested it (same version) 13.15.6.
Next is how do I fix this, if I can't get the error to happen again?

Encountered this too. In my case on macOS 10.15 all ran fine, but got a crash report when the application was submitted for review, where it crashed on Big Sur (macOS 11.3) with this error.
The solution (for me) is to add the key NSLocationUsageDescription to the plist in the Mac version.
See https://developer.apple.com/forums/thread/652193 and Apple doc
I could only intermittently reproduce this error, and when it happened it happened the moment I enabled Location Services in System Preferences. I guess that is the moment that CoreLocation inspects the plist, and sometimes crashes, i.e. not always.
Addition:
For macOS 11 (Big Sur) the authorisation of access to location has changed more than described above. Depending on your needs you need to ask for access to location, as described in https://developer.apple.com/documentation/corelocation/requesting_authorization_for_location_services?language=objc.
So, this is 4 possible keys and "purpose strings" for the plist, that steer the authorisation via system alerts, with the user's choice handed to you via the delegate locationManagerDidChangeAuthorization:.
Also see https://developer.apple.com/documentation/corelocation/choosing_the_location_services_authorization_to_request?language=objc
Note that location will work fine without these strings, but you will run into a rejection with the AppStore when you submit your application for review.
Also note that if your Mac has location services NOT enabled at all in
System Preferences -> Security&Privacy -> Privacy -> Location services
no system alerts will show up at all. It is assumed that if not enabled the user does not want to be bothered.

Related

macOS app on Catalina through Xcode receives "TCC deny IOHIDDeviceOpen"

With Catalina out, I have took time to update and tried to run my app but I am facing a weird issue.
My app is monitoring key events therefore needing the new authorization to monitor inputs.
If I run through the signed bundle, I do get the warning telling me to turn it on in the system preferences which I do. It then works fine.
If I do the same running through Xcode or through Iterm2, I always have the "TCC deny IOHIDDeviceOpen". I have tried to authorize products of the build but it does not change anything.
Anyone with an idea ?
If that doesn't work, make sure your terminal program (e.g. iTerm.app) is also checked in the "Input Monitoring" permissions.
I had a similar problem. I found that removing all entries for my app from System Preferences->Security & Privacy->Input Monitoring and then re-running under Xcode worked. It is almost like Catalina recognises the app as one in the store and doesn't ask about turning support on but then sees it as a different app when it actually comes to opening devices

Xcode 7.3 wont attach to simulator to debug

So I upgraded to Xcode 7.3.1 and now my Xcode will build, and deploy my apps (yes every app, even a brand new blank one) to the simulator but the app never launches on the simulator and the debugger never attaches, Xcode just hangs and has to be force quit. I've completely wiped out Xcode and all simulators and re-installed to no avail. I've scoured Stack Overflow and Google trying every piece of advice and still no luck. Anyone anywhere have any idea how to solve this issue? If I downgrade to 7.2.1 I'm able to debug in the simulator just fine.
Let me know if you need more information.
My Apps run just fine on the simulator, and if I try to attach the debugger to a running app it wont and Xcode hangs in the attempt, when attempting to attach this way at least Xcode doesn't have to be force quit.
FYI, I can debug on a device this is only a simulator issue.
I had this same issue, and tried fixing my projects and reinstalled Xcode twice before I was able to get Simulator to crash and give me an error report that called out Cylance. Luckily I have access to administer our Cylance portal, so I was able to work through the issue to narrow down the problem.
Symptoms:
When running an app from Xcode, the Simulator launches but the application does not launch within the Simulator
Trying to stop the application from within Xcode does not work, and generates no messages
Trying to re-run the application from within Xcode generates the following message: ‘An instance of “APPLICATION NAME” is already running. Choose “Stop” to terminate and launch a new instance.’ But pressing Stop does nothing.
Xcode will not quit, and eventually the user must Force Quit to exit Xcode
Within the OS X console, the following messages are displayed:
6/3/16 7:35:38.000 PM kernel[0]: AMFI: com.apple.dt.ins(pid 2239) - [deny-mmap] main process is a platform binary, but mapped executable file is not: /Library/Application Support/Cylance/Desktop/CyMemDef.dylib
6/3/16 7:35:38.000 PM kernel[0]: AMFI: com.apple.dt.ins(pid 2239) - [deny-mmap] mapped file has team identifier XXXX: /Library/Application Support/Cylance/Desktop/CyMemDef.dylib
Resolution:
The problem is caused by Memory Protection being turned on within the policy assigned to the Mac within the Cylance portal.
To resolve the issue, place the Mac into a zone/policy that does not have Memory Protection turned on. Auto Quarantine and Protection Settings can be left on.
During my testing, I was not able to come up with a list of exclusions that allowed me to leave Memory Protection on, so I ended up disabling it completely.

Accessibility disabled for app in Mac OS X 10.9

After upgrading to Mac OS X 10.9 and running my app (which executes various AppleScripts as part of its execution) I get a dialog that the app has to be specifically enabled via the System Preferences Security/Privacy screen. So I do this and the app then functions properly.
However, when I recompile and build the app, it will no longer execute the AppleScripts and does not show the dialog. When I look in the System Preferences Security/Privacy I see that my app is still listed there but has been disabled (i.e. checkbox reset).
BY trial and error, I have found the following:
If you change the Bundle Version string in the apps info.plist and rebuild the app even without making any other changes such as code, etc this will happen; it will be disabled from accessibility.
If you make all kinds of changes to the app (code, resources, etc) but do not change the Bundle Version string in info.plist, it will still be allowed to have accessibility access.
My question is: is there a way to circumvent disabling after rebuilding?

Permission Denied when running Mac app after upgrading to XCode 4.4

I had a working Mac application until I updated to XCode 4.4 and Mountain Lion. Now the application still compiles, but when I try to run it I get an error message.
error: failed to launch '/Users/username/James/mac/Browser/trunk/Browser/DerivedData/Browser/Build/Products/Debug/Browser.app/Contents/MacOS/Browser' -- Permission denied*
Can anybody explain why I might be getting this?
I found this on an iPhone 5 (iOS 6.0) newly set up for development. I had to manually launch the app on the phone, and it said "Are you sure you want to launch this app signed by this devloper?" Once I approved that, the "permission denied" went away and it now launches from Xcode.
Unlock the Device
Try simply unlocking your device before running on it. I was stumped by this very same issue. Upon building and running with no changes to OS, environment, code, etc., I was receiving the error.
Similar questions have been asked here and here, but were not helpful in this situation.
This is caused by an entitlement (and, presumably, having the wrong kind of certificate for it).
If you have the sandbox enabled, and try to sign with a Developer ID certificate, your application will crash on launch (as of Lion—I haven't tried this on Mountain Lion).
If you have iCloud enabled, and try to sign with a Developer ID certificate, your application will not launch at all—in Xcode, you'll get the error message in the question, and in Finder, the application will launch ever so briefly and then get SIGKILLed.
Presumably, there is a right kind of certificate with which one can sign an app in order to be able to test with a sandbox and maybe even iCloud that you can obtain if you have a Mac Developer Program membership. A Developer ID certificate is not that kind of cert.
(That solves my problem, anyway. Dennis, what kind of cert were you trying to sign with?)
Open the organizer and make sure you're mac is in developer mode.
Also check your gatekeeper settings.
The device is seeing the app as an "unauthorized app downloaded from the web" for lack of a better description. Go into Settings > Security & Privacy, and at the bottom, allow applications downloaded from Anywhere.
Throwing a few thoughts on the wall:
Are you perhaps building on an external disk? Some drives get special permissions (like the "ignore permissions" checkbox), or maybe have ACLs set in a weird way. Tried building on internal startup disk?
Are you code signing? Have you tried just turning that off, to see if there's a bug in code signing or entitlements? Not the first time a new codesign tool has a bug.
Have you tried using xcode-select and updating any command line tools that are installed to make sure they all match the version of Xcode used?
Do you have any shell script build phases or the likes that might be editing the application after it's been signed, thus breaking the signature?
Have you checked if your hard disk is full or there's a (broken?) symlink somewhere in a path, or a volume name that has been unmounted?
i am sure this is long been figured out, but I have been getting the Permission denied and it turned out I had to add my laptop to the provisioning profile. I had recently reimaged my machine and in doing so the provisioning profile was no longer valid for that machine. It worked fine until i enabled iCloud. That's when the permission denied started.
Check the organizer in XCODE, click on the devices tab and click on your machine on the left. Check to see that the UDID it shows is listed in the devices section in your mac developer portal.
The short answer is when you get this error message, there is no valid development provisioning profile in the built application.
That alone won't solve your problem! There are a number of common causes of this:
You've moved to a new machine and haven't installed the provisioning profile in Xcode. Also see below
You've moved to a new machine and it's not in developer mode OR not added to the provisioning profile
For both of these, let Xcode regenerate it, or do it yourself in the Member centre... You can validate the causes is something to do with your provisioning profile by running Console and filtering on taskgated where you can see which provisioning profile it is trying to use (it will pull the one embedded in the application first, then try to pull from any installed on the Mac).
Make sure you check in your build settings that the right one is being used for Debug builds. Simple steps that normally resolve (XCode 5)
Go to member centre and create a new development profile
Select the app and certificate
Validate that the machine you are using is in the list of machines to be included in the profile, tick the box
Generate the certificate
Download it, and drag it over the Xcode icon in the doc
Go to the Build Settings tab in your target and set the provisioning profile to the one you've just downloaded
You haven't configured your iCloud/APN/GameCenter entitlements correctly.

Obtaining OS X app store receipts on test builds

Been trying tonight to obtain a receipt for my app. However, I've been unsuccessful. Here's the steps I've done:
Code signed with developer cert
Made sure minimum version in the info.plist is 10.7
Checked for the presence of the receipt file and called exit(173) if not found
Built from XCode 4.2
Added a new version of the app and some in-app metadata in itunesconnect. The app status is now waiting for a new binary.
I've then done clean, build, right clicked on the app in XCode's project view and opened it in finder to launch it, hopefully failing validation and pulling a receipt back from the store.
However, this never seems to happen (don't get asked for any itunes login etc) and the app terminates immediately.
I've also gone through an entire build/archive/create installer type process as well but that didn't pop up the login either.
Am I missing something obvious?
Thanks!
I've finally got it working. In case anyone else has a similar problem, the real help for me was finding out about console.app. In running this I could see my app didn't appear to be signed.
I deleted all the certificates etc and re-installed new ones. Seems it HAS to be the Mac 3rd party developer. Nothing else seemed to work.

Resources