-
-
Notifications
You must be signed in to change notification settings - Fork 7
Switch iOS build to dynamic libraries and xcframeworks #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Updated the iOS build process to generate dynamic libraries (.dylib) instead of static libraries (.a), and package them as xcframeworks for both release and debug builds. Modified SConstruct to build shared libraries with appropriate linker flags and framework dependencies. Updated AdmobPlugin.gdip config to reference xcframeworks and embed them. Refactored build.sh to support dynamic library creation, xcframework packaging, and updated artifact copying accordingly. Added .DS_Store to .gitignore.
cengiz-pz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After adding the quotes to fix the .gdip file, I have tried to export the demo app + updated plugin and ran into the “Multiple commands produce …/AdmobPlugin.framework” error because both AdmobPlugin.debug.xcframework and AdmobPlugin.release.xcframework are being embedded and copied to the exact same destination path in the app bundle. This causes duplicate CodeSign tasks and fails the archive:
error: Unexpected duplicate tasks
note: Target 'Admob Demo' (project 'Admob Demo'): CodeSign .../Admob Demo.app/Frameworks/AdmobPlugin.framework
note: Target 'Admob Demo' (project 'Admob Demo'): CodeSign .../Admob Demo.app/Frameworks/AdmobPlugin.framework
error: Multiple commands produce '.../Admob Demo.app/Frameworks/AdmobPlugin.framework/AdmobPlugin'
note: Target 'Admob Demo' has copy command from '.../dylibs/ios/plugins/AdmobPlugin.debug.xcframework/ios-arm64/AdmobPlugin.framework' to '.../Admob Demo.app/Frameworks/AdmobPlugin.framework'
note: Target 'Admob Demo' has copy command from '.../dylibs/ios/plugins/AdmobPlugin.release.xcframework/ios-arm64/AdmobPlugin.framework' to '.../Admob Demo.app/Frameworks/AdmobPlugin.framework'
error: Multiple commands produce '.../Admob Demo.app/Frameworks/AdmobPlugin.framework'
(same two copy commands as above)
warning: duplicate output file '.../Debug-iphoneos/AdmobPlugin.framework' on task: ProcessXCFramework .../AdmobPlugin.release.xcframework ...
(warnings repeat similarly for Info.plist and the binary itself)
** ARCHIVE FAILED **
Additionally, we already had a plan to transition to fully use xcodebuild and drop SConstruct, but I like your switch to dynamic libs. We'll need to merge the two changes in the near future.
| [dependencies] | ||
| linked=[] | ||
| embedded=[] | ||
| embedded=[@[email protected], @[email protected]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if these are needed here as usually third-party framework dependencies are listed here. Even if needed, each should be put inside double quotes.
| # © 2024-present https://github.com/cengiz-pz | ||
| # | ||
|
|
||
| .DS_Store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if we could add this under a new "# macOS" section in the file
|
|
||
|
|
||
| function generate_static_library() | ||
| function generate_dynamic_library() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the switch to dynamic libraries. It was on our TODO list further down the road.
Updated the iOS build process to generate dynamic libraries (.dylib) instead of static libraries (.a), and package them as xcframeworks for both release and debug builds. Modified SConstruct to build shared libraries with appropriate linker flags and framework dependencies. Updated AdmobPlugin.gdip config to reference xcframeworks and embed them. Refactored build.sh to support dynamic library creation, xcframework packaging, and updated artifact copying accordingly. Added .DS_Store to .gitignore.