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

Static framework should define module #85

Merged
merged 4 commits into from
Oct 30, 2018
Merged

Static framework should define module #85

merged 4 commits into from
Oct 30, 2018

Conversation

frederoni
Copy link
Contributor

Fixes #73

The dynamic framework already defines a module, the static doesn't.

cc @rclee @1ec5

@rclee
Copy link
Contributor

rclee commented Oct 23, 2018

Thanks @frederoni, shouldn't s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } be added to the podspec as well?

@frederoni
Copy link
Contributor Author

@rclee correct. As it stands now, it would only be fixed when integrating with Carthage.

@frederoni frederoni force-pushed the fred/static-def-mod branch from 471f313 to 79d29f1 Compare October 23, 2018 19:26
@paul019
Copy link

paul019 commented Oct 23, 2018

So this pull request doesn't fix the issue when importing the library with Cocoapods?

@frederoni
Copy link
Contributor Author

@paul019 I amended a change and force pushed a commit (79d29f1df5a9187481f5c9ac8fa13430d1f04139) after I wrote #85 (comment).

Please try 79d29f1df5a9187481f5c9ac8fa13430d1f04139.

@paul019
Copy link

paul019 commented Oct 24, 2018

I am very sorry, but I can try this out only tomorrow.

In the end I don't want to install the pod MapboxMobileEvents, but MapboxNavigation. Is it's install problem supposed to be fixed by this Pull request, too?

@frederoni
Copy link
Contributor Author

@paul019 yes, this PR should address the issue you described in mapbox/mapbox-navigation-ios#1791

MapboxNavigation depends on MapboxMobileEvents. By specifying a transient dependency, we'll make sure that this fix works for you, then we can make a new release and you can remove the transient dependency.

@paul019
Copy link

paul019 commented Oct 25, 2018

@frederoni I tried out your code and all pods were installed successfully! Thank you very much!

But how can I use the working version of MapboxNavigation now? I am relatively new to Cocoapods and don't know what a "transient dependency" is...

@frederoni
Copy link
Contributor Author

frederoni commented Oct 25, 2018

@paul019 Just keep this line:

pod 'MapboxMobileEvents', :git => 'https://github.com/mapbox/mapbox-events-ios.git', :commit => "79d29f1df5a9187481f5c9ac8fa13430d1f04139"

in your Podfile. This is called a transient dependency because you are not following the dependency tree and resolving the MapboxMobileEvents version that MapboxNavigation tries to pull in.

You can delete that line when we release a new version of MapboxMobileEvents and MapboxNavigation.

@paul019
Copy link

paul019 commented Oct 25, 2018

Now I've a Podfile like this:

target 'pq-app-v2' do
  pod 'Mapbox-iOS-SDK', '~> 4.5'
  pod 'MapboxMobileEvents',
    :git => 'https://github.com/mapbox/mapbox-events-ios.git',
    :commit => "79d29f1df5a9187481f5c9ac8fa13430d1f04139"
  pod 'MapboxNavigation', '~> 0.22.0'
  ...

I can successfully run pod repo update && pod install, but when compiling the project in Xcode, I get seven errors that were not there before: To give an example, in some library file the error Type 'Number' does not conform to protocol 'Equatable' occurs.

@frederoni
Copy link
Contributor Author

frederoni commented Oct 25, 2018

@paul019 what version of Xcode and Swift are you using? It looks like you're pre-4.0. The last release of MapboxNavigation compatible with Swift 3.2 was v0.10.1.

@1ec5
Copy link
Contributor

1ec5 commented Oct 26, 2018

(It’s called a “transitive dependency”, by the way.)

@paul019
Copy link

paul019 commented Oct 27, 2018

I've now updated Swift to version 4.0 and get the errors anyway...

Do you have any idea, how to solve this? Do I have to update to an even newer version?

@rclee
Copy link
Contributor

rclee commented Oct 29, 2018

@paul019 You could try a higher Swift version. According to this issue Xcode 9.4 (Swift 4.1) should work for this error.

@rclee rclee merged commit 70cbf25 into master Oct 30, 2018
@paul019
Copy link

paul019 commented Nov 1, 2018

Hi! I've two remaining issues:

  1. Although you've merged this into master I can't remove this line of code in the Podfile without getting the above mentioned CocoaPod errors: pod 'MapboxMobileEvents', :git => 'https://github.com/mapbox/mapbox-events-ios.git', :commit => "79d29f1df5a9187481f5c9ac8fa13430d1f04139".

  2. When I run a pod install (with the errorless setup in the Podfile) and then compile the project in Xcode (Swift 4.2) I get this error: 'MapboxDirections/MapboxDirections.h' file not found.

bildschirmfoto 2018-11-05 um 20 40 35

How can I solve those two problems? Thank you very much for your great work and help!

@paul019
Copy link

paul019 commented Nov 5, 2018

@frederoni @rclee @1ec5 After trying various workarounds and spending hours of bug fixing, I've still the two above mentioned issues. Especially issue 2 is very annoying and prohibits me to work at my project. It would help me a lot, when you could give me an advice.

Note:
I've tried Xcode 10 (Swift 4.2) as well as Xcode 9 (Swift 4.1). Both versions resulted in the second issue described in my last post.

@paul019
Copy link

paul019 commented Nov 6, 2018

I've now found a solution for my issue: By commenting out the line of code, that produces the error (see Xcode screenshot), I can solve the issues without creating new errors. I now that this sounds stupid, but is this line of code necessary? It appears to me, that its not important and that its import is not needed in the file.

@paul019
Copy link

paul019 commented Nov 6, 2018

@frederoni @rclee @1ec5 Can this hacky fix work for me or does it change any functionality of the library? If yes, can you please provide another fix/workaround for my issue? I can't find anything regarding it on the internet...

@paul019
Copy link

paul019 commented Nov 7, 2018

@frederoni @rclee @1ec5 An answer would be very appreciated. Or should I open a new issue for this?

@frederoni
Copy link
Contributor Author

@paul019 please open a new ticket in MapboxDirections.swift or mapbox-navigation-ios.

@paul019
Copy link

paul019 commented Nov 7, 2018

@frederoni I've now opened a new ticket in mapbox-navigation-ios:
https://github.com/mapbox/mapbox-navigation-ios/issues/1816

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

Successfully merging this pull request may close these issues.

4 participants