Apple WeatherKit Error Xcode 14 Beta 5 iOS 16 - ios

Trying to get the WeatherKit Beta working. have had the same error on Xcode 14 Betas 3/4/5 on both the simulator and physical device using the apple provide an example from WWDC or a simple project to load weather data.
The error output is always:
2022-08-12 15:56:02.825925-0400 WeatherPup[47533:15014528] [AuthService] Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=AMSErrorDomain Code=12 "Mescal Failed" UserInfo={NSLocalizedDescription=Mescal Failed, NSLocalizedFailureReason=SAPInit failed: -42049}
Has anyone been successful in building using this Beta yet? I would imagine it should work since the dark sky weather service is still running.
I have all certificates, identifiers, and privileges setup as they should be and triple-checked bundle identifiers, etc.

I've had the same issue and here are the 2 things I had to do to make it work:
Make sure that you have the WeatherKit checkbox checked under the development portal in both places - Capabilities and App Services:
As of Beta 5 I've only been able to successfully fetch weather information from the API when building on a real device.

I believe it has been generally confirmed that WeatherKit is not working correctly on XCode simulators. I haven't been successful yet with a Sim but physical iPhone device works fine. WK documentation is lacking.

I have the same issue. It doesn't work on simulator XCode 14 beta 6 and earlier.
It's working only on physical device with iOS16 Beta
Except of using physical device be sure You:
1.Configured correctly identifier. You have to select "WeatherKit" under "Capabilities" and "App Services" and waited at least 30min
2.Be sure You have added WeatherKit capabilities in XCode under Singing & Capabilities tabs in project settings
For more info visit:
https://help.apple.com/developer-account/?lang=en#/devfe6684fd6
https://developer.apple.com/weatherkit/get-started/

Related

internal error in Code Signing subsystem Xcode 12

I am getting Code signing error while uploading app to App Store, it is working fine in simulator and device, only getting this error while uploading.
This target of my app is using a framework developed by me, so previously it was giving an error of code signing for the framework, so I did some changes related to code signing and it's gone, but now it is giving same code signing error for my app target.
It was working fine with Xcode 11 (Building and uploading), I did some changes in framework related to build architecture to make it compatible with Xcode 12.
Interestingly the error page says View distribution logs for more information, but the only information I found related to this issue is below,
Library/Developer/Xcode/Archives/2021-06-27/MyApp 27-06-21, 4.26 PM.xcarchive/Products/Applications/MyApp.app/MyApp>’, hardenedRuntime='0'>'> to: /var/folders/k6/jqdbxs4x6_d65495_v9127180000gn/T/XcodeDistPipeline.~~~v6vq0l/entitlements~~~a8rUuu
2021-06-27 10:56:59 +0000 Running /usr/bin/codesign '-vvv' '--force' '--sign' 'A5640AE3DE907C3AC86E500508C5B6A3096D871F' '--entitlements' '/var/folders/k6/jqdbxs4x6_d65495_v9127180000gn/T/XcodeDistPipeline.~~~v6vq0l/entitlements~~~a8rUuu' '--preserve-metadata=identifier,flags,runtime' '/var/folders/k6/jqdbxs4x6_d65495_v9127180000gn/T/XcodeDistPipeline.~~~v6vq0l/Root/Payload/MyApp.app'
2021-06-27 10:57:00 +0000 /var/folders/k6/jqdbxs4x6_d65495_v9127180000gn/T/XcodeDistPipeline.~~~v6vq0l/Root/Payload/MyApp.app: internal error in Code Signing subsystem
2021-06-27 10:57:00 +0000 /usr/bin/codesign exited with 1
Fix: Set Enable Bitcode to No from Build Settings.
This is clearly Xcode 12 bug, something is mismatched while enable bitcode, I tried uploading build from Xcode 13 beta and uploading was working fine, of course it was rejected by AppStore connect because of beta SDK.
If you are using third party framework, make sure you embed Framework, Otherwise you will get crash on launch in release build, here is the detailed missing framework crash solution by Apple.

Code signing is required for product type 'Application' in SDK 'iOS 14.3'

I am trying to build an old iOS application in xcode 12.3 (macOS Catalina 10.15.6). The app was written by another person many years ago. So previously it was signed by another AppleID certificate.
Now I have already managed to build the app in xcode 12.3 and I can successfully run it on a virtual device (iPhone 11 pro). However when I try to run the app on the real iPad (iOS version 14.2) connected via usb I am getting this error: "Code signing is required for product type 'Application' in SDK 'iOS 14.3'".
I have already searched in SO and found few threads from many years ago which are not really helpful for me.
What have I tried so far?
Enabled two-step authentication for my AppleID and added my AppleID to xcode.
In project -> Signing and Capabilities section I enabled Automatic Signing and selected my Team (which is shown as 'FirstName LastName (Personal Team)'). Everything looks OK now in Signing and Capabilities section, no errors.
I have also tried to create a test app and I was able to run it on the same iPad connected to my comp. I used the same my AppleID that I am using with my real project.
Before the error there is also warning: ""MyProject" isn't code signed but requires entitlements. It is not possible to add entitlements to a binary without signing it."
Somehow I managed to run my app on external device (iPad) finally. I don't really understand how I did it but at some point it just compiled without errors and then started.
I was just trying out every suggestion one after another from this thread: Code signing is required for product type 'Application' in SDK 'iOS 10.0' - StickerPackExtension requires a development team error. I set up Automatic Signing with my AppleID, selected my Team, changed BundleID, changed Deployment Target version to 14.2 (the same as in my iPad), etc. I also tried to Clean the project and restart xcode after every change - nothing worked for me. But suddenly it started working after I changed Code Sign Identity under Build Settings for both targets (main app and tests). I just changed Code Sign Identity back and forth and it start working. Finally I set Code Sign Identity to "Apple Development" (as it was suggested in the error message in Signing tab).
It is funny but the answer that I was trying out at that time suggested totally different thing. But that answer was from few years back and there was no such settings in my interface. So I tried to set it in another way. And that is how it worked out for me. BTW, this is that answer: https://stackoverflow.com/a/47664721/4428219.
Maybe later I will make more detailed research what exactly was the setting that made it work for me. But for now I just committed my working configuration and want to write it down here while I remember the sequence of events.

Xcode - Error launching WatchKit Extension

I've successfully built a basic Watch/iPhone app and am getting the following error when trying to run on my devices:
"Error Launching 'app_name WatchKit Extension'
The operation couldn’t be completed. Unable to launch because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user."
The app does install to the watch/phone, but I want to use the extension to view console output while running the app.
I am using automatic provisioning, which is not giving any errors. I am not using Apple's paid developer program. Has anybody experienced this before? Cheers.
This setting should be set to Trust(your Apple id) in Settings -> General -> Device Management ->
I resolved this by opening the app on the Apple Watch for the first time, then selecting "Trust developer" on the prompt that appeared.
The workflow seems to be different depending on your usecase:
WatchOS app with iPhone app
Standalone WatchOS app
For usecase 1, I had to trust myself as a developer in the iPhone Settings -> General -> Device Management. Note, you need to try and run the app on your devices before the menu option is available on the iPhone.
For usecase 2, I had to trust myself as a developer at the prompt that was shown when I opened the app on the watch for the first time.
My advice would be to try to get usecase 1 working first, before trying usecase 2. Note, if you have a free developer account you will need to uninstall the usecase 1 app from the iPhone and from the watch before you can install usecase 2, as the free account only supports one app at a time.
I wasted time by starting with usecase 2 and could not get it to work for some reason. After I gave up and did usecase 1, then subsequently tried my usecase 2 app again without changing any XCode settings, it just seemed to work for some unknown reason.
I'm using XCode 11.4, iOS 13.4 and WatchOS 6.2 on iPhone 7 Plus and Apple Watch 2 42mm

iOS enterprise distributed app terminates without any error log

I have very weird distribution scenario with the iOS app.
App works normally in simulator
App works normally on the device with developer profile (and corresponding bundle id domain.product)
When downloaded from testFairy service with valid enterprise provisioning profile app and bundle id (in form domain.beta.product) app:
Installs without error
Shows lunch screen and terminates immediately
When I connect device and check logs through Xcode -> Devices -> Show log I don't see any today's crashes, like no error happened. (this confuses me the most)
This happens on 2/2 iPhone devices that tried to run the app.
Some other infos that could maybe ring a bell to someone:
- App uses Core Data
- App uses TestFairy SDK (but it was the same without it)
- target is iOS 7.0, base SDK is Latest iOS(iOS 8.1)
- provisioning profile is set to that Enerprise Profile and signing identity is set to corresponding certs for both debug and release.
- I've removed armv7 from Targets-> Info -> Required Device capabilities as suggested on some stack overflow solutions.
Anyone experienced similar problem? What could be the cause?
I work for TestFairy, I think I can assist.
Few points:
TestFairy's distribution does not alter the IPA in any way.
When using an enterprise profile, you need to sign using (TEAM.domain.company.app) in your application-identifier. iOS 8 shouldn't let you install if the identifier does not include the TEAM.
If the app crashes immediately (with or without the Default splash screen,) it might be because you're out of memory. Does rebooting fix the problem?
Can you please paste all the logs from right before the launch, till the app exits? you can attach and send to TestFairy's support (via Contact page.) That would be helpful. Also, if you're interested, you can email support with your username and link to build, and they can try installing it on their devices and let you know what the problem was.

iCloud and Core Data not working - URLForUbiquityContainerIndentifier is nil

I am not that familiar with iCloud integration. I read numerous bad reports about the integration in iOS 5 and 6. But now I guess it's better in iOS 7 so I decided to add it in one of the new apps I'm working on.
From what I read and saw in the WWDC 2013 CoreData/iCloud video I thought it was as simple as flipping on iCloud in Xcode and configuring the NSPersistentStoreUbiquitousContentNameKey value to something unique in the addPersistentStore call, to get started. But each time I run the app, in the simulator or on a physical iPhone, the console output shows the iCloud setup failed due to URLForUbiquityContainerIdentifier returning nil.
I am using Xcode 6 beta and the iOS 8 beta 2 SDK. I've made sure iCloud is signed in and otherwise functioning on the simulator and physical devices. I've also made sure that the "Documents/Data" switch is on under iCloud setting and the app IS appearing here. I've also browsed to the simulator application directory and I see the SQLite file in the normal documents directory and in an iCloud directory.
Is there something really simple I'm missing?
There is bug in Xcode 6 beta version , i am using Xcode6 beta 5 and facing same problem.
I changed key com.apple.developer.icloud-container-identifiers to com.apple.developer.ubiquity-container-identifiers" (ubiquity, not icloud). Then add an item to this as "iCloud.$(CFBundleIdentifier)". In "Capabilities" tab Xcode will show error in red mark but don't fix it , leave as it is.
If solved my problem and i am getting Url now.
Not sure what the developer agreements allows to say, but at the time of writing this, it is still beta and most probably is a bug in xcode 6. There may be a few threads on the developer forum on that exact same subject. Search for 'URLForUbiquityContainerIdentifier' and you may find more information.
Try beta 4. My iCloud code is now working.
You didn't mention configuring your app ID for iCloud access and updating your provisioning profile, so that's probably the problem. The device needs to know that your app is allowed to talk to iCloud, and it does that based on the provisioning profile. You'll need to go to the iOS developer site and:
Update the app ID to add the iCloud capability
Regenerate the provisioning profile so that it includes the new capability
Download a new copy of the profile and make sure that you're using it in testing (it's best to delete the old copy first just to be sure).

Resources