I'm working with MapBox Search API. To avail MapBox libraries -
Create a new Project in Xcode
Close that project and open that project folder in terminal
Run pod init
Add these to my Podfile -
target 'MapBox' do
use_frameworks!
pod 'MapboxSearchUI', ">= 1.0.0-beta.3", "< 2.0"
end
Run pod Install and got this -
Analyzing dependencies
Downloading dependencies
Using MapboxCommon (9.0.2)
Using MapboxMobileEvents (0.10.8)
Using MapboxSearch (1.0.0-beta.4)
Using MapboxSearchUI (1.0.0-beta.4)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 4 total pods installed.
But I'm getting error
I checked in pods targets and found out that only one pod listed in targets and rests are not -
Targets list in Xcode -
And installed pod list in projects pod directory -
So How can I add the other pods in Xcode Targets?
N.B: I've found this similar question but there are no answares in that and that question is not that elaborative.
Related
I want to use MapBox Search SDK for iOS. So I've followed this official documentation
Firstly, I've created ".netrc" in my /home directory as instruction and then add this -
use_frameworks!
target "TargetNameForYourApp" do
pod 'MapboxSearchUI', ">= 1.0.0-beta.3", "< 2.0"
end
to podfile. Then run pod install and got this in terminal -
Analyzing dependencies
Downloading dependencies
Installing MapboxCommon (9.0.2)
Installing MapboxMobileEvents (0.10.8)
Installing MapboxSearch (1.0.0-beta.4)
Installing MapboxSearchUI (1.0.0-beta.4)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `MapBox.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 4 total pods installed.
[!] Automatically assigning platform `ios` with version `12.1` on target `MapBox` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
But after running all this I'm getting this error in Xcode -
Framework not found MapboxCommon.xcframework
I've also tried this -
pod deintegrate && pod cache clean --all
pod install
but still the same error.
I think I've followed correctly the documentation and entered the secret API Key correctly. So why am I getting this error?
Edit:
In Project Targets the installed pods are not listed -
But In pod folder in Project directory -
there are other frameworks available which are not available in Xcode Pods Target.
Is that the pointing that the frameworks are not available in the projects?
Edit:
I've checked in my project directory if the Mapbox.common.xcfreamework present or not. And I found that file under pod/mapboxCommon folder
I've been opening my project using MapBox.xcworkspace which file was generated after running pod install.
You are facing this error because you are still trying to build the project file (xcodeproj), not the generated workspace by CocoaPods.
To resolve this issue, open up 'MapBox.xcworkspace' file and use that file to access your projects from now on.
I am facing an error while making a flutter plugin on the iOS side while using pods. The pods are installed successfully then also I am able to import them in the file.
The pod in my case which I am trying to use is Freshchat iOS SDK
Steps I have followed to install the pod
Start a new Flutter plugin project.
In .podspec file add s.dependency 'FreshchatSDK'
Run pod install in example/ios folder.
I got an error
The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/nimish/FlutterProjects/freshchat_flutter/freshchat_flutter/example/ios/Pods/FreshchatSDK/FreshchatSDK/libFDFreshchatSDK.a)
I removed use_frameworks! from podfile following this comment .
I ran pod install again and the pods were successfully installed and Pods folder was created which had FreshchatSDK folder in it.
Now I need to have use_frameworks! in my project because other plugins are not compiling because of this.
I added s.static_framework = true in .podspec and use_frameworks! in podfile. Now pod install ran successfully,
After I added the import #import "FreshchatSDK.h" in my Plugin.h file I got the error
error: include of non-modular header inside framework module
I tried this answer but was not able to resolve it.
Please help me resolve this. I'll be respectful of your time.
There is another flutter plugin available here but it has many issues and one unhandled case is making my iOS app crash so I want to make it my own.
There may be problems in the PodFile due to unmatched Targets.
When this happens to me, I used these simple steps.
Delete Podfile
Open Terminal at the specific file
Pod init
Open Podfile and adds Dependencies
Pod install
I have one project which is using a few libraries. The libraries are installed with CocoaPods. In another project I have added the first project to so that it is the master project. When I run the master project, it shows that the headers cannot be found from the libraries that were installed by CocoaPods. I have added all paths to master project but it still can't find the headers in from the installed pods.
Xcode version: 9.2
This is my pod:
target 'XMPPNative' do
use_frameworks!
# 3.7 Stable Release
pod 'XMPPFramework', '~> 3.7.0'
end
My perfectly working app used to have an Xcode Project Navigator as shown below.
iOS 10 requirements meant I had to upgrade Xcode to 8.1, which meant upgrading the entire Mac OS to Sierra and also translating the whole app to Swift 2.3.
Needless to say, this caused errors, one of which was an issue with PubNub. However, apart from this new build error the app structure was the same and everything seemed ok after dealing with all the layout issues.
I was requested to run the following steps to try to solve the PubNub pod error despite me warning that previous attempts to deal with the pod file caused fatal errors that were ultimately unrecoverable.
Install all iOS simulators after Xcode update
Open Xcode preferences (Cmd+,) and navigate to ”Locations” tab where will be shown path to ”DerivedData” folder
Click on small circle with arrow on the right side of shown ”DerivedData” path to open it in Finder
Quit Xcode
Remove ”DerivedData” folder
Clean up CocoaPods (if integrated with it) caches by entering this in Terminal:
rm -rf ~/Library/Caches/CocoaPods
From project root (where Podfile is located) run this in Terminal:
pod deintegrate MyApp.xcodeproj
Remove from project root (where Podfile is located) Podfile.lock file
From project root (where Podfile is located) run this in Terminal: pod update
Launch Xcode (hit Shift + Cmd + K just in case)
Try build project
After doing all this my Project Navigator now looks like this.
As you can see, I've lost a load of stuff including the pod file etc. As suspected, my app is now fatally wounded.
My bridging header is red, Restkit.h is red and all pod references gone.
My project root in Finder has the Pods folder and pod file etc, however if I try to drag folders into the project from Finder they do not show as they used to - e.g., folders are blue color not yellow.
I'm on Xcode 8.1 and Cocoapods 1.1.1.
How can I recover my app?
EDIT: If it helps, here is the link to my unsolved question in January which was the last time I dared touch the pod file at all until now. The consequences of this situation are the same as before - the difference is that in January I was ditching 2 weeks work, now I'm looking at ditching 10 months' work.
RestKit.h never found in Xcode project
Podfile:
pod 'RestKit', '~> 0.24.0'
pod 'SimpleKeychain'
pod 'AWSS3'
pod 'VideoCore'
pod 'SDWebImage', '~>3.7'
pod 'SVPullToRefresh'
pod 'PubNub', '~> 3.7.11'
pod 'MZFormSheetController'
Result of pod update in Terminal:
Update all pods
Updating local specs repositories
Performing a deep fetch of the master specs repo to improve future performance
warning: inexact rename detection was skipped due to too many files.
CocoaPods 1.2.0.beta.1 is available.
To update use: sudo gem install cocoapods --pre
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1
Analyzing dependencies
[!] The dependency RestKit (~> 0.24.0) is not used in any concrete target.
The dependency SimpleKeychain is not used in any concrete target.
The dependency AWSS3 is not used in any concrete target.
The dependency VideoCore is not used in any concrete target.
The dependency SDWebImage (~> 3.7) is not used in any concrete target.
The dependency SVPullToRefresh is not used in any concrete target.
The dependency PubNub (~> 3.7.11) is not used in any concrete target.
The dependency MZFormSheetController is not used in any concrete target.
From the pod update logs seems like CocoaPods can't find any target where the libraries have to be applied.
Can you try something like this in your Podfile?
target 'YOUR_TARGET_NAME' do
pod 'RestKit', '~> 0.24.0'
pod 'SimpleKeychain'
pod 'AWSS3'
pod 'VideoCore'
pod 'SDWebImage', '~>3.7'
pod 'SVPullToRefresh'
pod 'PubNub', '~> 3.7.11'
pod 'MZFormSheetController'
end
Not sure if it will fix the error you have.
I'm trying to integrate a new project into an Xcode workspace with dependencies handled by Cocoapods. I added the Backend project (builds fine on itself, returns a framework as a product) to the workspace and added a separate target in the Podfile:
target 'Backend' do
(Pod list here)
end
Yet when trying to run pod install, I get [!] Unable to find a target named 'Backend'.
Using Xcode 7.2, Cocoapods 0.39.0
CocoaPods doesn't support integrating with frameworks, see https://github.com/CocoaPods/CocoaPods/issues/3440