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

Conflicting Frameworks #37

Open
Vortec4800 opened this issue Feb 9, 2020 · 4 comments
Open

Conflicting Frameworks #37

Vortec4800 opened this issue Feb 9, 2020 · 4 comments

Comments

@Vortec4800
Copy link
Contributor

I was having a bunch of issues using this with my project. My project has Firebase installed, which includes a bunch of Google libraries by default.

This framework bundles older versions of GooglePlaces and GoogleMaps base along with, which causes a bunch of errors on launch complaining about the duplication of symbols. The framework also doesn't work, even though I'm setting my API key the app was telling me I didn't have authentication.

The issue was that when I set the API key, that was happening on a different copy of the framework as the one the GooglePlacesRow was trying to use.

My fix is pretty simple, instead of bundling the Google frameworks, just tell Cocoapods that there are dependencies on GooglePlaces and GoogleMaps/Base and let it figure everything out. This removed the duplicate copy and everything worked as expected. You also have to tell Cocoapods that this framework is now a static framework, because the Google frameworks are also static. This didn't seem to have any ill effects.

You can see the changes I made to the pod spec file in my fork here: https://github.com/Vortec4800/GooglePlacesRow/blob/master/GooglePlacesRow.podspec

The only other thing I had to do was also import GoogleMapsBase in the Row swift file, as it's no longer included by default.

@mats-claassen
Copy link
Member

Thanks for the detailed workaround. The issue was obviously known but for projects that do not include GoogleMaps this pod must specify them as dependency.

Maybe there is some way to add the dependencies as a subspec or so (thus making them optional)

@Vortec4800
Copy link
Contributor Author

Well the pod still does specify them as a dependency, it just tells Cocoapods that the frameworks are required and leaves the installation to it. That way if you have multiple pods that require the same framework, it will only be resolved once.

Why would you want to make them optional? Aren't those frameworks required? I guess I don't understand the goal.

@mats-claassen
Copy link
Member

Oh I see. I thought they were removed.
We hadn't specified them as dependencies before as that didn't work with static frameworks. And making a pod static seems to have been added in Cocoapods 1.5.0.
If you want to create a pull request that would be great. Otherwise I will make those changes.

@Vortec4800
Copy link
Contributor Author

Done. You'll have to take a look and let me know if I missed anything dumb.

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

2 participants