Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 3.0 - No such module #137

Closed
Goule opened this issue Sep 14, 2016 · 32 comments
Closed

Swift 3.0 - No such module #137

Goule opened this issue Sep 14, 2016 · 32 comments

Comments

@Goule
Copy link

Goule commented Sep 14, 2016

Hello,

I'm trying to build my project with 3.0, but seems to be not possible at this time ?

I tried with :
pod 'p2.OAuth2', :git => 'https://github.com/p2/OAuth2', :branch => 'develop'

But got this :
capture d ecran 2016-09-14 a 15 01 02

Have you any solution ? :-)

@p2
Copy link
Owner

p2 commented Sep 14, 2016

Ah CocoaPods. I need to update the podfile and define NO_MODULE_IMPORT; let me push version 3.0 officially.

@Goule
Copy link
Author

Goule commented Sep 14, 2016

Okey thank you :-)

Please, keep me in touch in this issues when it's done !

@p2
Copy link
Owner

p2 commented Sep 14, 2016

I have not yet pushed version 3.0 since CocoaPods seems to want to use Swift 2.3 for whatever reason, but I've updated the podspec on the develop branch. Can you try again?

@Goule
Copy link
Author

Goule commented Sep 14, 2016

Same issue in OAuth2 class now.

But pod passing to 3.0.0 from 2.2.8.

capture d ecran 2016-09-14 a 17 06 20

@leo150
Copy link

leo150 commented Sep 14, 2016

Same issue here
pod 'p2.OAuth2', :git => 'https://github.com/p2/OAuth2.git', :branch => 'develop'

@p2
Copy link
Owner

p2 commented Sep 14, 2016

Just pushed an updated podspec, can you try again?

@leo150
Copy link

leo150 commented Sep 14, 2016

@p2, thanks you, that error is fixed. Current state:
screen shot 2016-09-14 at 19 17 22

.../Pods/p2.OAuth2/Sources/Base/OAuth2KeychainAccount.swift:58:11: Use of undeclared type 'KeychainGenericPasswordType'
.../Pods/p2.OAuth2/Sources/Base/OAuth2KeychainAccount.swift:30:31: Use of undeclared type 'KeychainGenericPasswordType'
...Pods/p2.OAuth2/Sources/Base/OAuth2KeychainAccount.swift:71:12: Use of unresolved identifier 'fetchFromKeychain'

@Goule
Copy link
Author

Goule commented Sep 14, 2016

Same error, look to be an error with SwiftKeychain library !

@p2
Copy link
Owner

p2 commented Sep 14, 2016

The sources for the keychain classes are in the submodule, the .podspec defines :submodules so it should check it out. It also defines the path to SwiftKeychain/Keychain/Keychain.swift so that should work as well. Dammit...

@leo150
Copy link

leo150 commented Sep 14, 2016

That submodule project uses Swift2. Maybe it will be better to fork it or copy to OAuth2.

@p2
Copy link
Owner

p2 commented Sep 14, 2016

It is forked and now on Swift 3. All works well in Xcode, not sure what CocoaPods is doing.

I've changed sourcefile order in the podspec, does that help?

@Goule
Copy link
Author

Goule commented Sep 14, 2016

I tried again and same problem :/

@leo150
Copy link

leo150 commented Sep 14, 2016

I've add
pod 'p2.OAuth2', :git => 'https://github.com/p2/OAuth2.git', :branch => 'develop', :submodules => true
and get

$ pod update p2.OAuth2
Updating local specs repositories
Analyzing dependencies
Pre-downloading: 'p2.OAuth2' from 'https://github.com/p2/OAuth2.git', branch 'develop', submodules 'true'

[!] Error installing p2.OAuth2
[!] /usr/local/bin/git submodule update --init --recursive

fatal: reference is not a tree: 3734015afd390c08e94789cb7e116d83f9e0247c
Unable to checkout '3734015afd390c08e94789cb7e116d83f9e0247c' in submodule path 'SwiftKeychain'

Maybe it helps to find solution

@p2
Copy link
Owner

p2 commented Sep 14, 2016

Yes, I have the same problem, even after pod clean p2.OAuth2. The reference is correct, I'm not sure what it's caching.

@p2
Copy link
Owner

p2 commented Sep 14, 2016

Alright, I also changed the submodule on master, and now it seems to work with this in the Podfile:

pod 'p2.OAuth2', :git => 'https://github.com/p2/OAuth2', :branch => 'develop', :submodules => true

Maybe clean the cache first:

pod cache clean p2.OAuth2
pod update

@leo150
Copy link

leo150 commented Sep 14, 2016

Thank you. I didn't understand what you did, but it works :D

@Goule
Copy link
Author

Goule commented Sep 14, 2016

It's ok now ! :D

Thank you.

@p2
Copy link
Owner

p2 commented Sep 14, 2016

🙂

As you saw, the original SwiftKeychain is not on Swift 3. So I forked and, on the develop branch, pointed the submodule to the forked location. Apparently CocoaPods does something different, pointed to the old location and there the Swift 3 update is not available obviously. What I did shouldn't work (strictly git speaking) but it does... 👍🏼

Thanks for testing to the both of you! I'll keep this open for others to see.

@0xTim
Copy link

0xTim commented Sep 16, 2016

Has the v3 pod spec been taken down? I'm sure I had it building through Cocoapods with version 3 of your library but running a pod install with pod 'p2.OAuth2', '~> 3.0' throws the following error:

[!] Unable to satisfy the following requirements:

- `p2.OAuth2 (~> 3.0)` required by `Podfile`

None of your spec sources contain a spec satisfying the dependency: `p2.OAuth2 (~> 3.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

Not too much of an issue as I can point to your repo to pull the code, but I could have sworn I pulled down version 3.0 yesterday through Cocoapods!

@p2
Copy link
Owner

p2 commented Sep 17, 2016

No, I'm unable to post 3.0 because of CocoaPods/CocoaPods#5880 . You can use the pod with this in your Podfile:

pod 'p2.OAuth2', :git => 'https://github.com/p2/OAuth2', :submodules => true

@paul999
Copy link

paul999 commented Sep 24, 2016

@p2 Maybe you should, at least for now, update the readme with this instructions? Currently when a new user tries installing it, it fails and needs to search to maybe find this issue.

p2 added a commit that referenced this issue Sep 24, 2016
@mxcl
Copy link

mxcl commented Sep 27, 2016

You can fork https://github.com/CocoaPods/Specs and update manually, I'm doing this for PromiseKit since this has been going on for a while now.

@p2
Copy link
Owner

p2 commented Sep 27, 2016

Thanks, I probably should. What a piece of crap.

@mxcl
Copy link

mxcl commented Sep 27, 2016

You have to ping a maintainer to get them to merge it.

@liltimtim
Copy link

May I suggest moving this to an issue with a more clear title? I arrived here via google and didn't know why it was pointing me here :) but this did solve my problem at least!

pod 'p2.OAuth2', :git => 'https://github.com/p2/OAuth2', :submodules => true

the Swift 3.0 transition has been...rocky....to say the least it seems for everyone.

@floriangbh
Copy link

The solution for Swift 3.0 is in the README file :-)

@p2
Copy link
Owner

p2 commented Oct 6, 2016

@liltimtim what have you been searching for, OAuth2 and CocoaPods? Maybe I can adapt the title. Installation via CocoaPods is explained st the bottom of the readme; I don't think CocoaPods is a great system for Swift, since we can use frameworks in iOS it's overkill.

@liltimtim
Copy link

@p2 Maybe Swift 3.0 - No such Module error? I was receiving similar error as the op. after implementing your solution it was fixed.

@p2 p2 changed the title Swift 3.0 Swift 3.0 - No such module Oct 13, 2016
@p2
Copy link
Owner

p2 commented Oct 17, 2016

The bug in CocoaPods has been addressed in CocoaPods 1.1rc3 and I have been able to push version 3.0.0 for Swift 3.0. You should now be able to use the standard procedure to use OAuth2 via CocoaPods:

pod 'p2.OAuth' '~> 3.0'

@0xTim
Copy link

0xTim commented Oct 18, 2016

Have updated my Podfile and all seems to be working, many thanks!

@p2 p2 closed this as completed Oct 19, 2016
@triple7
Copy link

triple7 commented Nov 9, 2017

Hi, I've tried through cocoa pods and get the same issue. Has this been tested for swift 4? I get the "no such module p2.OAuth2" error though when I go to project settings/build phases/ link binary.../ and press add, p2.OAuth 2 is in the linkable frameworks. Also, via cocoa pods, there are a lot of errors as functions and properties are internal and cannot be reached. Any help greatly appreciated

@p2
Copy link
Owner

p2 commented Nov 9, 2017

This issue is closed, please open a new issue and provide more details if v 4.0.1 doesn't work for you via CocoaPods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants