Xcode Compile Error: Lipo: can't open input file - ios

/fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: /Users/zicjin/Library/Developer/Xcode/DerivedData/Baozou-iOS-gsgjiwiqjwffeheenpeffrqpytqx/Build/Intermediates/Baozou-iOS.build/Debug-iphoneos/Baozou-iOS.build/Objects-normal/armv7/Baozou-iOS (No such file or directory)
Use virtual machines to compiler does not complain, but switched to the real machine (iphone5s) runtime compilation error will be so
the sourcecode on github

Set your Build Active Architecture Only to YES, then it will work

This happened to me. I'm using a static library in my project and the issue was that I put the aggregate with the universal script as a target instead of using the library itself.
This happens when the universal script tries to generate the universal library but the library itself is not compiled, this script needs the library to be created before running.

In Xcode 7.2 I had to set Enable Bitcode to No in Build Settings > Build Options.

I ran into this problem while migrating my project from Xcode 5.0.2 to Xcode 6.1. These are the steps that I followed to get it working.
There was a warning generated - "Used recommended settings ... blah blah" - I allowed Xcode to change my project to whatever recommended settings there was.This did not stop the error though.
In TARGET -> BUILD SETTINGS -> BUILD ACTIVE ARCHITECTURES ONLY . I turned the flag to YES.
set TARGET -> BUILD SETTINGS -> Linking -> Other Linker Flags : $(OTHER_LDFLAGS)
After step 3 -I cleaned and then build my project and Whoa the error just vanished!!!!!

In your project > Build Phases
Place your lipo run script after CocoaPods scripts, your lipo will run after cocoapods finishes building its frameworks
As you can see here

This same thing happened to me in Xcode 12.4, in Mac os CataLina This issue was occured by Not Enough Storage, I have deleted derived and some other data, then Build for Diawi link was successfully created.

Related

Xcode11 Archive fails: no such file or directory Objects-normal/arm64/UniversalSDK.SwiftFileList

I am trying to build a universal framework from existing source code in Xcode11.
When I Archive, it fails with following error:
/<unknown>:1:1: no such file or directory: '/Users/apple/SANDBOX/VoiceSampler/#/Users/apple/Library/Developer/Xcode/DerivedData/VoiceSampler-foeghskagbaeclezzbypkqnjnuos/Build/Intermediates.noindex/ArchiveIntermediates/BuildUniversalSDK/IntermediateBuildFilesPath/VoiceSampler.build/Release-iphoneos/UniversalSDK.build/Objects-normal/arm64/UniversalSDK.SwiftFileList'
/:1:1: no such file or directory: '/Users/apple/SANDBOX/VoiceSampler/#/Users/apple/Library/Developer/Xcode/DerivedData/VoiceSampler-foeghskagbaeclezzbypkqnjnuos/Build/Intermediates.noindex/ArchiveIntermediates/BuildUniversalSDK/IntermediateBuildFilesPath/VoiceSampler.build/Release-iphoneos/UniversalSDK.build/Objects-normal/arm64/UniversalSDK.SwiftFileList'
I was able to Archive the same in Xcode 10.3 earlier. Not sure what changed.
Please help me solve this Archive error.
I don't know if it helps, but for me it happens when I run the Swift compiler manually from inside XCode (a script which builds a separate Swift framework). XCode sets the environment variable SWIFT_RESPONSE_FILE_PATH_normal_x86_64 (variant and architecture) which points to that particular missing .SwiftFileList file. Unsetting this environmant variable solved the issue for us.
This is how we unset it in the external script:
for V in ${BUILD_VARIANTS}; do
for A in ${ARCHS}; do
unset SWIFT_RESPONSE_FILE_PATH_${V}_${A}
done
done
For me the issue was related with using the legacy build system instead of the new one (in Xcode 11). Once I switched to the New Build System (in File -> Workspace/Project Settings), these new lines started to appear in the build log:
WriteAuxiliaryFile /Users/.../XXXXXX.SwiftFileList (in target 'XXXX' from project 'XXX')

can't make an archive on Xcode 10

I tried to make an archive our project.
But the following error happened when archive.
no such module logging_framework.
on the other hand,on debug build, no error happened.
this project uses some frameworks which are taken by Carthage,git submodule.
Some frameworks are inclueded by embedded binaries.
this error is here.
the error of framework is taken by git submodule.
By the way,another project doesn't produce any errors even if archive is.
What is this problem?
My environment is Xcode 10,swift 4.2.
In build setting try setting enable bitcode to No.
Delete drive data, clean project and archive again.
Issue happens when the sub project(logging_framework's) Deployment Target is newer than the main project(shotworks_for_ph..).
Set all project's Deployment Target to the same may solve it.
Deployment Target Settings

Not able to link a Carthage framework to Xcode project

I am trying to link a new framework downloaded via Carthage to one of my project but getting a linker error:
I'm following these steps:
Updated the Cartfile with the framework location.
Run carthage update command to fetch the framework.
Under project target -> Build Phase added a new Run script and renamed it to Framework Copy.
Added the script to copy the framework from the file system : $(SRCROOT)/Carthage/Build/iOS/CleanroomLogger.framework.
Dragged and dropped the framework from the mentioned location under Link Binary With Libraries section of project target -> Build Phase.
Double checked the Framework Search Path under build settings and it seems to be set correctly : $(PROJECT_DIR)/Carthage/Build/iOS.
Am I missing something?
Eventually it turned out to be deployment target issue. The framework I was linking was supported with minimum deployment target as 8 and I was running with 7 :). I wish the build error could be more descriptive.

xcodebuild failure clang:error no such file or directory:

Having a problem when building with xcodebuild. My project/app builds fine with the Xcode - gui. It simply isn't finding/building the libcryptopp library which is part of the build process.
The error is:
clang: error: no such file or directory: '/Users/builder/repo/ioskpay/xcode-cryptopp/cryptopp/build/Release-iphoneos/libcryptopp.a'
This particular file should be derived from another project inside the main app - xcodebuild simply isn't correctly pointing at the right file folder which should be:
~/Library/Developer/Xcode/DerivedData
Any ideas?
To fix this, go to your project settings, go to Targets and select your main project target. Then go to Build phases. Under Target dependencies add the static library project.
This way, when you compile the main project, the static library subproject gets compiled before the main project and your static library will be available.
I had the same problem, but for a resource file .m
I opened target -> build phases -> Compile sources
and I found the file the compiler was tell it can't find duplicated: one with strange icon and the other with a normal icon. I simply removed the one with strange icon and it worked. ( I added the file multiple times and I had a merge conflict before that which made something wrong in the project file)
For your case I think you need to remove the lib from target dependencies list and add it again. This may work for you.
In Xcode Version 9.2 (9C40b) this happened when I drug a bunch of files into the project, some of which were duplicate. Rather than simply not adding the duplicates, it added them again and only the name, not the path.
In Target > Build Phases > Compile Sources each of the duplicates showed with no "...in" after them. Each one caused the clang error.
After removing all of the duplicates that Xcode collected, the project compiled and ran.
It makes you use the Project Navigator instead of managing your source files in the Finder. Then the Project Navigator can't replace duplicates like any decent file management system (ahem Finder). 🤨
My xCode info is:
I faced similar errors during xcode building projects (native swift, flutter, react native, native script) in which I got error messages related to clang compilar. Errors like:
clang-4.0: error: no such file or directory: '/Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxx/Index/Data Store'
clang-4.0: error: cannot specify -o when generating multiple output files
others
Despite of errors related with DerivedData for native apps can be fixed by deleting the directory and, eventually, restart xCode and even restart the machine... in this case, you will see that after deleting the directory and start building process again, the error comes back.
Then, is the moment of checking the clang installation by running clang --version. The normal output will be something like:
as you can see the InstalledDir is incorrect for xCode. In my case, some days ago I needed to install Anaconda app (R, Python, etc) and, now, I remember that I had to install some dependencies and one of them was clang and its installation was altered.
To fix this problem (in my case that I will not need anaconda any more): (edited)
1.- Delete anaconda and all its dependencies (I recommend to use App Cleaner).
2.- Re-install xCode
After reinstalling xCode, if you type again clang --version, you'll get this:
More info at: https://github.com/flutter/flutter/issues/32457#issuecomment-496161092
Hopefully, this info helps some else.
Best
Ok so by simply adding the correct -target -configuration and -scheme parameters I got this to run correctly. However due to my running this in Jenkins for autobuild purposes it still doesn't work as I'd like - getting stuck in exactly the same place. It's odd because I have the exact same code being built in another job that isn't having this problem. There is no rhyme or reason for it at this point. I will keep shooting rubber bands at it and update when I have an answer...
Sometimes Xcode performs weird.
You have to find that static library project e.g.. "filename.a" under 'Link Binary With Libraries' in Build Phase and then remove it and add it again.
I had the same problem while I was archiving my target. I removed the library and the build succeeded.
For me it was because I had removed a package or pod. I ran pod install and it fixed it
Look for the missing file in the Xcode project i.e the files may be deleted or miss placed.
add the missing files to the xcode, then everything will work fine.
Run this command :
$ conda deactivate

Unable to build iOS project using command line but fine via Xcode interface

I have an Xcode project. When in Xcode interactively, I am able to run/build/archive using the Ad_Hoc_Distribution configuration but when I run:
/usr/bin/xcodebuild -configuration Ad_Hoc_Distribution clean build
inside my project, I get an error:
/Users/esg/Documents/app-ios/testapp/testapp/AppDelegate.h:14:9: fatal error: 'RestKit/RestKit.h' file not found
#import <RestKit/RestKit.h>
^
1 error generated.
What would cause this to fail from the command line when it works via the interface?
My team has encountered this same issue. After upgrading from Xcode 4.3.2 to 4.4.1, files that used to be found correctly no longer do.
By comparing the output of xcodebuild vs. Xcode's own build logs, and then comparing vs. our Xcode 4.3.2 build logs, we discovered that xcodebuild and Xcode IDE do not build with the same header dependencies anymore. When xcodebuild runs a 4.4.1 build, it uses an incorrect base directory for include files, which does not include the entire current path leading to the .xcodeproj directory. The last two directory nodes in the folder path appear to be truncated.
But building from Xcode IDE worked fine.
We worked around this problem by adding the correct header paths, as Xcode reports it, as an additional header dependency:
$(SRCROOT) is what seems to be interpreted incorrectly when xcodebuild is employed. It should contain the two subdirectories I inserted in the second line.
I can only conclude that there is a ripe and spicy new bug in the xcode/xcodebuild interaction, but you can fix your header dependencies to at least get things compiling.
See my own issue regarding this.
xcodebuild header files not found in ReskIt
I resolved it by changing nothing, but by adding a workspace and a scheme and used it to build. All the header settings were the same as it is being set for Xcode GUI to build.

Resources