Xcode 13.3 Build Failed because of Cycle in Dependencies between targets libsignal-protocol-swift - swift

After updating to Xcode 13.3 facing Build failed issues with libsignal-protocol-swift library.
This is happening while building second time while after cleaning and building for first time it is working fine. Also, Xcode 13.2.1 has no such errors.
Xcode Error as below :
Cycle inside libsignal-protocol-swift iOS; building could produce unreliable results. This usually can be resolved by moving the target's Headers build phase before Compile Sources.
Cycle details:
→ Target 'libsignal-protocol-swift iOS' has link command with output '/Users/ankitkhanna/Library/Developer/Xcode/DerivedData/BlueSecures-brawgzawheasvqbvhxxglfnlvdlw/Build/Products/Debug-iphoneos/SignalProtocol.framework/SignalProtocol'
○ Target 'libsignal-protocol-swift iOS' has compile command for Swift source files
○ Target 'libsignal-protocol-swift iOS' has copy command from '/Users/ankitkhanna/Documents/Project-Files/Desk-Factors-Project-Files/BlueChats-IOS-master/libsignal-protocol-swift-master/libsignal-protocol-swift/SignalProtocol.h' to '/Users/ankitkhanna/Library/Developer/Xcode/DerivedData/BlueSecures-brawgzawheasvqbvhxxglfnlvdlw/Build/Products/Debug-iphoneos/SignalProtocol.framework/Headers/SignalProtocol.h'

After struggling for sometime the solution was actually the same as mentioned in Xcode suggestions.
i.e. to Move the Headers in project Target -> Build Phases on top Compiled sources.
Drag and move Headers above Compile Sources fixed the error.
Please see the image for reference.

I've faced the same issue after updating to Xcode 13.3; however, in my case, I didn't have Headers in Build Phases.
I've followed these steps to solve it:
Precondition: Xcode must be closed.
Delete the DerivedData folder:
rm -rf ~/Library/Developer/Xcode/DerivedData
In the Terminal, type the following command:
defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1

Related

Framework not found FBLPromises (Swift Package Manager)

I've seen this problem listed elsewhere, but it always seems to be linked to a Cocoapods installation of Firebase. My problem is the opposite - trying to upgrade from pods to SPM has given me this problem when I try to compile:
ld: framework not found FBLPromises
I'm currently running Xcode 13.3 on a Mac Mini with an M1 chip, but the problem was present in earlier versions of Xcode.
Previously I had Disk (https://github.com/saoudrizwan/Disk) installed via SPM and Firebase/Messaging and Twilio (5.5.1) installed via Cocoapods. I ran pod clean and pod deintegrate, deleted all the Pod files etc and have installed Twilio and Firebase Messaging using SPM. This gives me the following Package Dependencies (and you can see that Promises 2.0.0 has been added successfully):
The top result I get when I look into this is FBLPromises Framework not found, and the second answer suggests adding arm64 as an excluded architecture, but doing that gives me further problems (warning and error below), and I'd rather not exclude an architecture blindly and then go down a rabbithole of trying to fix that when it might not be the solution to my original problem.
Warning and error when I try to exclude arm64 architecture:
None of the architectures in ARCHS (arm64) are valid. Consider setting ARCHS to $(ARCHS_STANDARD) or updating it to include at least one value from VALID_ARCHS (arm64, arm64e, armv7, armv7s) which is not in EXCLUDED_ARCHS (arm64).
error: Build input file cannot be found: '/Users/myName/Library/Developer/Xcode/DerivedData/project-exchrqebmyccatebeoxupvxpdsul/Build/Products/Debug-iphoneos/project.app/project' (in target 'project' from project 'project')
I've not checked to make sure I've not introduced other errors further down the line, but I think the problem was caused by Linker Flags being retained in the build settings.
I went to the Target -> Build Settings -> Linking and deleted everything under 'Other Linker Flags' (OTHER_LDFLAGS is how this is reflected in the project.pbxproj file according to my git diff).
File now compiles and runs successfully, if I find some subtle bugs later that might be caused by this I shall edit this answer accordingly!

Tried archiving flutter project with no disc space left, can't fix errors

Question upfront: How can I thoroughly clean/repair my flutter project to allow it to run/build again?
I had been building and archiving (in Xcode) flutter projects without issue until just now.
My computer ran out of disc space mid archive and forced it to stop with "nonzero exit code".
I deleted a bunch of things on the computer to make space, and now it says there is >100gb left.
I was due for a flutter upgrade, so I ran flutter upgrade, which completed without error.
I closed android studio and Xcode and restarted my computer.
I ran flutter clean as well as clean within Xcode.
I can no longer run the app within flutter or run/archive within Xcode.
The exact errors seem variable, but here are some of them that I see:
Running from Xcode:
.../ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:292:13: Cannot find protocol declaration for 'FlutterTextureRegistry'; did you mean 'FlutterPluginRegistry'?
.../ios/Flutter/Flutter.framework/Headers/FlutterEngine.h:54:38: Cannot find protocol declaration for 'FlutterTextureRegistry'; did you mean 'FlutterPluginRegistry'?
.../.pub-cache/hosted/pub.dartlang.org/in_app_purchase-0.3.1+2/ios/Classes/FIAPReceiptManager.m:13:9: Could not build module 'Flutter'
Running from Flutter (I can't paste all of the errors... way too long):
^~~~~~~~~~~~~~~~~~~~~~
FlutterPluginRegistry
While building module 'Flutter' imported from .../.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ios/Classes/FLTPathProviderPlugin.h:5:
In file included from :1:
In file included from .../Documents/Flutter/patient_medical_record/ios/Pods/../Flutter/Flutter.framework/Headers/Flutter.h:54:
In file included from .../Documents/Flutter/patient_medical_record/ios/Pods/../Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
.../Documents/Flutter/patient_medical_record/ios/Pods/../Flutter/Flutter.framework/Headers/FlutterPlugin.h:395:11: note: 'FlutterPluginRegistry' declared here
#protocol FlutterPluginRegistry
^
3 errors generated.
In file included from .../.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ios/Classes/FLTPathProviderPlugin.m:5:
.../.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ios/Classes/FLTPathProviderPlugin.h:5:9: fatal error: could not build module 'Flutter'
#import
~~~~~~~^
4 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Well this is a bummer because I can't find a clean solution, but for now I did fix it with the following:
Create a new flutter project
Copied over the lib files
Copied over other setup in random places (i.e. google services, android changes)
Copied over pubspec.yaml and ran packages get
It now works again. Clearly something went wrong in the Flutter-managed files that I don't understand. If someone else can think of a better solution to effectively reset the project, please share.

Unrecognized font family 'FontAwesome5Free-Solid'

This happened out of nowhere, and I have no idea what happened.
I started to run my app and got this error:
I believe that it's coming from react-native-vector-icons.
I've tried switching to an older version of react-native-vector-icons, and I still receive the same result.
I've also tried to uninstall react-native-vector-icons, and, when I do, I receive a compiling error.
** BUILD FAILED **
The following build commands failed:
CompileC /Users/lukeschoenberger/Documents/Programming/news-
arg/test6/ios/build/test6/Build/Intermediates.noindex/Pods.build/Debug-
iphonesimulator/RNVectorIcons.build/Objects-
normal/x86_64/RNVectorIconsManager.o
/Users/lukeschoenberger/Documents/Programming/news-
arg/test6/node_modules/react-native-vector-
icons/RNVectorIconsManager/RNVectorIconsManager.m normal x86_64
objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
I'm pretty stuck at this point.
EDIT:
After I linked react-native-vector-desing and cleared the build folder, I received this error:
Build system information
error: Multiple commands produce '/Users/lukeschoenberger/Documents/Programming/news-arg/test6/ios/build/test6/Build/Products/Debug-iphonesimulator/test6.app/AntDesign.ttf':
1) Target 'test6' (project 'test6') has copy command from
'/Users/lukeschoenberger/Documents/Programming/news-
arg/test6/node_modules/native-base/Fonts/AntDesign.ttf' to
'/Users/lukeschoenberger/Documents/Programming/news-
arg/test6/ios/build/test6/Build/Products/Debug-
iphonesimulator/test6.app/AntDesign.ttf'
2) Target 'test6' (project 'test6') has copy command from
'/Users/lukeschoenberger/Documents/Programming/news-
arg/test6/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' to
'/Users/lukeschoenberger/Documents/Programming/news-
arg/test6/ios/build/test6/Build/Products/Debug-
iphonesimulator/test6.app/AntDesign.ttf'
** BUILD FAILED **
Icon module does not appear to be properly linked.
You can try react-native link react-native-vector-icons
If this is not a workaround,
Delete all items in the build folder under the iOS folder. Then rebuild the project with react-native run-ios.
Regular, Solid, and Brand Icons TTF File import android and ios directory
https://aboutreact.com/react-native-fontawesome/

Cannot build any Swift project at all due to strange error about MacOSX10.11.sdk

I'm running macOS 10.12.3 with Xcode 8.3.
I cannot build any macOS Swift projects with it.
If I create a new Cocoa application Xcode project and set it to use Swift, when I try to compile it, I immediately get the following error in the "check dependencies" phase:
error: There is no SDK with the name or path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk'
I have no idea what's going wrong!
The only clue I have is that earlier I created a symlink with the path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk that pointed to MacOSX.sdk in order to fix an issue where an older build of Qt that required an SDK with that path. However, deleting the symlink has no effect.
I can build Swift projects that targeting other platforms like iOS. Just not macOS.
Help!
try running this command then reopening the project
(Xcode uses xtools in the command line to build its projects)
sudo xcode-select -switch /path/to/file/
(by default the path is)/Applications/Xcode.app/
look at this pic
saw it here yesterday

Xcode 7.2 Failed to import bridging header

I have a new configuration(Duplicate of debug) which is showing the error "Failed to import bridging header". But the debug configuration is compiling and running without fail. Following are the details
Xcode 7.2
iOS SDK 9.2
Cordova pluggins in Objective C
Native application code is swift 2.x
One target
Three configurations debug,test(duplicate of debug) and release.
While building the project in Debug/Release configuration no errors and running the app in simulator without any issue.
When I build configurations TestDebug(duplicate of Debug) or TestRelease(duplicate of Release) there are two errors
/Users/ ..../MainViewController.h:11:9: 'Cordova/CDVViewController.h' file not found
Failed to import bridging header '/Users/......./Example4-Bridging-Header.h'
You need to add these Configurations (TestDebug, TestRelease) to the Cordova project as well
Otherwise your main project will look in the folders for TestRelease and TestRelease but won't find the Cordova build results there
By Default Cordova puts build result in Debug-iphoneos and Release-iphoneos
I had a similar issue when I added a custom Distribution to my project.
For me it worked when building, but failed at archiving.
Adding the custom Distribution to Cordova helped
After a clean and build you should see the Cordova lib and include in TestDebug-iphoneos or TestRelease-iphoneos and not in Release-iphoneos or Debug-iphoneos( where I guess it adds it now for you)
Answer for future reference: "Clean" your product