I've started a new iOS project in Xcode and have tried installing some common swift packages like SwiftyJSON and Alamofire through cocoapods. The pods install successfully and the full libraries show up under the root project directory, but whenever I attempt to import them into my project Xcode returns a "No such module.." error.
What I've already done:
- I've cleaned and rebuilt the project
- I've ensured that I'm using the .xcworkspace file after installing the cocoapods
- I've rebooted my mac and xcode
- I've tried linking the binaries in the "build phases" tab in the project settings
- I've tried building the project once before installing pods
All to no avail. Here are the versions I'm using:
- El Capitan 10.11.2
- Xcode 7.2
- Cocoapods 0.39.0
Any and all help/suggestions towards what I may be doing wrong are greatly appreciated!
--EDIT (adding podfile)--
platform :ios, '8.0'
use_frameworks!
target 'newApp' do
pod 'Alamofire'
pod 'SwiftyJSON'
end
Try using the following as your podfile. After changing the podfile dont forget to run pod install.
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire'
pod 'SwiftyJSON'
You can add Alomofire: Project -> Target -> General -> Embedded Libraries -> + -> Alamofire.
As you see in picture:
Related
I am able to clone and run flutter video_editor https://github.com/seel-channel/video_editor
in both the iPhone and Android
.
However, if I copy its example part, it works in Android but not on iPhone (physical). Ipod install fails. Please see attached screenhsot.
I am using all the same versions of everything, for the example part as well as the clone part.
Podfile
platform :ios, '9.3'
pubsec.yaml
video_editor:
path: ^1.8.0
helpers: ^1.1.1
image_picker: ^0.8.4
video_player: ^2.2.6
macOS Monterey
version 12.1
xCode version 13.1
It's work for me.
I download example from video editor.
Then in pubspec.yaml file I changed following
# video_editor:
# path: ../
video_editor: ^1.2.2
Then I fire command flutter pub get and pod install it's getting same error you want.
Then after I change platform :ios, '9.3' to platform :ios, '12.1' in pod file and changed deployment info 9.0 to 12.1 in target(Like below image) then fire commane pod install and it's work fine.
I'm attempting to compile a Xcode .xcworkspace built by Unity that contains Google Firebase. I tried all the solutions I could find online without any luck. If you have any ideas I can try, can you please share?
The error I'm getting is that it can't find the BoringSSL-GRPC library. I tried running pod update and pod install to resolve this and I can see while it does successfully install BoringSSL-GRPC (0.0.7), Xcode still gives this error even if I open the .xcworkspace file.
ld: library not found for -lBoringSSL-GRPC
When I add use_frameworks! to the podfile per a suggestion online, I get this error:
ld: framework not found FBLPromises
When I removed the above and then add use_modular_headers! per another suggestion, I get this error:
fatal error: module map file '/Users/xxx/Documents/Builds/DemoProj/Pods/Headers/Private/grpc/gRPC-Core.modulemap' not found
Each time, I changed the podfile, I'd run pod update and pod install before doing a clean build in Xcode.
Here are the versions I'm using:
macOS Catalina 10.15.6
Unity 2019.4.4f1
Firebase 6.15.2
Xcode 11.6 (11E708)
CocoaPods 1.9.3
And here is my podfile:
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'UnityFramework' do
pod 'Firebase/Core', '6.24.0'
pod 'Firebase/Analytics', '6.24.0'
pod 'Firebase/RemoteConfig', '6.24.0'
pod 'FirebaseCrashlytics', '4.1.0'
pod 'FirebaseFirestore', '1.15.0'
end
Notes:
I've also tried adding ,:modular_headers => true at the end of each pod which didn't work.
I have a paid developer account and Xcode is configured for that account
I upgraded both the DJISDK and DJIUXSDK to v4.8.1, the builds are working as expected, but when I try to submit the solution to testflight I get a complaint about DJIUXSDK.framework/Assets.car. I have not done any modifications of the Assets.
Invalid Bundle. The asset catalog at 'Payload/mydjiapp.app/Frameworks/DJIUXSDK.framework/Assets.car' can't be processed. Rebuild your app, and all included extensions and frameworks, with the latest GM version of Xcode and resubmit.
I am building the solution with Xcode 10.1.
My podfile:
target 'mydjiapp' do
use_frameworks!
# Pods for mobilegroundstation
pod 'DJI-SDK-iOS', '4.8.1'
pod 'DJI-UXSDK-iOS', '4.8.1'
pod 'DJIWidget', '~> 1.2'
end
Is there any obvious solution to this that I am missing?
I have been trying to install and use AlamoFire and SwiftyJSON on iOS 9 using CocoaPods. The latest version keeps getting installed and it is not compatible with iOS 9.0.
My PodFile looks like this:
platform :ios, '9.0'
use_frameworks!
target 'Kitchology' do
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'AlamofireImage'
end
I tried commenting them out and doing a pod install to remove them, then put them back in and do another pod install. Every time the latest is installed.
I do have the project itself set to iOS 9.0 and NOT iOS 9.3 for the project build on all versions.
Figured this one out. I deleted the pods by commenting them out and running pod update. Then we deleted the workspace. Then comes the main part of the solution - we deleted everything in the derived data folder. You can find this location in Xcode->Preferences Locations. Although a clean should delete this data, it obviously did not.
Now we recreate the pods again. Do a pod init, add the pods back into the Podfile and do a pod install. Open the workspace and everything was then good.
This was a problem with cached data in Xcode.
Old Cocoapods Configuration
I am using Xcode 7 Beta 4. Initially I was using Cocoapods version 0.38.2 and when I ran pod install --verbose in Terminal it said it downloaded dependencies for Bolts, FBSDKCoreKit, FBSDKLoginKit, FBSDKShareKit, FBSDKMessengerShareKit, and Pods for iOS 8.1. With this setup my app compiled successfully. Below is the Podfile and Objective-C Bridging File that I used to import the Facebook SDK (so Swift recognises its referenced methods and Objective-C classes). Note that the specific versions shown in my Podfile are also the versions that get installed even if I do not explicitly specify them at the time of this writing.
Podfile
xcodeproj '/Users/<my_username>/MyApp/MyApp.xcodeproj'
pod "FBSDKCoreKit", "~> 4.7.0";
pod "FBSDKLoginKit", "~> 4.7.0";
pod "FBSDKShareKit", "~> 4.7.0";
pod "FBSDKMessengerShareKit", "~> 1.3.1";
MyAppObjCBridging.h
#ifndef MyAppObjCBridging_h
#define MyAppObjCBridging_h
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <FBSDKMessengerShareKit/FBSDKMessengerShareKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
#endif
Problems encountered when updating to Cocoapods v0.39.0 (from v0.38.2)
The console showed the message "CocoaPods 0.39.0 is available. To update use: gem install cocoapods. Until we reach version 1.0 the features of CocoaPods can and will change. We strongly recommend that you use the latest version at all times.", so I installed the this latest version of Cocoapods 0.39.0 by executing sudo gem install cocoapods in Terminal.
But when I compiled my app it gave me the following errors:
/Users//MyApp/MyApp/MyAppObjCBridging.h:14:9: 'FBSDKCoreKit/FBSDKCoreKit.h' file not found
In Xcode I "Product > Clean" (CMD+SHIFT+K), but this did not make any difference. So I ran sudo gem uninstall cocoapods in Terminal (which listed 0.38.2 and 0.39.0 as the versions that were currently installed) and selected version 0.39.0 from the list to uninstall the latest version and revert back to 0.38.2. I then ran pod install --verbose. When I tried to compile my app it compiled successfully and ran in Simulator again.
Question 1
Why does it give the error that it can't find "FBSDKCoreKit/FBSDKCoreKit.h" when I use Cocoapods version 0.39.0 instead of the older version 0.38.2?
Question 2
If when using Cocoapods version 0.38.2 (the version that compiles with my app) I decided to add platform :ios, '9.0' to the first line of my Podfile (above its existing contents) and run pod install --verbose in Terminal, the Terminal messages tell me that it installs each pod target for iOS 9.0 (instead of iOS 8.1) (i.e. - Installing targetFBSDKCoreKitiOS 9.0).
When I then run my app it successfully compiles and opens in Simulator and displays some new warnings associated with iOS9, most of which I understand. However I do not understand why this one appears. Why is this warning appearing?:
ld: warning: directory not found for option '-L/Users/Ls/code/swift/FreeWifiSearch/FreeWifiSearch/build/Debug-iphoneos'
Question 3
When using Cocoapods version 0.38.2 (the version that compiles with my app), if I decided to add use_frameworks! to the first line of my Podfile, and platform :ios, '9.0' to the second line of my Podfile (above its existing contents), and then run pod install --verbose in Terminal, the Terminal messages tell me that it installs each pod target for iOS 9.0 (instead of iOS 8.1).
When I then run my app the following errors appear:
Use of unresolved identifier 'FBSDKLoginButton'
Use of unresolved identifier 'FBSDKLoginManager'
Use of unresolved identifier 'FBSDKLoginBehaviour'
Why does adding use_frameworks! to the top of my Podfile prevent me from using the Facebook SDK identifiers? (noting that when I don't have use_frameworks! at the top of my Podfile my app successfully compiles and runs in Xcode Simulator, and I can successfully retrieve a Facebook SDK Access Token and login to Facebook)
Since posting the original questions the following was performed and resulted in no compiler errors:
Updated from Xcode 7 Beta 4 to Xcode 7.1.1 by downloading latest from App Store
Added use_frameworks! and platform :ios, '9.0' to top of Podfile
Changed deployment target to iOS 9.0: Project Settings > Targets > General > Deployment Info > Deployment Target > 9.0
Updated CocoaPods to v0.39 with sudo gem install cocoapods
Reinstalled pods with pod update --verbose
Added import FBSDKLoginKit above the class containing Facebook SDK methods
Performed Clean (Shift+CMD+K) and Run (CMD+R) in Xcode to test on device
Add "${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit" in your target's Header Search Paths in Build Settings
For me it's OK now(CocoaPods 0.39, FBSDK 4.10)