A couple of days ago I changed laptops from an Intel/Big Sur to a MacBook Pro M1/Monterey.
Since then I've encountered endless endless problems building in Xcode (for iOS).
The very first attempt at building my project after setting up the laptop was successful, but since then builds just fail randomly without making any code changes. i.e. make a build and its successful, change nothing whatsoever and it fails.
Once a build fails it takes an eternity to get it building successfully again, doing a clean, delete derived data, quit/re-launch Xcode doesn't necessarily fix the problem, it might be necessary to do this 3 or 4 times before the build succeeds again. But that build success will only be temporary before it fails again.
The failures are different each time, but one thing they seem to have in common is a Killed: 9 message, here's an example
Script-00DD1BFF1BD5951E006B06BC.sh: line 5: 22679 Killed: 9 ../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh
Command PhaseScriptExecution failed with a nonzero exit code
I've had about 6 or 7 different random failures in different places, but they all say Killed: 9 Command PhaseScriptExecution failed with a nonzero exit code.
The project used to build fine on the old laptop, its the exact same project/code, the only variable here is the laptop itself and the MacOS.
I've been struggling with this for the last 3 days, the problems are just endless. The build failures are random, like I mentioned a build will work fine one time, then just stop for no reason. They could occur at any random moment in any random component of the project or its dependencies.
Its utterly impossible to proceed like this, I'm the first in my company out of about 100 employees who are going to upgrade their laptops from Intel to Silicon. I will be telling our IT department we absolutely cannot make that switch as things are just unusable and its impossible to proceed with this combination of laptop|OS|Xcode.
I'm on Monterey 12.2.1 | Xcode 13.2.1, but the problem was also present with Monterey 12.0.1|Xcode 13.2.1
Opening Xcode with Rosetta makes no difference to the problems.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I intentionally deleted iOS development/distribution related certificates from my keychain (Login, Local Items, System, System Roots).
Then built my app in Xcode. Automatically manage signing is turned on and Xcode created/installed an Apple Development certificate to my keychain).
But if I create an archive, I am able to successfully create a development distribution, an ad-hoc distribution, and even upload to App Store Connect. Yet I don't have a distribution certificate anywhere in my keychain.
I therefore don't understand how this was possible. How could I create all those distributions without a distribution certificate in the keychain?
An app can legally link into its own section of the Settings app, and if it uses CallKit, it can link into the Call Blocking & Identification section.
Linking anywhere else into Settings is making use of private URL schemes and is supposed to not be permitted and the app rejected during submission.
However the Robokiller app deep links into the Settings app with the page scrolled down to where the Phone section is.
How are they doing that? Is there some new API that permits the app to link to there? Or are they making illegal use of private URIs and have been getting away with getting past App Store review for years?
I've added a background asset extension and am trying to invoke it using this:
xcrun backgroundassets-debug --app-bundle-id com.myCompany.myApp --device-id 00008120-000225060C9B401E --simulate --app-update
When I run that command I see this in the phone's log:
Unable to observe extension for (com.cequint.myapp), the BAApplicationInfo is missing an extensionIdentity.
So how should an extension identify be added?
The extension's info.plist is as created by the Xcode template:
<key>EXAppExtensionAttributes</key>
<dict>
<key>EXExtensionPointIdentifier</key>
<string>com.apple.background-asset-downloader-extension</string>
</dict>
And I've added the following to the app's info.plist:
> <dict>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>kBackgroundTaskIdIdentifier_RNScheduleAppRunEvent</string>
</array>
<key>BAMaxInstallSize</key>
<integer>3221225472</integer>
<key>BAInitialDownloadRestrictions</key>
<dict>
<key>BADownloadDomainAllowList</key>
<array>
<string>*.drive.google.com</string>
</array>
<key>BADownloadAllowance</key>
<integer>2147483648</integer>
</dict>
<key>BAManifestURL</key>
<string>https://drive.google.com/file/d/1doJtzxBKCoVHEF80sndK6VskCrkD9H9r/view?usp=sharing</string>
What else needs doing to provide the extension identifier the OS is saying is missing?
(Using Xcode 14.1 and iOS 16.2)
This takes 2 minutes to recreate:
Create a new project in XCode
Run pod init to create a pod file
Add some pod to the pod file, I tried with MMWormhole or PhoneNumberKit or Realm
Run pod install
The app can be built however an archive cannot, it generates an error:
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Switch to Xcode 14.2 however and the archive can be built
I'm trying to fire a timer in a notification service extension, but what would work in the app doesn't work in the extension i.e.
Timer.scheduledTimer(timeInterval: 8.0, target: self, selector: #selector(doSomeStuff2), userInfo: nil, repeats: false)
or
Timer.scheduledTimer(withTimeInterval: 7.0, repeats: false) { timer in
...
}
and so on, etc.
Is that a way of getting a timer to fire in an extension?
This video is referenced in several places, for example here references it
https://developer.apple.com/documentation/callkit/making_and_receiving_voip_calls_with_callkit
and Eskimo has referenced it in his posts. But its gone, there are other WWDC16 session videos but not this one (https://developer.apple.com/videos/wwdc2016)
Is it available anywhere else?
Also how can this code be run/tested for an incoming call (without using the build in simulator i.e. using a real incoming Voip call)? What tool/app etc. could be used to generate a call to the handset to see the code in action when answering a VoIP call?
While attempting to upload my app to TestFlight (which has already been uploaded numerous times, including just a few days ago with the same code base) there is this error
"TMS-90338: Non-public API usage - The app references non-public selectors in : _isKeyDown, _modifiedInput, _modifierFlags....."
Nothing new there, that's been happening for months for myself and countless others and has been reported numerous times, i.e.
https://developer.apple.com/forums/thread/127678?answerId=715975022#715975022
https://developer.apple.com/forums/thread/714450
But now there's a difference - in the past the builds always appeared in Testflight after getting this warning, so it wasn't an issue.
But now that's changed, the build is no longer appearing in Testflight, so it suddenly is a very big issue.
I'm programmatically adding a contact with an image with the intention the image should display in full screen size when a caller matching the number of the contact calls (as opposed to the image appearing as a tiny round icon next to the caller name).
I'm creating an image of the same size and scale factor as the iPhone, and so far its working out ok - I have about 15 different phones, of various dimensions and scale factors, ranging from an old iPhone mini up to the most recent iPhone Pro Max, and on all of these it works as intended.
But there's an exception, an iPhone 12 Pro (which has dimensions 390 * 844 and scale factor 3), on this phone when there is a call the contact image appears as a tiny icon.
Why. Why is this phone different?
How can I know what size image should be added to a contact to appear at full size in the call screen when every phone has different dimensions and they are not behaving the same?
Additional question - the iPhone applies some cropping and expansion to whatever image gets added, is it possible to know what's being done to the image in order to make it display perfectly? (i.e. if the image contains some text, the fact the OS crops away some of the edge of the image, then expands what's left to fill the screen dimensions results in some pixelation)
Using the newly released Xcode 14 to upload an app to App Store Connect results in several warnings saying "The app references non-public selectors in ....."
This does not occur when uploading if the archive is built using Xcode 13
Is this a re-emergence of an Apple bug:
https://developer.apple.com/forums/thread/127678?answerId=715975022#715975022
Which has the response: "The issue has been resolved on the app validation backend. Please try resubmitting. Sorry for the trouble." Apple Developer Tools Engineer
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
iOS
App Store Connect
Xcode
A few days ago I uploaded a build to Testflight successfully.
Just now I made absolutely no changes whatsoever other than to increment the build number. This latest build doesn't appear in Testflight.
Tell me this can't be anything other than a bug with Testflight, if a build from a few days was good enough to appear, then how come with no changes it no longer is.
This can easily be reproduced from scratch following these steps:
Launch Xcode and choose to create a new iOS app. Organization name: com.company, ProductName:experiments.
Therefore the bundle id is: com.company.experiments
Create a background download target, productName:backgroundDownloadExtension.
Therefore the bundle is is: com.company.experiments.backgroundDownloadExtension
When Xcode creates the extension it automatically gives it a group capability with id: group.com.company.experiements.
Within the signing & Capabilities section for the extension there is the following error:
Within the developer portal, go to the Identifiers section, locate the main app bundle com.company.experiements. If not ticked, tick the App Groups capability. Click on edit, select group.com.company.experiments
Within the developer portal Identifiers section, locate the extension bundle, com.company.experiments.backgroundDownloadExtension. Ensure the App Groups capability is ticked. Click on edit, select group.com.company.experiments.
Like so for both the app and extension:
Back in Xcode, for the app add the group capability, tick group.com.company.experiments. Now it matches the extension and will be like this for both of them:
Quit and relaunch Xcode because Xcode is so unbelievably sticky and seems to cache everything, e-v-e-r-y-t-h-i-n-g, and millions of problems can be solved just by quitting/relaunching it.
In the Signing & Capabilities section for the extension it still displays this:
Back in the developer portal, create a provisioning profile for iOS development, choose the com.company.experiments bundle id, download it.
Do likewise for the com.company.experiments.backgroundDownloadExtension
After downloading, click on them both.
Quit and re-lanch Xcode again. Any luck? No its still displaying the provisioning error.
Ok, enough of Xcode's automatic management of signing. Let's turn that off and import the the extension provisioning profile that was just downloaded. Still getting this error:
The entitlements file's contents are:
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.company.experiments</string>
</array>
The contents of the downloaded extension profile are:
<key>Entitlements</key>
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.company.experiments</string>
</array>
<key>application-identifier</key>
<string>MV8J9D3236.com.company.experiments.backgroundDownloadExtension</string>
<key>keychain-access-groups</key>
<array>
<string>MV8J9D3236.*</string>
<string>com.apple.token</string>
</array>
<key>get-task-allow</key>
<true/>
<key>com.apple.developer.team-identifier</key>
<string>MV8J9D3236</string>
</dict>
I give up, how the hell can you create a background download extension without Xcode displaying the error?
I want to programmatically add a contact, preferably within its own group, such that it remains only on the (iPhone) device local copy of contacts and doesn't get synched elsewhere.
However if I programmatically create a group then the group itself appears in iCloud, so presumably contacts within it will to.
What sort of arrangement of containers/groups/contacts etc. should I create to achieve this?
I've got a notification service extension which uses quite a lot of memory when it runs.
Its using UIGraphicsImageRenderer:image() to create an image based on the push payload, and that that is a very memory hungry function.
When the extension receives a push it uses less than the 25MB memory limit for extensions and its successful and runs to completion. However the next push that gets receives crashes due to memory not being freed (it doesn't matter if several minutes elapses between pushes).
After its crashed its successful once more (the action of it crashing must obviously be freeing up the memory, so after a crash there's enough memory to run again, but then the next push after that will crash and so on and so on).
I've run the extension interactively in Xcode's debugger to observe this behavior, but it also happens when running independently of Xcode (and thus lifetimes of things aren't being kept alive by the Xcode debugger).
As my extension has no control over the creation/destruction lifecycle of UNNotificationServiceExtension, is there anything that can be done to force the OS/UNNotificationServiceExtension to fully unload and release all its resources?
If the code below is run it causes an exception
'NSInvalidArgumentException', reason: '-[__NSCFType set]: unrecognized selector sent to instance 0x283130be0'
However, the exception can be removed by reducing the width value from 100.0 in positionRect, for example setting it to something like 50.0 removes the exception.
But why is this? With a width value of 100.0 specified for positionRect, that's well short of the width of imageSize. And even if there is some size issue, why is there an unrecognized selector exception?
let imageSize = CGSize(width: 400, height: 100)
let testRenderer = UIGraphicsImageRenderer(size: imageSize)
let testImage = testRenderer.image { context in
context.cgContext.setFillColor(UIColor.black.cgColor)
context.fill(CGRect(origin: .zero, size: imageSize))
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = .left
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 8.0),
.paragraphStyle: paragraphStyle,
.foregroundColor: UIColor.white.cgColor
]
let attributedString = NSAttributedString(string: "This is some text", attributes: attributes)
let positionRect = CGRect(x: 10, y: 10, width: 100.0, height: 8.0)
attributedString.draw(with: positionRect, options: .usesLineFragmentOrigin, context: nil)
}