ios icon indicating copy to clipboard operation
ios copied to clipboard

feat: iOS 26 metadata generator needs framework search path

Open BozzaDaniel opened this issue 7 months ago • 9 comments

When building an app with iOS 26 SDK the metadata generator is partly broken due to some changes in how the UIKit.framework is structured. The macro "UIKIT_EXTERN" that was previously defined in UIKit/UIKitDefines.h has been moved to UIUtilities/UIDefines.h. The UIUtilities is located in a new folder called SubFrameworks located in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library. The macro is used throughout UIKit and anything that depends on it will result in an error when generating the metadata.

The issue can be solved by adding another path to FRAMEWORK_SEARCH_PATHS: $(SDKDIR)/System/LIbrary/SubFrameworks.

BozzaDaniel avatar Jun 10 '25 12:06 BozzaDaniel

Great mention had noticed that yesterday as well. The project-template-ios can just add that. Would you like to try a pull request to add that to the build settings of the template? https://github.com/NativeScript/ios/tree/main/project-template-ios

NathanWalker avatar Jun 10 '25 13:06 NathanWalker

Seems weird that this isn't caught by the existing system, as I imagine that is required by the UIKit framework?

I'll try investigating it, we might need to upgrade llvm to the latest apple version again

edusperoni avatar Jun 10 '25 13:06 edusperoni

For anyone coming across this which wants to work with iOS 26 beta's, you can open App_Resources/iOS/build.xcconfig and add the following:

FRAMEWORK_SEARCH_PATHS = $(inherited) $(SDKDIR)/System/Library/SubFrameworks

You can also use @nativescript/ios next (npm tag) right now too which has that included.

NathanWalker avatar Aug 06 '25 00:08 NathanWalker

For anyone coming across this which wants to work with iOS 26 beta's, you can open App_Resources/iOS/build.xcconfig and add the following:

FRAMEWORK_SEARCH_PATHS = $(inherited) $(SDKDIR)/System/Library/SubFrameworks

@NathanWalker I tried your suggestion, but then suddenly the project build fails. Not for an empty NS project, but as soon as I install any plugin to that project. For example, when I install @nativescript-community/ui-image and try to build te project, the build fails with

In file included from /Users/felixkrautschuk/Downloads/test/node_modules/@nativescript-community/ui-image/platforms/ios/src/NSImageRoundCornerTransformer.m:1: /Users/felixkrautschuk/Downloads/test/node_modules/@nativescript-community/ui-image/platforms/ios/src/NSImageRoundCornerTransformer.h:1:9: fatal error: 'SDWebImage/SDImageTransformer.h' file not found 1 | #import <SDWebImage/SDImageTransformer.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. In file included from /Users/felixkrautschuk/Downloads/test/node_modules/@nativescript-community/ui-image/platforms/ios/src/NSImageDecodeSizeTransformer.m:1: /Users/felixkrautschuk/Downloads/test/node_modules/@nativescript-community/ui-image/platforms/ios/src/NSImageDecodeSizeTransformer.h:1:9: fatal error: 'SDWebImage/SDImageTransformer.h' file not found 1 | #import <SDWebImage/SDImageTransformer.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. In file included from /Users/felixkrautschuk/Downloads/test/node_modules/@nativescript-community/ui-image/platforms/ios/src/NSImageRoundAsCircleTransformer.m:1: /Users/felixkrautschuk/Downloads/test/node_modules/@nativescript-community/ui-image/platforms/ios/src/NSImageRoundAsCircleTransformer.h:1:9: fatal error: 'SDWebImage/SDImageTransformer.h' file not found 1 | #import <SDWebImage/SDImageTransformer.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. note: Using codesigning identity override: note: Run script build phase 'NativeScript PreLink' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'test' from project 'test') note: Run script build phase 'NativeScript PreBuild' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'test' from project 'test') note: Run script build phase 'NativeScript PostBuild' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'test' from project 'test')

** BUILD FAILED **

Unable to apply changes on device: EB43EA5A-209B-49DE-B533-00284DBC9D7B. Error is: Command xcodebuild failed with exit code 65.

When I manually add the path $(SDKDIR)/System/LIbrary/SubFrameworks in Xcode instead, the build succeeds and I am also able to run the app without crashing.

felixkrautschuk avatar Aug 28 '25 15:08 felixkrautschuk

You can also try switching project to @nativescript/ios next, then ns clean and if able to report your result here would be much appreciated!

NathanWalker avatar Aug 28 '25 16:08 NathanWalker

Hello @NathanWalker, I'm experiencing the same situation as @felixkrautschuk. I already switched to the next tag and I still see the issue.

NativeScript could not load bundle file:///Library/Developer/CoreSimulator/Volumes/iOS_23A343/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS%2026.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/UIUtilities.framework

gabrielbiga avatar Sep 15 '25 22:09 gabrielbiga

Hi @gabrielbiga that particular log line is benign, the bundle files are not required so is normal to see that. Should run normal even when that's present.

Do you see a different stack though? If could share that in full and also can communicate in Discord with package details as can help us provide guidance.

NathanWalker avatar Sep 16 '25 00:09 NathanWalker

Hey @NathanWalker, yeah. We ran into full QA on our app, and that log really didn't affect the experience at all.

Just out of curiosity, what kind of failure can it cause?

gabrielbiga avatar Sep 16 '25 13:09 gabrielbiga

@NathanWalker We're experiencing the same problem;

NativeScript could not load bundle file:///Library/Developer/CoreSimulator/Volumes/iOS_23A343/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS%2026.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/UIUtilities.framework

The app is being installed on the device (simulator) and starts, but crashes immediately with a report button.

We tried updating all versions to next, but no luck so far.

SmailHammour avatar Sep 17 '25 14:09 SmailHammour