Closed xoridius closed 2 years ago
Hello,
Thank you for detailed report.
Actually, myTarget SDK already supports Apple Silicon (M1) since v.5.11.0 (released 2021-04-16)
mytarget-ios-sdk-5.15.2/MyTargetSDK.xcframework/ios-arm64_x86_64-simulator/MyTargetSDK.framework
lipo -archs MyTargetSDK arm64 x86_64
mytarget-ios-sdk-5.15.2/MyTargetSDK.xcframework/ios-arm64_armv7/MyTargetSDK.framework
lipo -archs MyTargetSDK arm64 armv7
Also, there is no "user_target_xcconfig" attribute in .podspec file. We use only "pod_target_xcconfig" attribute in order to simplify Pods merging process. Yes, you're right, there is "VALID_ARCHS" parameter used but I believe it should be ignored while installation. Anyway we'll check if it cause some issues and test our SDK installation side by side with others.
@aserrr Thanks for response.
user_target_xcconfig
is used in myTrackerSDK
dependency pod, which cause xcconfig merge conflicts during pod install
and pollutes user target.
Also I believe it is not required to specify source_files
and public_header_files
fields for framework headers when using vendored_frameworks
, so there is a little room for podspec cleanup.
Would you mind sharing details about your case using pod_target_xcconfig
you mentioned earlier?
We will update podspec files for myTarget and myTracker SDK in future releases.
Shipped framework breaks iOS Simulator builds on Apple Silicon (M1 macs).
XCFrameworks are required to include the arm64 slice for iOS devices and the macOS iOS simulator for Macs running on Apple silicon.
To fix the issue:
1) Recompile libraries as XCFrameworks with
arm64-simulator
slice (generic/platform=iOS Simulator
) 2) Remove deprecatedEXCLUDED_ARCHS
[1] andVALID_ARCHS
[2] build configuration overrides from podspecs (remove all uses ofspec.pod_target_xcconfig
andspec.user_target_xcconfig
).Simplified example of building framework target as XCFramework:
References:
WWDC19 XCFramework announcement https://www.wwdcnotes.com/notes/wwdc19/416/
Create an XCFramework https://help.apple.com/xcode/mac/current/#/dev544efab96
Supporting XCFrameworks by PSPDFKit https://pspdfkit.com/blog/2020/supporting-xcframeworks/, https://pspdfkit.com/blog/2021/advances-in-xcframeworks/
XCFramework example project https://github.com/bielikb/xcframeworks
Cocoapods podspec examples with binary XCFrameworks: FirebaseAnalytics UnityAds PSPDFKit OneSignal FBSDKCoreKit
TN3117: Resolving architecture build errors on Apple silicon https://developer.apple.com/documentation/technotes/tn3117-resolving-build-errors-for-apple-silicon
"Only use the
EXCLUDED_ARCHS
build setting on targets where the final released app is not using the target’s functionality on a specific architecture, such as a Mac app that only supports a legacy feature on Intel-based Mac computers ... Do not useEXCLUDED_ARCHS
with pre-compiled libraries that are not updated with support for the iOS, watchOS, or tvOS simulators on Apple silicon."VALID_ARCHS
flag has been deprecated since Xcode 12 (September 2020) https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notesVALID_ARCHS
issues https://github.com/search?q=VALID_ARCHS&type=issuesCocoapods docs: "
user_target_xcconfig
attribute is not recommended as Pods should not pollute the build settings of the user project and this can cause conflicts." https://guides.cocoapods.org/syntax/podspec.html#user_target_xcconfig