I am using Swift 4.2 and Xcode 10.1 And while importing RxAlamofire to my project I am getting an error "Could not build Objective-C module 'RxAlamofire' ".
I have tried to clean the build folder and build it again. And also delete the Derived data folder and build again. But still getting the same error. Any help appreciated.
Here is a screenshot of the error I'm getting:
Podfile
platform :ios, '9.0'
use_frameworks!
target 'RiderUser' do
pod "FlagPhoneNumber"
pod "KeychainAccess"
pod "SwiftyJSON"
pod "RxAlamofire"
pod "RxSwift"
end
Related
I was running my program softly and at some point (maybe closed the Xcode to reopen or updated pod file) it suddenly it can't compile anymore.
I already tried opening .xcodeproj and .xcworkspace. The first one shows this message when compiling:
The second case shows tons of issues:
This is my pod file:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
target 'HonoluluArt' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for HonoluluArt
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Can I get any help? Thanks a lot!
try to clear pods and reinstall:
in the project folder execute: pod deintegrate
then clean pods: pod clean
Reinstall pods: pod install
this should work
also if you don't need in particular the v3 of Alamofire remove ~> 3 to install the latest version and modify your Podfile:
target 'HonoluluArt' do
use_frameworks!
pod 'Alamofire'
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Alamofire ~> 3.0 is written in Swift 3. Podfile shows that this is an older codebase. You could try building you project with older version of Xcode (xCode 10.0 is last version supporting Swift 3) or you should upgrade Alamofire to actual version ~> 5.0 (you will also need to upgrade project codebase to newer Swift version).
You indicated you opened the project file and compiled. Cocoa Pod instructions clearly state after installing, you should only work in the .xcworkspace file thereafter. Can you open that and try a compile?
I just removed any reference to Alamofire. Pod file, imports, paths and stuff and it worked. I'm trying to manage the code once it is removed, but worked.
Thanks anyway!
I am trying to create a project which uses Realm and RealmSwift. I have used Cocoapods to install these dependencies. I have seen the other posts too on stackoverflow and tried their solutions. They don't work for me. In my project, I'm getting the error "No such module as RealmSwift" when I write the import RealmSwift statement. Here are the steps I took for installation:
I created an empty xcode project
I went into terminal and navigated to my project directory
I gave the pod init command to create a pod file
I went into the pod file(it already had the use_frameworks! statement
I wrote in pod 'Realm' and pod 'RealmSwift'. I gave the sources as:
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
I wrote in pod install
The pods were installed successfully. I went into the .xcworkspace file.
I had already installed the realm plugin so I created a new realm object file
The template file opens with the following file. I'm getting the error that there is no RealmSwift module.
What am I doing wrong? Or what am I not doing? Is a bridging header required? Has anybody else managed to resolve this error?
Any relevant suggestions or insights are most welcome.
Its working now! Its so weird since I didn't do anything. I just went into my pod file commented out the use_frameworks! statement and ran pod update on the terminal. It gave me an error, so I added it back to my pod file. I wrote in pod update again and hit enter. I restarted Xcode cleaned it and built it and I wasn't getting this error anymore.
Need to uncomment platform in your pod file then try once again your pod.
# Uncomment this line to define a global platform for your project
platform :ios, '9.0' // Uncomment this
# Uncomment this line if you're using Swift
use_frameworks!
target 'Demo_Realm' do
pod 'RealmSwift'
end
target 'Demo_RealmTests' do
end
target 'Demo_RealmUITests' do
end
I have added PLCrashReporter using POD
use_frameworks!
pod 'PLCrashReporter'
I have imported following files in Briding Header to use in my swift project
#import <CrashReporter/CrashReporter.h>
#import <CrashReporter/PLCrashReport.h>
If I run the project, then I don't get any problem and it works as expected
If I do xcode unit-test I get the following error
(Xcode->Product->Test)
Add the pods separately for Target and TargetTests
Make the following changes in POD file
target ‘Target’ do
platform :ios, ‘8.0’
use_frameworks!
pod 'PLCrashReporter'
end
target 'TargetTests' do
platform :ios, ‘8.0’
use_frameworks!
pod 'PLCrashReporter'
end
Go to the Build Settings of TargetTests
and set the value for “Other Linker Flags” as $(inherited)
Do a POD install then do Clean Build Folder and run
I have scoured SO and Google but can't find an answer that works. I have used the new Firebase Cocoapod on multiple projects but now, when adding it to a different project I am getting the following error.
I am using Xcode 7.3.1 with cocoapods 1.0.1.
Here is my podfile:
Any help is greatly appreciated!
Go to Build Settings > Other Linker Flags > on a new line $(inherited).
Do a Cmd+Ctrl+K for a clean, and then build.
Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'AppName' do # Comment this line if you're not using Swift and don't want to use dynamic frameworks inhibit_all_warnings! use_frameworks!
Pods for FCM
pod 'Firebase' pod 'Firebase/Core' pod 'Firebase/Messaging'
end
I am trying to use the cocoapod Alamofire in Swift. However, I get the error "No Such Module" when I Import Alamofire I am using Xcode 7.2 Alamofire 3.0 and Swift 2 The following are the steps I took
1) In terminal I ran
$ sudo gem install cocoapods
There were no errors then
2) I ran
cd ~/Path/To/Folder/Containing/Project (once in the project folder I ran)
pod init
3) Then
open -a Xcode Podfile
4) Then I added
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
to the Podfile
5) Then I ran
pod 'Alamofire', '3.0'
followed by
pod install
I added $(SRCROOT) to runpath and buildpath.
Also I found this answer No such module "Armchair" saying to add the pre-release but I don't really understand how to do this or if this is my problem. Maybe this is obvious ,however I'm new to Swift and am not understanding.
Also should Alamofire show up in my frameworks, or pods folder? It isn't in either.
files in project
After pod init you must use the new <YourProject>.xcworkspace instead of <YourProject>.xcodeproj.
The xcworkspace contains your project and your pods after pod install.