I am having an issue when previewing a UIKit ViewController. I am developing my app inside Pods framework which then I import and use in scene/app delegate. I tried to use UIKit to have SwiftUI previews. I conformed to UIViewRepresentable protocol and made a struct that conforms to PreviewProvider where I returned the current controller as some View. I have many external dependencies like Moya, Alamofire, SnapKit...
I am building my components in Pods project. Which I import than into scene/app delegate to start the app.
I am getting the error: "Cannot preview in this file; Unexpected error occurred". I went online and found some people saying that I need to disable Automatically Refresh Canvas setting. But it still doesn't work. I am then getting an error: "Cannot preview in this file; Update failed". I attached a file with a generated report from the error. I also cleaned the build folder and restarted my Mac. I am using Macbook Pro M2.
If I run UIKit previews in a new project it works. But I need it to be able to run in my current project.
https://www.notion.so/Xcode-Previews-UIKit-Error-Report-ba5ec69080f34cb09c6f93c6cd0131d7?pvs=4
Post
Replies
Boosts
Views
Activity
I cannot run my app, I get this error. I installed xcode 15 beta on my mac m2 pro, also I have macOS Sonoma (v14.0) installed. In previous code versions the code was able to run.
Cycle inside Appname; building could produce unreliable results.
Cycle details:
→ Target 'Appname': ExtractAppIntentsMetadata
○ Target 'Appname': CodeSign /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app/Frameworks/APGconnect.framework
○ Target 'Appname' has copy command from '/Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/SourcePackages/artifacts/apgconnect-swiftpackagemanager/APGconnect/APGconnect.xcframework/ios-arm64/APGconnect.framework' to '/Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app/Frameworks/APGconnect.framework'
○ That command depends on command in Target 'Appname': script phase “Firebase Crashlytics”
○ Target 'Appname' has a command with output '/Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app.dSYM'
○ Target 'Appname' has process command with output '/Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app/Info.plist'
○ Target 'Appname' has copy command from '/Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/SourcePackages/artifacts/apgconnect-swiftpackagemanager/APGconnect/APGconnect.xcframework/ios-arm64/APGconnect.framework' to '/Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app/Frameworks/APGconnect.framework'
Raw dependency cycle trace:
target: ->
node: ->
command: ->
node: /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Intermediates.noindex/Appname.build/Debug-iphoneos/Appname.build/Objects-normal-ubsan/arm64/ExtractedAppShortcutsMetadata.stringsdata ->
command: P0:target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3-:Debug:ExtractAppIntentsMetadata ->
node: ->
command: P0:::Gate target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3--package-copy-files-phase ->
node: <CodeSign /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app/Frameworks/APGconnect.framework> ->
command: P0:target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3-:Debug:CodeSign /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app/Frameworks/APGconnect.framework ->
node: <Copy /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app/Frameworks/APGconnect.framework> ->
CYCLE POINT ->
command: P0:target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3-:Debug:Copy /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app/Frameworks/APGconnect.framework /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/SourcePackages/artifacts/apgconnect-swiftpackagemanager/APGconnect/APGconnect.xcframework/ios-arm64/APGconnect.framework ->
node: ->
command: P0:::Gate target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3--fused-phase8--cp--copy-pods-resources ->
node: /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Intermediates.noindex/Appname.build/Debug-iphoneos/Appname.build/InputFileList-8F69F04ECE39CEA4D548803F-Pods-App-Appname-resources-Debug-input-files-6b988fea851b169d138afd42359e554e-resolved.xcfilelist ->
command: P2:target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3-:Debug:WriteAuxiliaryFile /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Intermediates.noindex/Appname.build/Debug-iphoneos/Appname.build/InputFileList-8F69F04ECE39CEA4D548803F-Pods-App-Appname-resources-Debug-input-files-6b988fea851b169d138afd42359e554e-resolved.xcfilelist ->
node: ->
command: P0:::Gate target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3--fused-phase7--cp--embed-pods-frameworks ->
node: /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Intermediates.noindex/Appname.build/Debug-iphoneos/Appname.build/InputFileList-9C4DC43DDD1B70E883929F7A-Pods-App-Appname-frameworks-Debug-input-files-67ca94915dc637813d7d2b89d288f680-resolved.xcfilelist ->
command: P2:target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3-:Debug:WriteAuxiliaryFile /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Intermediates.noindex/Appname.build/Debug-iphoneos/Appname.build/InputFileList-9C4DC43DDD1B70E883929F7A-Pods-App-Appname-frameworks-Debug-input-files-67ca94915dc637813d7d2b89d288f680-resolved.xcfilelist ->
node: ->
command: P0:::Gate target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3--fused-phase6-firebase-crashlytics ->
node: ->
command: P2:target-Appname-e523191a5dddb74851b7e061f613cdd207daf3e2cc00aeba593ba12e8843cae3-:Debug:PhaseScriptExecution Firebase Crashlytics /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Intermediates.noindex/Appname.build/Debug-iphoneos/Appname.build/Script-B66C911C2756492F00413DA0.sh ->
node: /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app.dSYM/Contents/Resources/DWARF/Appname/ ->
directoryTreeSignature: � ->
directoryContents: /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app.dSYM/Contents/Resources/DWARF/Appname ->
node: /Users/fon/Library/Developer/Xcode/DerivedData/Appname-aepljzymlxbnxmekkzdewisujhhh/Build/Products/Debug-iphoneos/Appname.app.dSYM/Contents/Resources/DWARF/Appname ->