I'm trying to add mixpanel plugin into my react-native project.
I'm using these links
react-native-mix panel github
and the integration in xcode is here
mixpanel cocoapods
I followed these instructions:
Install CocoaPods using gem install cocoapods
If this is your first time using CocoaPods, run pod setup to create a local CocoaPods spec mirror.
Create a file in your Xcode project called Podfile and add the following line: pod 'Mixpanel'
Run pod install in your Xcode project directory. CocoaPods should download and install the Mixpanel library, and create a new
Xcode workspace. Open up this workspace in Xcode.
gem install cocoapods
then I run pod setup and create Podfile text file into the project.
then when I run pod install into my bash command line i get this error
The dependency Mixpanel is not used in any concrete target.
You first need to run pod init from your react native ios directory. This generates the correct starting podfile, targeting your app correctly.
https://github.com/facebook/react-native/issues/7775
I was getting the above error.
So I added the Text file in podfile in below format:
target "MercadoPagoSample" do
source 'https://github.com/CocoaPods/Specs.git'
# Se necesita este parámetro por ser una SDK en swift
use_frameworks!
platform :ios, '9.0'
pod 'MercadoPagoSDK', '3.6.0'
end
Then I was able to update the podfile.
Related
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 am using macincloud to do some xcode work and I have a xcode package that works fine on the computer it was made on, but in macincloud I get a no module error. How do I check on my pod library, is it part of the of the computer or is part of my code?
I have read about opening up terminal and typing in different commands to install pods but nothing is working
Here is what is in my Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'WallpaperBoard' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'IQKeyboardManagerSwift'
pod 'Google-Mobile-Ads-SDK'
pod 'DBImageColorPicker'
pod 'SSUIViewMiniMe'
# Pods for WallpaperBoard
end
Cocoapods is a dependency manager. Running the pod install command on Terminal, it downloads all the Pods as external dependencies and creates a .xcworkspace for your project.
It needs to be run once in every different computer you run your project.
On Mac In Cloud:
Open Terminal
Navigate to the project folder, where the Podfile is. Usually you can navigate with the cd command. Example:
cd /Users/user_name/Desktop/project_folder
Run the command to install the Pods:
pod install
Open the generated .xcworkspace file
I am working on ios project, where I am using EVReflection library in project,I am having one custom framework there I am using EVReflection for that I have taken cocoapod i added after that I am trying to build framework it is not building and one more my project is also using Evreflection so if I add my custom framework to project will it add automatically import Evreflection there also.
SampleFramwork i am adding evreflection
code:
platform :ios, '9.0'
target 'SampleFramework' do
use_frameworks!
pod "EVReflection"
end
Install POD
[ 1 ] Open terminal n type:
sudo gem install cocoapods
Gem will get installed in Ruby inside System library. Or try on 10.11 Mac OSX El Capitan, type:
sudo gem install -n /usr/local/bin cocoapods
If there is an error "activesupport requires Ruby version >= 2.xx", then install latest activesupport first by typing in terminal.
sudo gem install activesupport -v 4.2.6
[ 2 ] After complete installation, there will be a lot of messages, read them and if no error found, it means cocoapods installation is done. Next, you need to setup the cocoapods master repo. Type in terminal:
pod setup
And wait it will download the master repo. The size is very big (370.0MB at Dec 2016). So it can be a while. You can track of the download by opening Activity and goto Network tab and search for git-remote-https. Alternatively you can try adding verbose to the command like so:
pod setup --verbose
[ 3 ] Once done it will output "Setup Complete", and you can create your XCode project and save it.
[ 4 ] Then in terminal cd to "your XCode project root directory" (where your .xcodeproj file resides) and type:
pod init
[ 5 ] Then open your project's podfile by typing in terminal:
open -a Xcode Podfile
[ 6 ] Your Podfile will get open in text mode. Initially there will be some default commands in there. Here is where you add your project's dependencies. For example, in the podfile, type
pod 'EVReflection'
(this line is an example of adding the AFNetworking library to your project).
Other tips:
Uncomment platform :ios, '8.0' Uncomment user_frameworks! if you're using Swift
When you are done editing the podfile, save it and close XCode.
[ 7 ] Then install pods into your project by typing in terminal:
pod install
Depending how many libraries you added to your podfile for your project, the time to complete this varies. Once completed, there will be a message that says
"Pod installation complete! There are X dependencies from the Podfile and X total pods installed."
Now close your xcode project and open .xcworkspace xcode project file and start coding. :)
Configuration should look something like this:
1) Open terminal and locate your project root
2) write: pod init
3) write: atom podfile (or nano/vim/some other texteditor)
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
# Public spec repository
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'ProjectName' do
# Pods for ProjectName
pod 'EVReflection'
end
4) write: pod install
5) close all of your current xcode projects, and open project.xcworkspace file
Use the format below in Podfile
use_frameworks!
target "YourProjectName" do
pod 'EVReflection'
end
If it is not building yet , add it to Embedded Binaries and Linked Frameworks and Libraries
I found these tutorials to create our own cocoapod:
https://guides.cocoapods.org/making/making-a-cocoapod.html
http://code.tutsplus.com/tutorials/creating-your-first-cocoapod--cms-24332
but for me none of them helps, as they create fresh xcode project using pod lib create. I have my own xcode project and I need to setup in that rather than create a fresh one.
1.Delete following files/folder that pod created.
2.Make sure your Podfile available.
3.Use this command:
pod install
Updated
If you didn't have installed pod in your project. Do like following:
1.Use pod setup in your project root folder.
2.Edit Podfile
3.Use this command:
pod install
Try to do like this:
1.Run the command on Terminal:- sudo gem install cocoapods
After successfully install CocoaPods
2.Go to that folder where your existing project is saved in your System.
3.After that Run the command for creating Pod file:- Touch podfile
4.After Creating Pod file run the next command:- Open podfile
It will open pod file and here Put the below line and save that file using command+S
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘8.0’
use_frameworks!
pod 'Alamofire', '~> 2.0.2’
5.After that run the final command in your Terminal:- pod install
It will take some time to install that file after that once install the all file close the xcode project and again open that project, click on the .xcworkspace extension file.
I followed the instruction of Alamofire in github,
I created an xcode project named cocoapods-test & I closed it.
I go to the project folder run pod init command which generates a Podfile. Then I added the following code to the Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
Then, I run command pod install and this is the result in terminal:
Updating local specs repositories
CocoaPods 1.0.0.beta.6 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
Downloading dependencies
Installing Alamofire (3.3.0)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `cocoapods-test.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Then, in my project folder there is a new file called cocoapods-test.xcworkspace . I double clicked it which opens my xcode again, and I can see the Alamofire module.
Then, I opened my project's ViewController class, and import Alamofire . But no matter how many times I clean & build, I always get error No such module 'Alamofire' . Here is the screenshot:
Why I get this problem though I followed the instruction step by step?
(I am using XCode 7.2.1, Swift 2.1.1 & Alamofire 3.3.0)
======= UPDATE ========
I tried #LK Yeung 's answer, uncomment import Alamofire, then clean & build again, I got a bunch of compiler errors from Alarmofire:
You need to build the project successfully once before using the library
comment import Alamofire -> build -> uncomment import Alamofire
Make sure you have opened the "project_name".xcworkspace instead of "project_name".xcodeproj .As you are working on pods all the installed pod will be available only in your .xcworkspace project file.
I was having this exact same problem. Please make sure that you are on Xcode 7.3 and using Swift 2.2.
You can check your Swift version using xcrun swift -version. Updating Xcode to 7.3 should also automatically update Swift.
Updating Xcode resolved this issue for me.
You need to add the lib to 'the Link Binary With Libraries' section also
You can try put pod 'Alamofire', '~> 3.0' like below. And run pod install again.
target 'yourtarget' do
pod 'Alamofire', '~> 3.0'
end
If you're manually installing Alamofire (or any other framework) make sure your build configurations match between both your parent project and the sub project. For example, if your build configuration in your project is called 'Development', but Alamofire's is called 'Debug' you'll get the 'no such module' error.
Follow This Sequence
➼ Open Terminal, go to the project folder and run these commands:
sudo gem install cocoapods -n /usr/local/bin
pod install
➼ Go to this link and clear derive data folder:
~/Library/Developer/Xcode/DerivedData
➼ Then open project "xcworkspace" file and press:
Command + Shift + K
➼ and then:
Command + B
It should work now
Cheers!
try to latest updated install alamofire and also check u use alamofire latest is this in your xcode supported.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire', '~> 4.4'
end
try this above alamofire on your podfile
I had the same issue, the reason was that I installed the wrong version of alamofire.
I am using Xcode 7.3, swift 2.2, so alamofire 3.0 worked for me
remove the library using these steps mentioned by #Michal
Remove or uninstall library previously added : cocoapods
Then in your pod file
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘9.3’ <-- your target version
use_frameworks!
target ’<your target name>’ do
pod 'Alamofire', '~> 3.0’
end
No such module 'Alamofire' Error
because you have not installed the Alamofire in your pod file
open Podfile and add this line
pod 'Alamofire'
double-check in Podfile if this line already is written then no need to write. then just update pod file
for updating your pod open your Podfile into terminal and dial
pod update