chrisdhaan / CDYelpFusionKit

An extensive Swift wrapper for the Yelp Fusion API.
MIT License
54 stars 18 forks source link

Installing issuse #6

Open tqhuy1811 opened 6 years ago

tqhuy1811 commented 6 years ago

Hi Christopher,

I tried to install your framework and encountered this problem after launching my project.

Could not build Objective-C module 'Alamofire'

chrisdhaan commented 6 years ago

@tqhuy1811 there isn't enough information here for me to properly assist you. Can you fill out the information below:

CDYelpFusionKit Environment

CDYelpFusionKit version:
Xcode version:
Swift version:
Platform(s) running CDYelpFusionKit:
macOS version running Xcode:

and in the future follow the template when submitting an issue?

tqhuy1811 commented 6 years ago

I am sorry, I am kinda new to Github

CDYelpFusionKit version: 1.2.0 Xcode version: 9.0 Swift version: 4.0 Platform(s) running CDYelpFusionKit: Cocaopod macOS version running Xcode: 10.13

I tried to creat a "bridging header file" for Alamofire framework but the result is still the same I also tried to build Alamofire scheme first and clean my project but nothing changed

chrisdhaan commented 6 years ago

Does your project also support objective-c? I don't know why a bridging header file would be needed. I'm able to install the framework just fine via CocoaPods on my laptop. Do you have a link to your project you are comfortable sharing?

tqhuy1811 commented 6 years ago

My project is purely in swift. Sure, it's just a little school project
https://github.com/MonicaTran/hobby-quest/commits/master

chrisdhaan commented 6 years ago

Awesome! Thanks. The GitHub link will really help. I'll hopefully have a solution for you within the next 24 hours.

umerk12345 commented 6 years ago

I tried running your IOS example but I too kept getting errors screen shot 2017-11-16 at 9 44 29 am

chrisdhaan commented 6 years ago

@umerk12345 can you fill out the following information:

CDYelpFusionKit Environment

CDYelpFusionKit version:
Xcode version:
Swift version:
Platform(s) running CDYelpFusionKit:
macOS version running Xcode:

Based on the image it looks like the macOS and watchOS targets were installed which haven't been released in an official version yet which has me thinking you're possibly on a pre-release version. What dependency manager did you use to install it?

chrisdhaan commented 6 years ago

@tqhuy1811 please add the following lines of code to the bottom of your Podfile:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == 'CDYelpFusionKit' || target.name == 'ObjectMapper' || target.name == 'Alamofire' || target.name == 'AlamofireObjectMapper'
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '3.0'
            end
        end
    end
end

I was able to use this to successfully buildi CDYelpFusionKit and use it in your project. @umerk12345 try this solution if you were using CocoaPods as your dependency manager.

I will be releasing a new version of CDYelpFusionKit 2.0.0 built with Swift 4 by the end of the week. At that point this code won't be needed anymore. I'll keep this issue open until then.

umerk12345 commented 6 years ago

It works for me now! Thank you

tqhuy1811 commented 6 years ago

@chrisdhaan It works for me too ! Thank you!

tqhuy1811 commented 6 years ago

@chrisdhaan A new problem occured , when I tried to "import CDYelpFusionKit", it keeps saying that "no such module exists" I tried to all of these solutions here https://stackoverflow.com/questions/29500227/getting-error-no-such-module-using-xcode-but-the-framework-is-there , none of them work for me

chrisdhaan commented 6 years ago

@tqhuy1811 I would not attempt any of the solution in that StackOverflow as they aren't related to CocoaPods. Did you try cleaning before building? I installed the framework using the code above in your project and was able to use import CDYelpFusionKit just fine.

tqhuy1811 commented 6 years ago

Yes I cleaned everything but the problem still persist. I was able to get it to work by restarting my computer. Thank you anyway!

chrisdhaan commented 6 years ago

@tqhuy1811 and @umerk12345 I've released 1.4.0 which is built with Swift 4 in mind. You can trying installing that version without the code I posted previously for the Podfile.

tqhuy1811 commented 6 years ago

I just tried that and then this happened screen shot 2017-11-21 at 02 10 30

chrisdhaan commented 6 years ago

@tqhuy1811 did you try cleaning and building? That is generally needed with dependency manager updates. Is your project still available on GitHub? I can always try pulling it to see what the problem is. Both I and have other users of CDYelpFusionKit have been able to install 1.4.0 and get it running.

tqhuy1811 commented 6 years ago

Yeah, I tried that but nothing change and my project is still available

JB184351 commented 5 years ago

Has there been an update on this? I am trying to use Yelp API for a simple application that will allow users to find Bowling Locations and mostly doing this to learn basic iOS development. I also have an issue when trying to import CDYelpFusionKit

JB184351 commented 5 years ago

Update: I was able to get it to work I think I didn't quite follow directions quite right or just looked at a different set of instructions when installing via CocoaPods and all that I did was this

pod 'CDYelpFusionKit', '1.5.1' target 'PROJECT_NAME_GOES_HERE'

Before I only had pod 'YelpAPI' so if your having issues with the 'import CDYelpFusionKit' this may help you.

Just kidding I didn't have any errors because I opened my project in the .xcworksapce file instead of the .xcproj and now I unable to import CDYelpFusionKit.