No such module 'RxBlocking' in test target - ios

I'm using Carthage for setting up my project's RxSwift dependency. And recently, I tried to use XCFrameworks instead with the command carthage update --platform ios --use-xcframeworks. I've set up all that is needed to be set (eg. changing the .frameworks to .xcframeworks in the Link Binary With Libraries in the targets' Build Phase, etc). It worked and I can run or test in the simulator, until today that is. When I was trying to do the tests this morning, all of a sudden it failed (although it worked fine before) with the error No such module 'RxBlocking'. I've double-checked it and the xcframework has already been built in the Carthage/Build folder, and the xcframework has already been added to the test target's settings.
I've tried all of these but it all failed:
Setting the $(PROJECT_DIR)/Carthage/Build to the Framework Search Paths for the target
Deleting DerivedData/ and/or Carthage/ folders
Resetting the Mac
Can anybody help me to fix this? BTW, I'm on XCode 12.4 and Swift 5. Thanks.

This is actually because of the Apple tools that can't search for the correct Frameworks Search Path. The fix is in this link: https://github.com/ReactiveX/RxSwift/issues/2292#issuecomment-804045119

Related

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

Project Builds and Runs, but does not Archive

I have a project which builds and runs fine on the simulator and device, but fails when archiving.
The project is very old, but I have created a separate component which I have added in the workspace.
The main project is written in Objective-C, the new project is written in Swift 4. The project also uses CocoaPods and also includes another subproject written in Swift 3.2
There are various errors which all boil down to the same thing, the sub project is not producing any output when it is compiled. OR it is just not compiled. I see no errors in the code itself, just when trying to reference it:
//1
error: /Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/Intermediates.noindex/ArchiveIntermediates/<app name>/BuildProductsPath/Release-iphoneos/Framework.framework: No such file or directory`
//2
Signing Identity: "iPhone Developer: <redacted>“
/Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/Intermediates.noindex/ ArchiveIntermediates/<app name>/InstallationBuildProductsLocation/Applications/<app name>/Frameworks/<framework>.framework: No such file or directory
Command /usr/bin/codesign failed with exit code 1
//3
#import ModuleName;
Module ‘ModuleName’ not found
Here’s what I’ve tried:
Clear derived data
Restart Mac
Add $(SRCROOT) to Main Target > Build Settings > Framework Search Paths > Release
Confirmed project is present in Embedded Binaries
Confirmed project is present in Linked Frameworks and Libraries
Removing and re-adding project to embedded binaries and frameworks and libraries
Removing the import declaration
I am opening the workspace and not the project
Skip install set to YES in Subproject build settings
Comparing build settings from the working sub project with the failing one (they are the same)
Running pod update
Changing Always Embed Standard Swift Libraries makes no difference either way
Other notes:
In /Users/<user>/Library/Developer/Xcode/DerivedData/<id>/Build/ Intermediates.noindex/ArchiveIntermediates/<app name>/ InstallationBuildProductsLocation/Applications/<app name>.app/Frameworks/ there is a .framework file for the other sub project and all the pods, but not for this one
In podfile, use_frameworks! is present
Update:
After running an archive today I am only seeing the error:
Module 'ModuleName' not found
The other errors are gone
The issue was to do with the iOS Deployment Target setting:
The main project: iOS 10
Sub project: iOS 11
In Debug it is building only for the current architecture, in Release it builds for all. Obvious once you know.
Setting the sub project to build for iOS 10 fixed the issue.
The most frustrating part: I double checked the build log and it doesn't mention the version issue anywhere :(
It's impossible to tell what exactly causing it to fail archiving. BUT I'm pretty sure I can give you the correct direction =]
Running on simulator or even a real device - compiles the project for "Debug"
Archiving tough, compiles for "Release"
I bet that if you set that running on simulator will compile on Release mode, it will fail!
Check it!!
If I correct you just need to set some of the Build Settings for Release to match Debug
My first guess is: All the search paths (Framework search path, and Runpath search path)
I saw a similar behavior here
I got it to archive after all.
It looked like the SDK-Project was missing a build configuration
Adhoc. Which Project used to archive the project for a specific build
scheme. I think the compiler was looking for modules in the
$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) path
I was having this error, and while my deployment targets did not match, that wasn't actually the fix for me. I had added a new build configuration that I was trying to use for my archive, but I forgot to run pod install after adding it. After running pod install, I was able to archive my app just fine, even though the deployment targets for some of the Pods are iOS 10 while the main app target is iOS 11.
Might be not relevant to you, but helpful to others:
If you using multi-modular SwiftPM-based architecture, then you should read errors carefully and find out if some of your package targets import some other one in sources without integrating it in the Package.swift file. In this case, even the release build will resolve dependencies somehow and succeed if some other package contains your dependency, but the archive will fail.
Package graph examples:
––––––––––
App
├– PackageA [target1(import PackageC.target1)]
└– PackageB [target1(import PackageC.target1)]
└– PackageC [target1]
👆 Builds with success, archives with errors (Can't find module PackageC.target1 in PackageA.target1)
––––––––––
App
├– PackageA [target1(import PackageC.target1)]
| └– PackageC [target1]
└– PackageB [target1(import PackageC.target1)]
└– PackageC [target1]
👆 Builds and archives with success
Cocoapods and Architecture settings
I had a Podfile that set EXCLUDED_ARCHS to arm64 in a post-install script and this was consistent with my main target. This setting was ok for building on Debug mode (x86_64) but didn't work for release building (Archives). I realised the script set EXCLUDED_ARCHS for the Pod targets even on physical devices (Any iOS SDK) rather than only on Simulators.
Steps
I ran pod deintegrate.
I deleted Derived Data.
I deleted Podfile.lock (now we have a fresh start).
I updated the Podfile iOS version to be the lowest supported version in each Pod.
Refactor EXCLUDED_ARCHS script.
Refactoring EXCLUDED_ARCHS script
I refactored:
config.build_settings['EXCLUDED_ARCHS'] = 'arm64'
from the Podfile post-install script to the following:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
...
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
end
end
I haven't done watchOS here because it wasn't a watchOS app, however, we need to do this for all supported simulated device targets.
I left EXCLUDED_ARCHS to arm64 to Any iOS Simulator SDK in the main target for Release mode in the main target. The same logic here applies to other sims.
pod install
Archive again. :D

‘Cordova/CDV.h’ file not found in Xcode 8.2.1

I have one hybrid Cordova project, which is running fine Xcode 5.1.1, but when I am trying to Archive the project in Xcode 8.2.1 with ‘Generic iOS Device’ I am getting the error ‘Cordova/CDV.h’ is not found.
I read many articles about this problem, but none could solve my problem. Most answers are telling to follow the below steps:
"Add this line to your Build Settings -> Header Search Paths:
$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
"
I have did this but problem not solved, getting another error ‘ld: library not found for -lcrt1.3.1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)’
Also I have changed the bitcode YES to NO in target Build Settings, but no fruitful result.
Project cordova version 3.4.0 where installed cordova version in machine 6.4.0
Has anybody experience with this kind of problem?
Please, can anyone help? I've been working on this for days.
I got it work by following below steps
In your Xcode project settings select TARGETS
Within TARGETS select the Build Settings tab
In the sub-options under the Build Settings tab be sure to select All
Scroll down to the Search Paths section
Locate Header Search Paths
Add the following configuration to the Release option (as a new value on its own line): $(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include
Clean the project: Command + Shift + K
Restart Xcode
I wanted to report that the response provided by Vinay worked for me. I had to make sure I was in the share extension target, and I added it to the path exactly as suggested above in the Release option, and did not even have to do a clean to get it to regenerate the PCH.
BUT, I was puzzled by this after looking at the setting further and I realized this path was already in the setting. I edited it again, and removed the redundant path, hit 'run' again, and it loaded onto my iPhone and ran fine.
So, I believe that just setting this in the search path forced a recompile on the share extension PCH and all is working again.
I hope this helps others.
I know its too late to answer on this question but still many developers facing the above issue and as per the latest Cordova & ionic version below steps will work in the above error.
As per new update in Cordova some time due to some permission issue or directly run or build iOS platform it's unable to add below file or folders in your iOS project platform :
CordovaLib
so somehow above folder will not add in your project and that's why it's not building your iOS project.
To overcome this issue you need to remove iOS platform from your ionic project and again add it.
Remove iOS platform: sudo ionic cordova platform remove ios
Add it again: sudo ionic cordova platform add ios
By doing this cordova download CordovaLib folder from server and add it into your iOS project and after that users can able to build their project without any error.
recently I faced this issue and I solved by doing the above steps.
Hope this helps others.
Happy coding!
Seems like the "Cordova" folder isn't getting copied into the project during cordova platform add ios
So, you'll have to copy the "Cordova" source folder into your project manually. But you'll have to download the ios source packages from github first, which is located at:
https://github.com/apache/cordova-ios
After downloading the "cordova-ios-master.zip" package and unzipping it, copy the folder named "CordovaLib" into your project next to the Xcode project file:
PROJECT_FOLDER/platforms/ios/PROJECT_NAME
PROJECT_FOLDER/platforms/ios/PROJECT_NAME.xcodeproj
PROJECT_FOLDER/platforms/ios/PROJECT_NAME.xcworkspace
PROJECT_FOLDER/platforms/ios/cordova
PROJECT_FOLDER/platforms/ios/CordovaLib <------- here
PROJECT_FOLDER/platforms/ios/ios.json
PROJECT_FOLDER/platforms/ios/platform_www
PROJECT_FOLDER/platforms/ios/pods-debug.xcconfig
PROJECT_FOLDER/platforms/ios/pods-release.xcconfig
PROJECT_FOLDER/platforms/ios/www

Xcode Dependencies Error

I was having an issue changing my Target Deployment to 8.4 (its been 9.1since I started the project). I was getting an error saying Parse was setup to use 9.1 so I couldn't change it. Then I changed the platform information in my podfile and reinstalled the pods. Now I am getting these two errors when I try and Build the app.
Check dependencies
Unable to run command 'CpResource RLA\ Volunteer.app' - this target might include its own product.
Unable to run command 'Touch RLA\ Volunteer.app' - this target might include its
own product.
Any help is welcome.
I'm running Xcode 7.1.1 on a Macbook Pro and coding in Swift.
I figured it out. My .app file in my Product folder in Xcode had a selected target. I don't really understand why it worked by unselecting a Target Membership (so nothing is selected when I select the .app file) fixed the dependency errors.

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

Resources