Post not yet marked as solved
How can I create a HomeKit action set owned by a trigger, so that it does not appear in the "favorites" section in the Home app?
The action set type HMActionSetTypeTriggerOwned - https://developer.apple.com/documentation/homekit/hmactionsettypetriggerowned is the one that is needed for that, but there seems to be no API to create an action set with the type HMActionSetTypeTriggerOwned.
The Home app by Apple is clearly able to create those trigger owned action sets. How can a I do the same?
Post not yet marked as solved
We are developing 8 SDKs, which are to be shared as XCFrameworks. The SDKs are interdependent on each other and also we have dependency on third party XCFrameworks which they have shared as Cocoapods.
Below is a simple demo of how the dependency graph looks, (@Apple - image attachment will be very helpful here)
A -> B, C
B -> D, E, F
C -> G, H
D, E, F -> H
H -> I, J
I -> K
here G and J are third party XCFrameworks. K is a third party FAT framework, written completely in Objective C. other letters denote the SDKs we are writing fully in Swift with Objective-C compatibility.
You can read the first line as A is dependent on B and C.
We started developing the SDKs by adding all these as Development Pods to a sample iOS Client. The only issue we faced was that even a small change in any of the pods required to clean build the entire project. We got around this setting "Legacy Build System" in Workspace settings.
When we approached release, we generated XCFrameworks and tried adding them to the Client.
We faced the following issue in almost all our frameworks. Because we had class names matching the SDK names, just like the old FAT framework.
‘FrameworkName’ is not a member type of ‘FrameworkName’ errors inside swiftinterface - https://forums.swift.org/t/frameworkname-is-not-a-member-type-of-frameworkname-errors-inside-swiftinterface/28962
Then we renamed all the frameworks and got struck with the following issue.
XCFramework requires to target iOS 13 for inter-framework dependencies with Objective-C compatibility - https://forums.swift.org/t/xcframework-requires-to-target-ios-13-for-inter-framework-dependencies-with-objective-c-compatibility-tested-with-xcode-11-beta-7/28539
We are supporting from iOS 9. So moving to iOS 13 is not even an option. We were not able to find the exact cause of this issue for so long even after exploring the generated .swiftinterface file which was throwing these issues. We found that issue could be because of using inheritance in the following way.
X is a Swift class, made Objective C compatible by inheriting NSObject. When we have another class Y from any of the other SDKs, inheriting X like below, this issue will be thrown.
For example, we have in Framework H.
@objc class X: NSObject { }
and then in framework D, which depends on H, we have
class Y: X { }
We removed it in one place and the issue resolved. We had this pattern all over the eight SDKs and we removed all those.
Then when we tried to build, we ran into the following issue.
'@objc' instance method in extension of subclass requires iOS 13.0.0.
We moved all @objc extension methods to the class. Those were mostly delegates and data source methods from common UIKit classes.
After facing these issues with XCFrameworks in the Client app, we decided to remove the development pod setup and manually drag and drop the xcodeproj files of all the SDKs into the Client app. Also we had to manually add the third party frameworks.
This way, some of the above issues can be identified during development instead of release time.
Now, the situation is that, when we make changes to any of the SDKs, it will be not be reflected unless we do a clean build, which takes a lot of time and is not desirable.
Even then, in some cases, the client app just throws Unable to import D or any other framework, in which we have made some changes. Then we to select that framework in the scheme, build it once and then select on to the Client App and build it again to see the change in our app.
This workflow is cumbersome and painful in the long run. Kindly suggest better alternative setups for developing multiple XCFrameworks.
Our next problem is when generating XCFrameworks, we need each SDK to use the XCFramework of the other dependent SDKs. For this, we have to work our way from the bottom most framework. Generate it, add to the one above it and then move on to the next.
This also feels like a burden in the long run. We seriously hope there are better ways to do it. Kindly suggest those.
We have not used Swift Package Manager (SPM) because most of our customers use Cocoapods for dependency management and the remaing few just drag the frameworks manually into their projects.
If SPM can act as a magic pill and solve all these issues at once, then we can consider using it.
Post not yet marked as solved
In the Xcode 12 betas I'm seeing an issue with importing Swift modules with @objc annotations.
Given two Swift modules which expose classes of the same name:
// FrameworkOne
@objc
public class Thing: NSObject {
		public override init() {}
		@objc
		public func doSomething() {}
}
// FrameworkTwo
@objc
public class Thing: NSObject {
		public override init() {}
		@objc
		public func doSomethingElse() {}
}
And if I have imported both of the frameworks into an ObjC file and interact with the classes in either of them:
#import <Foundation/Foundation.h>
@import FrameworkOneObjC;
@import FrameworkTwoObjC;
@interface Example : NSObject
@end
@implementation Example
(void) example
{
		Thing *thing = [[Thing alloc] init];
}
@end
Then I'm seeing this build error:
'Thing' has different definitions in different modules; first difference is definition in module 'FrameworkOne.Swift' found method name 'doSomething'
But in 'FrameworkTwo.Swift' found method name 'doSomethingElse'
Is this expected behaviour? If so, is there any way to opt out?
In my case FrameworkOne & FrameworkTwo are external dependencies, and I'm unable to change the names of the classes.
Post not yet marked as solved
Hi,
I am writing a Swift framework that primarily serves as a wrapper for a linear algebra library written in C. The framework therefore is a mixture of Swift and Objective C (the Objective C part is there to serve as a bridge to allow the Swift code to talk to the C
I have reviewed the documents on Clang modules and looked at various code examples on the Web. However, I am still not finding a clear path and have had difficulties getting the code to compile (I am also unclear what the official recommendations are for achieving the goal I desire). Here are a few questions:
1) Is it good practice to create mixed languages frameworks that are a combination of Swift and Objective C++? If so, are there examples available that show best practices? If not, what is a workaround?
2) I don’t want to expose the Objective C++ part of the code to the consumer of my framework. I am not clear how to do this. I have read about private modules. However, I am unclear about how to properly use private modules in this context and again lack clear examples.
3) What is the recommended practice when creating module.map files in XCode when XCode itself generates a default module.map file when building a framework? Again, there are some examples on the Web, but I am unclear whether they are correct an none of them explicitly suits my goals.
4) Where is the official documentation on how to properly use module.map files in XCode especially with respect to building frameworks that rely on both Swift and Objective C++?
5) Although I know that if this weren’t a framework, I could create a bridging header to allow Swift to talk to Objective C++. However, in the case of a module there is an umbrella header. My understanding of the umbrella header is that it pertains to code that will consume the framework, not for other code in the framework itself. Can you somehow combine an umbrella header and a bridging header in a framework?
Thanks in advance
Post not yet marked as solved
Hi,
We have developed EnxRTCiOS framework, which is working perfect when we import in any app target. But when I am same in my broadcast extension "SampleHandler" its giving error - "Could not build Objective-C module 'EnxRTCiOS'" and my framework "'RTCCameraVideoCapturer' is unavailable: not available on iOS (App Extension) - Camera not available in app extensions."
I have clean Xcode many time, deleted drive data many time, remove POD file and reinstall still not working. Kindly help me in this.
Post marked as Apple Recommended
We’ve been waiting on a response for default browser entitlements since August 12th when we responded back to “default-browser-requests@apple.com” with the requested data (team id, team, bundle id) & a TestFlight like with the proper changes.
Now with iOS 14 out, our users are now expecting for defaulting capability like other major browsers.
What can we do to continue the process? We just want to deliver the best service to our users.
Best,
With xcode 12 first time build fails for working project with previously installed cocoapods framework:
ld: framework not found Pods_CopticFind
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So, what changed from xcode 11.7 to 12?
Tried running:
pod deintegrate
pod update
No change, still same error.
2. Change Framework Search path to 'recursive'.
No change, still same error.
Post not yet marked as solved
Hey, when I run application with:
ionic capacitor run ios --external
in Xcode 12.0 I stuck with error:
Capacitor.framework: code object is not signed at all In architecture: x86_64
Command PhaseScriptExecution failed with a nonzero exit code
Anyone faced with similar problem?
I am working with:
"@capacitor/core": "2.4.0"
"@capacitor/ios": "2.4.1"
"@ionic/angular": "5.3.2"
Post not yet marked as solved
I have a framework target in Xcode 11.x to build a Dynamic framework with statically linking some 3rd party libraries
using pod file.
platform :ios, '9.0'
#use_frameworks!
target 'Framework' do
pod 'DeviceUtil', '~> 2.0'
end
Now I have a requirement to build a Static framework, and for this I changed the "Mach-O' type to Static Library in 'Framework's' target build settings and able to create Static framework. The generated framework shows all architectures correctly (for architecture i386): (current ar archive random library for all architecutres x8664, armv7 & arm64)._ But the Static framework does not included 3rd party libraries within the Framework binary.
How to generate a Static framework using Xcode11.x which includes other 3rd party libs in its binary? Also changing "Mach-O" type is good enough to generate a Static framework or is there any other way that I am missing?
Post not yet marked as solved
Greetings,
I'm developing a recipe app to learn SwiftUI. It persists the user's recipe data with Core Data, recently adding CloudKit support by switching the container type to NSPersistentClouKitContainer and adding history tracking and a merge policy. Upon installation the app instantiates a persistent store with a sizable set of recipe items from a bundled JSON file, which are eventually successfully synced to iCloud. Upon installing on a *second* simulator/device, though, the JSON-supplied data is eventually duplicated in the local persistent store when an iCloud sync happens, which takes about nine minutes to occur.
Two questions, then: I thought that by setting NSPersistentHistoryTrackingKey true and setting a merge policy of NSMergeByPropertyStoreTrumpMergePolicy, Core Data+Cloudkit would prevent such duplication by comparing attribute by attribute per record. The data from each installation are identical...do I have to handle duplication control manually? If so, what, then, is the point of having a merge policy?
Second, why does iCloud sync consistently take nine minutes to sync the cloud-based data to the local store on the second and subsequent installations? I'd skip using the JSON-based data if that sync happened in a minute or so. Changing the size of the cloud-based data by beginning with a smaller JSON file has no effect on how long sync takes to begin trickling in data.
I'm at a loss as to what the best practice is for instantiating and maintaining data on subsequent installations.
Post not yet marked as solved
Hi,
I am new to objective-c. I tried to run an app as part of my launchd application using openApplicationAtURL() API but I failed. I did R &D also but I haven't found any example
I have an app NetopsFilter.app and If I run this app with '--uninstallFilter' argument then it will deactivate the network extension. I tried from terminal and it is successfully deactivating the extension after entering the credentials in the popup.
App path: /Applications/NetopsFilter.app
argument: --uninstallFilter
I tried as below but failed. Please help me to fix this. How can I pass arguments, necessary configuration settings to the API.
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
NSURL *url = [NSURL fileURLWithPath:[workspace fullPathForApplication:@"/Applications/NetopsFilter.app/Contents/MacOS/NetopsFilter"]];
NSArray *arguments = [NSArray arrayWithObjects:@"--uninstallFilter", nil];
[workspace openApplicationAtURL:url configuration:(NSWorkspaceOpenConfiguration *)arguments nil];
Thanks
Seeing these when trying to create an xcframework for Apple Silicon that supports Mac Catalyst and the iOS Simulator:
Both ios-arm64-simulator and ios-x86_64-simulator represent two equivalent library definitions.
Both ios-arm64-maccatalyst and ios-x86_64-maccatalyst represent two equivalent library definitions.
Here's the command:
xcodebuild -create-xcframework \
		-framework ./xcframework-build/catalyst-x86_64/opencv2.framework \
		-framework ./xcframework-build/catalyst-arm64/opencv2.framework \
		-framework ./xcframework-build/osx-x86_64/opencv2.framework \
		-framework ./xcframework-build/osx-arm64/opencv2.framework \
		-framework ./xcframework-build/iphonesimulator-arm64/opencv2.framework \
		-framework ./xcframework-build/iphonesimulator-x86_64/opencv2.framework \
		-framework ./xcframework-build/iphoneos-arm64/opencv2.framework \
		-output ./xcframework-build/opencv2.xcframework
From my understanding fat binaries for these frameworks isn't valid, but maybe it is in this case? These are static frameworks if that matters at all.
Using Xcode 12.2 RC.
Post not yet marked as solved
I just moved my Xcode project to a new ARM-based MacBook, and am now getting this error from the Google SignIn framework (which was working perfectly on my intel-based MacBook):
"ld: .../Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(...), building for iOS Simulator, but linking in object file built for iOS, file .../Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
I'm also pretty new to Swift, Xcode, and programming in general so any help would be greatly appreciated. Thanks!
I've built an SDK (which has dependencies) and packaged it up as an XCFramework for clients' use, but when I test it in a project, I'm getting:
...SDK.swiftmodule/arm64-apple-ios.swiftinterface:20:8: Cannot load underlying module for...
This occurs in the Compile Swift Sources action and the break is in the import DepedencySDK statement in the swiftinterface file
In the SDK project and the demo, the dependencies are loaded into the project via cocoapods.
Any ideas? Or suggestions on how to debug this further?
Thanks!
Post not yet marked as solved
I am trying to create an XCFramework on Xcode 12.2 (12B45b) and do not get past the archive step for iOS. Simulator archive is created successfully, but because the iOS archive fails so does the -create_xcframework command.
I have followed the instructions outlined here: https://help.apple.com/xcode/mac/11.0/#/dev544efab96
and have built XCFrameworks for other projects without an issue before Xcode 12.2.
My issue is similar to the one from this thread: https://developer.apple.com/forums/thread/658195 except I am not using Cocoapods.
Here are the commands I used to build the archive:
		xcodebuild archive \
		-project "MyModule.xcodeproj" \
		-scheme "MyModule" \
		-destination "generic/platform=iOS Simulator" \
		-archivePath "build/ios-sim.xcarchive"
		xcodebuild archive \
		-project "MyModule.xcodeproj" \
		-scheme "MyModule" \
		-destination "generic/platform=iOS" \
		-archivePath "build/ios.xcarchive"
Here is the error from the xcodebuild output:
The following build commands failed:
Ld /Users/username/Library/Developer/Xcode/DerivedData/MyModule-fkvjupapscucufgdksosogqrhicg/Build/Intermediates.noindex/ArchiveIntermediates/MyModule/IntermediateBuildFilesPath/MyModule.build/Release-iphoneos/MyModule.build/Objects-normal/armv7/Binary/MyModule normal armv7
Ld /Users/username/Library/Developer/Xcode/DerivedData/MyModule-fkvjupapscucufgdksosogqrhicg/Build/Intermediates.noindex/ArchiveIntermediates/MyModule/IntermediateBuildFilesPath/MyModule.build/Release-iphoneos/MyModule.build/Objects-normal/arm64/Binary/MyModule normal arm64
(2 failures)
error: the path does not point to a valid framework: /Users/username/mymodule-root-directory/build/ios.xcarchive/Products/Library/Frameworks/MyModule.framework
The build settings for my target are: Build Libraries for Distribution: YES
Skip Install: NO
Excluded Architectures: arm64 (for "Any iOS Simulator SDK" only) Note: I have tried removing this and still see the error.
I might be missing something, but has something changed recently? Any help is greatly appreciated!
Post not yet marked as solved
We are creating a framework using Xcode and it is working fine with Xcode 12.1 but not working on Xcode 12.2 & above.
When the adopter app imports the framework file it shows the below error
The compiler that produced it, 'Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8)
Post not yet marked as solved
The original Apple ID according to the representative is still “active” however she did hang up in my face when she used my Government name and that name wasn’t initially registered to the original Apple ID.. anyways the restrictions that correspond with a MDM from an apple business management account on my iPhone also the analytics and improvements keep showing activity of another device having access or “remote” capabilities. I copied this portion of some crash reports from the analytics data
Heaviest stack for the target process:
10 ??? (libsystempthread.dylib + 6976) [0x1e79aab40]
10 ??? (QuartzCore + 1891396) [0x1a1a14c44]
7 ??? (QuartzCore + 1833980) [0x1a1a06bfc]
7 ??? (CoreFoundation + 635644) [0x19e50a2fc]
7 ??? (CoreFoundation + 631324) [0x19e50921c]
7 ??? (CoreFoundation + 635020) [0x19e50a08c]
7 ??? (CoreFoundation + 660344) [0x19e510378]
7 ??? (CoreFoundation + 663528) [0x19e510fe8]
7 ??? (CoreFoundation + 511440) [0x19e4ebdd0]
7 ??? (QuartzCore + 971636) [0x1a1934374]
7 ??? (QuartzCore + 1833040) [0x1a1a06850]
3 ??? (QuartzCore + 1774248) [0x1a19f82a8]
3 ??? (QuartzCore + 2141416) [0x1a1a51ce8]
2 ??? (QuartzCore + 1043980) [0x1a1945e0c]
2 ??? (Metal + 702968) [0x1b42c39f8]
2 ??? (libdispatch.dylib + 75840) [0x19e197840]
2 ??? (libdispatch.dylib + 15792) [0x19e188db0]
2 ??? (Metal + 703044) [0x1b42c3a44]
2 ??? (Metal + 701656) [0x1b42c34d8]
2 ??? (IOGPU + 23412) [0x1da745b74]
2 ??? (IOGPU + 24252) [0x1da745ebc]
2 ??? (IOGPU + 71780) [0x1da751864]
2 ??? (IOKit + 33612) [0x1a929734c]
2 ??? (IOKit + 531692) [0x1a9310cec]
2 ??? (libsystemkernel.dylib + 17104) [0x1cb46f2d0]
Also here’s a log of some activity from a MDMiosagent. If anyone had any answers as to how to remove my account from a MDM (unenroll). My device was added to a management account without my consent or authorization.. and this “crime” needs to be reported immediately.
I’ll post that on another question
bold
Hi Everyone,
I'm currently building a flutter app and I've suddenly started getting an error when trying to distribute my app to App Store
Connect. This is the first time I've had this error. I've distributed 8 different builds of the app already without error. Full error is (Application name replaced with {APP NAME}):
ERROR ITMS-90432: "Invalid Swift Support. The file {APP NAME}/Frameworks/AppFrameworkInfo.plist doesn’t have the correct file type for this location. Ensure you’re using the correct file, rebuild your app using the current public (GM) version of Xcode, and resubmit
it." I've taken a look around online but I can't seem to find any working solution.
Is there any known solution? Am I missing something obvious?
Post not yet marked as solved
We have a scenario where we need to integrate multiple unity builds into single Xcode project. Currently we are facing issue while integrating multiple unity projects into native iOS app. So my first question is like whether is this functionality possible ? If yes, please let us know how to proceed on that, or else please provide documentation for the same.
Thanks in advance.
Post not yet marked as solved
Last login: Sun Jan 3 08:12:33 on ttys000
harshdeepuppal@harshdeeps-MacBook-Pro ~ % sudo spctl --master disable
Password:
objc[2629]: Class SPExecutionPolicy is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
objc[2629]: Class AppWrapper is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
objc[2629]: Class AppWrapperPolicyResult is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
objc[2629]: Class AppWrapperPolicy is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
objc[2629]: Class SPLog is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
objc[2629]: Class MIS is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
objc[2629]: Class SPExecutionHistoryItem is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
objc[2629]: Class SPExecutionPolicyItem is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
objc[2629]: Class SPDeveloperPolicy is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
objc[2629]: Class GKScanResult is implemented in both /System/Library/PrivateFrameworks/SystemPolicy.framework/Versions/A/SystemPolicy and /usr/sbin/spctl. One of the two will be used. Which one is undefined.
spctl: option `--master' is ambiguous
System Policy Basic Usage:
spctl --assess [--type type] [-v] path ... assessment
spctl --add [--type type] [--path|--requirement|--anchor|--hash] spec ... add rule(s)
spctl [--enable|--disable|--remove] [--type type] [--path|--requirement|--anchor|--hash|--rule] spec change rule(s)
spctl --status | --master-enable | --master-disable system master switch
Developer Mode Usage:
spctl developer-mode <action>
enable-terminal
Add Terminal as a developer tool.
Kernel Extension User Consent Usage:
spctl kext-consent <action> Modifications only available in Recovery OS
status
Print whether kernel extension user consent is enabled or disabled.
enable
Enable requiring user consent for kernel extensions.
disable
Disable requiring user consent for kernel extensions.
add <team-id>
Insert a new Team Identifier into the list allowed to load kernel extensions without user consent.
list
Print the list of Team Identifiers allowed to load without user consent.
remove <team-id>
Remove a Team Identifier from the list allowed to load kernel extensions without user consent.
harshdeepuppal@harshdeeps-MacBook-Pro ~ %