error: could not build Objective-C module 'Quick' - swift

Running my Quick and Nimble tests in Xcode and I am now getting this error out of the blue.
Build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Quick.build/module.modulemap:2:19: error: umbrella header 'Quick-umbrella.h' not found
umbrella header "Quick-umbrella.h"
^
error: could not build Objective-C module 'Quick'
How can I fix this?

Quit Xcode
Clear your derived data. You can find your derived data in here
~/Library/Developer/Xcode/DerivedData
Clean your project (⌘+Shift+K)
Build your project (⌘+B)
Or ;
Another way can fix your issue :
Go to Xcode Preferences
Choose Test
Check the Gather coverage tick as indicated the ss :

Issue seemed to be the fact that my M1 doesn't support iOS versions lower than 14. I did not have the correct one selected without realizing and I spent a lot of time trying to figure out why Quick testing wasn't working but my XCTests were.

Related

Conversion to Swift 5 produces 'Multiple commands produce x86_64.swiftmodule' error

I am trying to get Xcode 10.2 to convert my hybrid Objective-C / Swift project to use Swift 5. Whenever I do this, however, the compilation files due to the following error
error: Multiple commands produce '/Users/<User>/Library/Developer/Xcode/DerivedData/SurgEval-chcbdqcuvbtwckedraqzdhwbsqpm/Build/Intermediates.noindex/SwiftMigration/SurgEval/Products/Debug-iphonesimulator/MYAPP.swiftmodule/x86_64.swiftmodule':
1) Target 'MYAPPTests' (project 'SurgEval'): Ditto /Users/alenox/Library/Developer/Xcode/DerivedData/SurgEval-chcbdqcuvbtwckedraqzdhwbsqpm/Build/Intermediates.noindex/SwiftMigration/SurgEval/Products/Debug-iphonesimulator/MYAPP.swiftmodule/x86_64.swiftmodule /Users/<User>/Library/Developer/Xcode/DerivedData/SurgEval-chcbdqcuvbtwckedraqzdhwbsqpm/Build/Intermediates.noindex/SwiftMigration/SurgEval/Intermediates.noindex/SurgEval.build/Debug-iphonesimulator/MYAPPTests.build/Objects-normal/x86_64/MYAPP.swiftmodule
2) Target 'SurgEval' (project 'SurgEval'): Ditto /Users/<User>/Library/Developer/Xcode/DerivedData/SurgEval-chcbdqcuvbtwckedraqzdhwbsqpm/Build/Intermediates.noindex/SwiftMigration/SurgEval/Products/Debug-iphonesimulator/MYAPPL.swiftmodule/x86_64.swiftmodule /Users/<User>/Library/Developer/Xcode/DerivedData/SurgEval-chcbdqcuvbtwckedraqzdhwbsqpm/Build/Intermediates.noindex/SwiftMigration/SurgEval/Intermediates.noindex/SurgEval.build/Debug-iphonesimulator/SurgEval.build/Objects-normal/x86_64/MYAPP.swiftmodule
I have already tried switching to using the 'Legacy Build System' as suggested in other similar questions, but I would like to migrate to the new build system.
I have also tried to change the product module name in my test target as suggested in another question, but that broke my tests.
The application and tests both build and run fine otherwise, I just get a compilation error while running the Swift 5 migration tool.
Any idea what's going on here, or some some docs I can look at to better understand this?
Thanks!
I was able to partly solve this issue by adjusting SWIFT_MODULE_NAME property in Test target.
My test's target SWIFT_MODULE_NAME was same as main target name, so i changed it

Library not Loading/Image not Found - Swift 4.0

So I am very new to Swift and XCode. I am trying to use an external library called JJFloatingActionButton the projects build fine but when I try run it on an emulator I get:
dyld: Library not loaded: #rpath/JJFloatingActionButton.framework/JJFloatingActionButton
Referenced from: /Users/mkangwa/Library/Developer/CoreSimulator/Devices/
3E58C8A1-3F02-4CA0-8EF3-A79311A202A2/data/Containers/Bundle/Application/D8BBF9A8-5BC7-4619-
B08C-2E6F7C6BCB85/DriversHub-iOS.app/DriversHub-iOS
Reason: image not found
Now of course I know you can't come ask a question like this on StackOverflow without researching and trying to find a solution yourself, so thats what I've been doing for the past few hours I have been looking at what was causing this, I started thinking that maybe it was the library it's self so this one is the third or fourth I've tried till I came across a few posts on SO that were about this issue.
Most people fixed this by just putting the Framework into the Embedded Binaries in the targets General Settings. And I tried this but I now receive a log:
I also get a Dependancy Analysis Warning:
I don't know much about these types or warning and errors but it's saying that it can't find the file which is pretty self explanatory but when I am adding the file to Embedded Binaries it shows the framework file there
What I often do when I have problems with cocoapods is remove cocoapods from the project and reinstall it.
You could use pod deintegrate (https://github.com/CocoaPods/cocoapods-deintegrate) to remove it and then a pod install to reinstall.
So it took a day and a half to work this out but I have finally got it and I can carry on with my project.
Problem:
The problem in my particular case (because other methods seemed to have worked for people trying to achieve the same thing) that the reason my project wouldn't build and was throwing Build Time errors was because after adding the Framework to Embedded Binaries it was also adding it to Embed Frameworks in my targets Build Phases. This then, I believe, caused the compiler to try and build it twice hence the Multiple Build Commands error
Solution:
So the errors I kept getting where saying No such file or directory above it was saying Multiple build commands for output file and what I did to fix this I went to Build Phases in my target settings and deleted the framework from Embedded Frameworks but made sure it was still under [CP] Embed Pods Frameworks.
in my case I was have to make framework "embed & sign" in stead of "don't embed"

'Convert to latest Swift Syntax' breaks the build even when there are no changes

My project is in objective-c with just one tableviewcontroller in swift. I downloaded the Xcode-beta today which prompted me to 'Convert to latest Swift Syntax'. After I follow the steps it shows me that there are no changes. I do not see any changes in the proj file either but it has errors. Please note that I do not see the errors when I choose not to covert to latest swift syntax - the app builds and runs fine in this case.
Any idea why it is breaking?
Here are the errors -
cannot parse the debug map for "app name" No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
the other errors are that it is not able to find the swift file. The swift class was initiated in the objective-c class.
Switch ENABLE_BITCODE to NO in project build settings helped me.
Product -> Clean helped in my case.
I had an issue similar to this, and I fixed it by changing the build phases/ compile sources in the project :
I had added in new sources that needed to be compiled earlier in the project, and after i deleted the files, when I tried to build the project it said it was missing the files that I deleted. After deleting a few of the build phases that appeared as though they were not the default build phases, it worked fine.
I found that there were a default of 4 compile sources.
Also, using Ctrl+Shift+K will clean your project, which helped me another time with an error like this.
I was having the same issue, and none of the above answers helped. Apparently, my issue was I had an import using a .m file instead of a .h file.
The easy way to find and fix these would be Find > Find in Project... and searching for #import.*m and changing them to the appropriate .h file

Linker command failed with exit code 1 error in Xcode project

I was working on my project and suddenly after editing the code and compiling gave this error:
ld: warning: directory not found for option '-
L/Users/mani/Documents/Classes/Twitter+OAuth/Libraries & Headers' ld:
duplicate symbol _OBJC_CLASS_$_playSiew in
/Users/mani/Library/Developer/Xcode/DerivedData/learn-aktrtiwswclovoatyweyquoxmypa/Build/Intermediates/learn.build/Debug-iphonesimulator/learn.build/Objects-normal/i386/playSiew.o
and
/Users/mani/Library/Developer/Xcode/DerivedData/learn-aktrtiwswclovoatyweyquoxmypa/Build/Intermediates/learn.build/Debug-iphonesimulator/learn.build/Objects-normal/i386/Thumb.o
for architecture i386 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
I never touched the project settings, just edited the code.
What's more strange is that I took out last revised code from svn but still I got the the same error.
You may be accidentally #import'ing a .m file instead of a .h. Use Cmd+Shift+F and search for ".m" (without quotes). It will most likely lie in one of the classes mentioned in the warning. If not, clean and run again.
I was also having same issue and I did following and issue is gone.
Go to Product -> Clean and re-run the project.
I hope it might be useful for some other developers.
After running into this problem a few minutes ago (yes, I know it's been 7 months since the original thread) I found that the root of my issue was due to me dragging & dropping files into my project within XCode instead of right-clicking and choosing Add Files to Project.
Check playSiew.m is in Compile Sources section. isn't it?
You can find Compile Sources section follow this step
Select YourProjectName
Select TARGETS
Select Build Phases
If don't have playSiew.m in this section . You must to add it to this section.
As I said the problem wasn't the code but some settings. So what I did was copying the code from my friends' Mac (it was working fine), and installed a fresh copy of the project to my Mac. It worked.
I was importing a library in a test case which I had specified in my pod file for the main target but not for the test target.
I also got this error because I had accidentally included two versions of the same source file. Deleted the wrong one and the problem went away...
If you're working in Unity and export to iOS and you are using a plugin, go to Xcode Build Settings and set ENABLE BITCODE = NO. I'm guessing this might apply to other situations as well
Faced similar issue, while running the code on a simulator, tried all the above mentioned options, still got the same error. Tried connecting the iOS device and build the code, it worked for us. This can be a quick workaround.
the same error i faced. so, i just removed reference of that classes which are generating the errors and than again gave reference and the error was gone...
as D80Buckeye says there should be problem of dragging and dropping files instead of Clicking on "Add Files"
In case this comes in useful for anyone else--I just had this same error, and turns out the cause was initializing a variable in my header file rather than in the main file.
I just encountered the same error. If you are using embedded Libraries, make sure your Deployment Target is set to iOS 8.0 or higher.
you only need to add the following framework: quartzcore.framework
The only way we can get past this bug on our project is to do a Clean and then build for iPad Retina. After that it will build successfully for any device. Weird.
In my case i have add reference of FacebookLoginSDK framework but forget to give search path in build setting. After removing its reference everything was fine.
So conclusion is if you are adding any external framework be careful.
If this happens to you with CoreData generated classes, combine the +CoreDataProperties and +CoreDataClass into the +CoreDataProperties class and delete the +CoreDataClass. Make sure to search Derived Data for leftovers of the +CoreDataClass. Even after deleting the Derived Data and cleaning I sometimes had Xcode just generate the +CoreDataClass again and again. Deleting it manually in Finder and then re-bulding helped me solve this.
try this, go to Target -> Build Settings,then search these three as following,
GCC_NO_COMMON_BLOCKS,
CLANG_WARN_INFINITE_RECURSION,
CLANG_WARN_SUSPICIOUS_MOVE,
set NO to each value then clean and build.
I tried several of the answers listed but none worked for me.
I got the error after updating XCode (while it was still open which may have contributed to the problem)
First, I deleted my Derived Data folder:
XCode => Preferences => Locations => Double Click on arrow next to path indicating where the Derived Data folder is.
Then "Move to Trash"
I don't think that's what the problem was, but it's amazing how many times this has been an issue for me working on different problems.
Second, I 'Quit' the simulator.
Third, I 'Quit' XCode.
Fourth, I opened up my project in XCode again and then did a Clean and Build (found in the Product menu)
Fifth, I ran my project and it worked fine
Cleaning the project not works for me.
Restart the Xcode works for me...
For me it was different. I had the same error when I removed a Pod and solved it by removing this pod from the Other Linker Flags in the Build Settings
then clean your project [Product > Clean] and rebuild
Go to general and linked frameworks and libraries in xcode and remove all the files there.

Xcode 3.2.1 - Symbol / Documentation lookup is failing based on mystery plugin/preference

Since upgrading to Xcode 3.2.1, I've experienced a strange issue that has really killed my workflow. The issue only exhibits itself under my own user account (the same project opened by a different user works fine). Therefore, the heart of this question is, "what does Xcode load from the user directory that could conceivably cause this issue?"
(System: Snow Leopard 10.6.1; Xcode 3.2.1 w/ iPhone SDK 3.1.2)
Symptoms:
Code completion only works on symbols of the current class or already referenced in the class. Virtually useless.
Document/reference lookups (i.e. option-double-clicking on an identifier or symbol returns this strange result): "Documentation not found for the symbol 'symbol name'. Click here to view symbol declaration."
Like I said, since other users are experiencing normal behavior in Xcode, this must be due to something only loaded for my user account. I've already eliminated ~/Library/Preferences/com.apple.Xcode.plist, ~/Application Support/Developer,~/Application Support/Xcode`.
The only thing I've recently installed is mogenerator (the defunct xmod integration may have killed it, but it doesn't install anything to the user directory)
Update: 10/26/09
This one is really starting to kill me. I did a fresh OS X install, followed by an Xcode 3.2 install from the Leopard disc, followed by an iPhone SDK install from the ADC site, and this started occurring again within 30 minutes of my having started working. I'm at an utter loss. The error is most obvious when option-double-clicking on a symbol (say, the NSString class) and instead of getting the documentation snippet, a message "Cannot determine the symbol for the current selection." appears.
Update: 10/26/09 #2
I just tried creating a fresh project, and that project's symbols are appearing fine. So the issue is apparently local to my project. Hopefully that's a better start. To demonstrate what I'm talking about, here's a screen of the issue manifesting itself with respect to documentation:
Have you tried rebuilding your CodeSense index? Project > Edit Project Settings > General >
alt text http://idisk.mac.com/cdespinosa/Public/Rebuild.png
After doing that, check Console.app to see if Xcode issued any warnings. It's possible that some of your source code causes the indexer to stop, and you don't end up with a valid index. Filing a bug with Apple and providing the source, if possible, would help Apple fix problems like this.
This is the first thing I'd try:
alt text http://img.skitch.com/20091026-ek3id5s121wqrsiu8apwm4qgir.png
Wait until it doesn't say "Getting" anywhere anymore before doing anything documentation related.
Given the clues from the console:
10/26/09 7:21:58 PM Xcode[19072] Warning: Couldn't discover the 'clang' compiler's built-in search paths and preprocessor definitions for language dialect 'objective-c'. This may lead to indexing issues.
Compiler: /Developer/usr/bin/clang
Reason: clang version 1.0.1 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-24 exported)
Target: x86_64-apple-darwin10
clang: warning: not using the clang compiler for the 'armv6' architecture
I'm going to say that you tried to configure an iPhone Device build to use the Clang compiler, which is not yet supported for compilation. (It works for static analysis, but not for building).
Find the Compiler Version build setting and set it back to gcc 4.2.
I had this same problem and I was able to workaround it by:
Setting the target to be the iPhone simulator
Quit and relaunch Xcode
Rebuild the index
Clean and rebuild the simulator target
Maybe it's a bug in Xcode with iPhone device selected when a project is first opened.