Working on a react-native(version 0.59.5) project, just installed cocoapods(version 1.7.5)
Installation process:
(from within project directory)
-sudo gem install cocoapods
(from within iOS directory of project)
-pod init
-pod install --repo-update
Result:
Analyzing Dependencies
[!] The Target 'ProjectName-tvOSTests' is declared multiple times.
then tried pod update which resulted in the same 'Analyzing Dependencies' warning. There is only a Podfile and a 'Pods' directory in iOS directory. the pods directory has three sub-directories which are all empty. It seems there was a hangup during pod install but I don't know where to look for the duplicate declaration.
I'm aware you should be working from within the ProjectName.xcworkspace file after a installing cocoapods, but there is no .xcworkspace file in my iOS directory of project. How do I fix this?
EDIT:
Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'TicTacWHOA' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for TicTacWHOA
pod 'Google-Mobile-Ads-SDK'
target 'TicTacWHOA-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'TicTacWHOATests' do
inherit! :search_paths
# Pods for testing
pod 'Google-Mobile-Ads-SDK'
end
end
target 'TicTacWHOA-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for TicTacWHOA-tvOS
target 'TicTacWHOA-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
The issue was that the "Target" was literally declared twice in the Podfile. so simple and right in front of your face potentially. I Just didn't think anything of it because it was a completely generated file except the one line I added.
All you need to do is go to podfile and look for the code in the error
for example my error was
[!] The target fifty-tvOSTests is declared multiple times.
now i have deleted this piece of code from the podfile once.
target 'fifty-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
fifty is the name of my project you know well what is yours
the above piece of code was twice in the Podfile so delete if you find multiple just keep only once
Related
I'm facing this issue 'RCTVersion.h' file not found. I started getting this error after by mistakenly linking manually while I have a pod file. Before doing this, it was building successfully.
What I've tried so far:
cd ios/
rm -rf Podfile.lock
rm -rf Pods/
pod install --repo-update
Clean, Rebuild, close and open again - did couple of times
still no luck
React and Firebase versions:
"react": "16.0.0-beta.5",
"react-native": "0.49.3",
"#react-native-firebase/app": "^7.3.1",
"#react-native-firebase/crashlytics": "^7.1.7",
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'SomeApp' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
# Pods for SomeApp
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
pod 'Firebase/Crashlytics'
target 'SomeAppTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'SomeApp-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
# Pods for SomeApp-tvOS
target 'SomeApp-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
I'm new to this, any help will be highly appreciated.
Thanks in advance!
I am currently adding monogodb to my ios project. Just after following the instruction stitch mongodb offered, I am stuck at when pod installing StitchCoreSDK. It supposed to create a xcworkspace file, but it didn't. Instead, I got the following message.
enter image description here
The podfile I create is like following
# Uncomment the next line to define a global platform for your project
platform :ios, '11.4'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'paotuaniOS' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for paotuaniOS
pod 'Nexmo-Stitch'
pod 'StitchSDK', '~> 4.0.5'
target 'paotuaniOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'paotuaniOSUITests' do
inherit! :search_paths
# Pods for testing
end
end
Can any one help me with this issue?
Thanks!!!
I had this issue before. The repo had problems. The repo has been updated. Please use
pod 'StitchSDK', '~> 4.1.1'
Hey I was able to instal the web3swift pod using pod install but afterwards I can't import it in the project, so I can't start using it. Any tips?
Here is the Podfile code
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Hello' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'web3swift', '~> 0.8.0'
# Pods for Hello
target 'HelloTests' do
inherit! :search_paths
# Pods for testing
end
target 'HelloUITests' do
inherit! :search_paths
# Pods for testing
end
end
Here is what my Xcode looks like
I have managed to fix it myself, deleted everything, started from scratch. Then I have build the project and somehow everything works now..
Is it possible to do pod install #targetName?
I stuck with a problem that I do not have an option to update pods for my project but I have to install new pods for my unit tests target.
I don´t think there is any pod update #targetName command in CocoaPods. What you can do is to add the desired pod in your unit test target only and then run a pod update, since there is not any changes in the other targets then they will not be affected by this update.
And if you add targets after you have made your pod init you can just append these targets to your podfile, like this:
target 'ANewTargetAdded' do
inherit! :search_paths
pod 'SomePOD'
end
If you now add a new pod to ANewTargetAdded and run pod update, then this will only affect ANewTargetAdded if you haven´t made any changes to your other targets in your podfile.
There isn't any like pod update #targetName but you can specify different pods for different targets and unit tests and run pod update.
Something like this.
target 'TestProject' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for TestProject
target 'TestProjectTests' do
inherit! :search_paths
# Pods for testing
end
target 'TestProjectUITests' do
inherit! :search_paths
# Pods for testing
end
end
I've recently updated my Xcode, but I faced with strange issue.
I'm installing library via cocoapods and use it further in my project, but after updating I Xcode can't find the module, I've installed via CocoaPods
I've updating pods, but the problem stays.
Also I have Pods.framework red
What is the problem?
Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'Bloom' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Bloom
target 'BloomTests' do
inherit! :search_paths
# Pods for testing
end
target 'BloomUITests' do
inherit! :search_paths
# Pods for testing
end
end
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Gifu'
UPD: Solved it by opening the project with the .xcworkspace file not with .xcodeproj.
Do the following things and you can import any swift file from "Pods"
Clean your project
Make sure that all your "Pods" > "Build Settings" > "Build Active Architecture Only" is set to "NO".
Don't run, just build your project.
Now, import any file from "Pods" to any swift file
This will solve your import module problem.
Update:
To solve this issue delete the current pod file and create one using the terminal. Follow the below steps:
1) Open Terminal.
2) Navigate to your Project Path.
3) Type pod init in terminal to create new pod file.
4) Open the newly created pod file and write the pod line which you want to install after target "TargetName" do and before end.
5) Then type pod install in the terminal.
Hope this helps!
I had to delete my podfile and ALL the files it made including the .workspace file then I did:
pod init
open -a Xcode Podfile
add pods I want to podfile then save and close xcode.
Finally do pod install and open the new workspace file :)
change your pod file like this and clean the project quit xcode and reopen it.it may solve the problem
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Comment this line if you're not using Swift and don't want to use
dynamic frameworks
use_frameworks!
target 'Bloom' do
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Gifu'
end
target 'BloomTests' do
inherit! :search_paths
# Pods for testing
end
target 'BloomUITests' do
inherit! :search_paths
# Pods for testing
end
Some frameworks in cocoapods declare a hard-link to XCode in the module description file (XMPP for example). So, be sure that you have:
place XCode.app in /Application (default folder), with name
"XCode.app", not Xcode-beta.app
or/and
call xcode-select to specify the right XCode.app:
sudo xcode-select --switch /Applications/Xcode.app
I had the same issue after I tried to merge a branch using Xcode (never again!).
What finally worked for me was:
Deleting derved data
Cleaning project
Exiting Xcode
Running 'pod install' again in my project