problems using imports statements with Amazon SDK and Alamofire - ios

I have followed this tutorial to get my Amazon SDK up and running.
It creates another project file with .xcworkspace extension that I have to use to be able to access all my Amazon SDK.
later I have edited the Podfile to include Almofire:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target :'MyTarget’ do
pod 'AWSCognito'
pod 'AWSS3'
pod 'Alamofire', '~> 3.4'
end
and ran pod install.
Everything executes correctly but when I import Alamofire in my .xcworkspace project it doesnt work but it works in my old project. The reverse is true about my AWSS3 import.
I am new to IOS development and have no idea how to fix this.

I dont know how but I seem to fix the problem.
I have restarted the Mac OSX and have Changed my Podfile to reverse the order of Alamofire and AWS pods like so:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target :'MyTarget’ do
pod 'Alamofire', '~> 3.4'
pod 'AWSCognito'
pod 'AWSS3'
end
I have opened Xcode and the error has vanished.
Very bizarre

Related

Error on terminal while adding pod - [!] Invalid Podfile file: The target Pods-MyApp already has a platform set

In my app i have integrated Googlemap using CocoaPod.
Now I want to integrate CitrusPay using CocoaPod but when i have execute pod install command on terminal then i am getting error -
[!] Invalid Podfile file:
The target Pods-MyApp already has a platform set..
from /Users/NewFolder/Desktop/xyz.app.MyApp.ios/Podfile:10
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
pod 'GoogleMaps'
Does anyone knows how to solve this error?
i have the same question with you,and than search answer in the internet,but nothing ,so i solve question myself,
step:
first : sure you 'Podfile' file only have "platform:ios,'version'" one time;
second : add "target 'yourtarget'do" in the file top;
third : add "end" in the file bottom.
you must maintain your "Podfile" file have formatter:
enter image description here
you will solve this question, wish can help you.thanks.
Add target to your podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
target 'YourTarget' do
pod 'GoogleMaps'
end
I had the same issue and eventually I solved it, now my Podfile looks like this
#Alamofire - lib for HTTP requests
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'Fitzz' do
pod 'Alamofire', '~> 4.0'
#XCGLogger - lib for loggin output
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'XCGLogger', '~> 4.0.0'
end
I am a rookie in iOS, but this works for me

AFNetworking.framework: No such file or directory in Xcode 8

I just opened my project in Xcode 8.0 and tried to build it, but the following "PBXCp Error Group" appeared:
error: /Users/username/Documents/XYZ/build/Debug-iphoneos/AFNetworking.framework: No such file or directory
My Podfile is below:
platform :ios, '10.0'
use_frameworks!
target 'XYZ' do
pod "MSSTabbedPageViewController"
pod "SKStatefulTableViewController", "~> 0.1"
pod "QBFlatButton"
pod "LTNavigationBar"
pod "KBRoundedButton"
pod "CTCheckbox"
pod "SKStatefulTableViewController", "~> 0.1"
pod "SDWebImage"
pod "TOCropViewController"
pod "UIImageViewAligned"
pod "AFNetworking"
pod "MBProgressHUD"
pod "JSONModel"
pod "CWStatusBarNotification"
pod "Firebase/Messaging"
pod "MaterialControls"
pod "Fabric"
pod "Crashlytics"
end
Pod is installed and OK.
I don't know what I did, since Cocoapods seems to be in the build folder.
I've had the same issue. Adding and removing AFNetworking from podfile didn't help at all. The only thing that worked for me was to remove AFNetworking.framework and add it again from correct path. The original path was pointing to wrong direction...
change the platform :ios, '10.0' to older platform and update pod file it will work fine for me.
try to add it properly because i had recently install all pod file in my side it working fine for me.remove your pod file and then install it.
Checking the item "Copy only when installing" in build setting just worked for me.

GoogleMaps SDK ios install with Cocoapod error

I'm recently learn iOS and I want to install the GoogleMap SDK for iOS in my project.
But when I installed with pod install it got an error say that the 'GoogleMaps' doesn't have concrete dependency ... or some thing like that.
I did as the instruction on the GoogleMapsAPI web source and this is my Podfile
'https://github.com/CocoaPods/Specs.git'
pod 'GoogleMaps'
Please tell me where do I did wrong. Thanks
You have to specify a target for each pod.
e.g. if before you had your Podfile written like this:
pod 'GoogleMaps'
just change it to
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
target "TargetName" do
pod 'GoogleMaps'
end
When you are working with latest pod you need to write Target in Pod file
Like below.
Currently your pod file looking like
pod "YOUR_POD"
Change To
target "Your_Target_Name" do
pod "YOUR_POD"
end

Xcode/Cocoapods Project messed up after adding a TVOS Target and changing Podfile structure

I'm working on a larger project(Swift) with some Pods and everything was fine so far...
Bu now I wanted to add a tvos target and now my project is messed up :(
And there is an easy way to reproduce:
1.) create a new SingleView Application and name it "pod-test" in Xcode
2.) open it an run it
3.) run pod init to create the Podfile
4.) Edit the Podfile with this:
use_frameworks!
platform :ios, '8.0'
pod 'Alamofire'
pod 'ObjectMapper'
pod 'AlamofireObjectMapper'
pod 'Fabric'
pod 'Crashlytics'
pod 'Nuke'
pod 'MGSwipeTableCell'
pod 'GradientCircularProgress', :git => 'https://github.com/keygx/GradientCircularProgress'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
5.) run pod install
6.) open workspace project file an run the application
7.) now add the twos target and name it "pod-test-tvos"
8.) run iOS and tvos app. Everything still fine
9.) edit the Podfile with this:
source 'https://github.com/CocoaPods/Specs.git'
target 'pod-test' do
use_frameworks!
platform :ios, '8.0'
pod 'Alamofire'
pod 'ObjectMapper'
pod 'AlamofireObjectMapper'
pod 'Fabric'
pod 'Crashlytics'
pod 'Nuke'
pod 'MGSwipeTableCell'
pod 'GradientCircularProgress', :git => 'https://github.com/keygx/GradientCircularProgress'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end
target 'pod-test-tvos' do
use_frameworks!
platform :tvos, '9.0'
pod 'Fabric'
pod 'Crashlytics'
end
10.) Edit configuration for pod-test and pod-test-tvos to none
10.) close XCode
11.) run pod install again
12.) Open Xcode again
13.) run iOS and TVOS apps again... Still everything is fine
14.) edit "AppDelegate" for both targets and add just this import:
import Fabric
15.) run iOS and TVOS apps again... and boom... iOS runs fine TVOS says Fabric is not found :(
This all just happens, because I "changed" the Podfile after adding the TVOS target...
With just this steps everything is fine:
1.) create a new SingleView Application and name it "pod-test" in Xcode
2.) now add the twos target and name it "pod-test-tkos"
3.) run pod init to create the Podfile
4.) edit the Podfile with this:
source 'https://github.com/CocoaPods/Specs.git'
target 'pod-test' do
use_frameworks!
platform :ios, '8.0'
pod 'Alamofire'
pod 'ObjectMapper'
pod 'AlamofireObjectMapper'
pod 'Fabric'
pod 'Crashlytics'
pod 'Nuke'
pod 'MGSwipeTableCell'
pod 'GradientCircularProgress', :git => 'https://github.com/keygx/GradientCircularProgress'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end
target 'pod-test-tvos' do
use_frameworks!
platform :tvos, '9.0'
pod 'Fabric'
pod 'Crashlytics'
end
5.) run pod install
6.) open workspace project file an run the application
7.) edit "AppDelegate" for both targets and add just this import:
import Fabric
8.) run iOS and TVOS apps again... Still everything is fine
So, there seems to be a problem with changing the Podfile in an "older" Project...
I hope somebody can help me out with this :)
This can be resolved by using the deintegrate command in Cocoapods 1.0.
Close Xcode
Open Terminal and navigate to the directory that contains your Podfile.
pod deintegrate
pod install
Open your workspace in Xcode and build.
I had exactly the same problem. I don't know why. Inspired by your experimentation, I downloaded the Cocoapods app, and used it to remove Cocoapods from my project. I then reinstalled cocoapods and now it works just fine.

SimpleAuth pod not installing properly

I use several pods in my Xcode project, all work perfectly well except SimpleAuth
Here is my code in my podfile:
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
platform :ios, ‘8.0’
pod 'SWRevealViewController', '~> 2.3'
pod 'SAMCache'
source 'https://github.com/calebd/SimpleAuth'
use_frameworks!
pod 'SimpleAuth/Instagram'
Then, I install my pod using my terminal targeting my project folder. And as you can see, the "SimpleAuth" folder created in my project is empty when it should include all the objective-c classes that it needs to operate:
Any help by more experience objective-c coders much appreciated.
why are you using two ways. instead use simple
podflie
use_frameworks!
platform :ios, ‘8.0’
pod 'SWRevealViewController', '~> 2.3'
pod 'SAMCache'
pod 'SimpleAuth/Instagram'
there is no need of mentioning source path. Cocoapods will do it automatically.
It is not used because if sometime in future if it change then you will have a problem.

Resources