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

Without use_frameworks!, "implemented in both" loader errors running tests #7592

Closed
paulb777 opened this issue Apr 5, 2018 · 4 comments · Fixed by #7601
Closed

Without use_frameworks!, "implemented in both" loader errors running tests #7592

paulb777 opened this issue Apr 5, 2018 · 4 comments · Fixed by #7601
Milestone

Comments

@paulb777
Copy link
Member

paulb777 commented Apr 5, 2018

Report

What did you do?

  • git clone [email protected]:paulb777/imp-in-both.git
  • cd imp-in-both/Example/
  • pod update
  • open imp-in-both.xcworkspace/
  • Build and notice Xcode log

What did you expect to happen?

No warnings

What happened instead?

objc[42576]: Class PodsDummy_GoogleToolboxForMac is implemented in both /Users/paulbeusterien/Library/Developer/CoreSimulator/Devices/672B8E49-CA5F-43C5-BC66-5F8FC451D677/data/Containers/Bundle/Application/9D3FF006-692D-4621-8397-0CDB6AFAC15F/imp-in-both_Example.app/imp-in-both_Example (0x107ef3350) and /Users/paulbeusterien/Library/Developer/Xcode/DerivedData/imp-in-both-cofvyqfvbkjbeuabqmlwgyviabun/Build/Products/Debug-iphonesimulator/imp-in-both_Example.app/PlugIns/imp-in-both_Tests.xctest/imp-in-both_Tests (0x121aa1a18). One of the two will be used. Which one is undefined.
objc[42576]: Class PodsDummy_imp_in_both is implemented in both /Users/paulbeusterien/Library/Developer/CoreSimulator/Devices/672B8E49-CA5F-43C5-BC66-5F8FC451D677/data/Containers/Bundle/Application/9D3FF006-692D-4621-8397-0CDB6AFAC15F/imp-in-both_Example.app/imp-in-both_Example (0x107ef33a0) and /Users/paulbeusterien/Library/Developer/Xcode/DerivedData/imp-in-both-cofvyqfvbkjbeuabqmlwgyviabun/Build/Products/Debug-iphonesimulator/imp-in-both_Example.app/PlugIns/imp-in-both_Tests.xctest/imp-in-both_Tests (0x121aa1a68). One of the two will be used. Which one is undefined.

In a larger example, this led to test failures because of sporadic isKindOfClass failures

CocoaPods Environment

Stack

   CocoaPods : 1.5.0
        Ruby : ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin17]
    RubyGems : 2.6.13
        Host : Mac OS X 10.13.3 (17D47)
       Xcode : 9.2 (9C40b)
         Git : git version 2.15.0.403.gc27cc4dac6-goog
Ruby lib dir : /Users/paulbeusterien/.rbenv/versions/2.4.0/lib
Repositories : cpdc-eap-spec - sso://cpdc-eap/spec @ a8bc771e29e69f1909d675897aa194584edc02e4
               cpdc-internal-spec - sso://cpdc-internal/spec @ 18fc461957247a2c3d86b43901cf0d3c3f1a40b2
               master - https://github.com/CocoaPods/Specs.git @ 4a324eae6501e935f5169d4c9f4b2ae9801ef0fc
               paul-specs - sso://user/paulbeusterien/Specs @ 0b01f6ce5731056ef13971c3c2e339fb1c789cff

Installation Source

Executable Path: /Users/paulbeusterien/.rbenv/versions/2.4.0/bin/pod

Plugins

claide-plugins         : 0.9.2
cocoapods-deintegrate  : 1.0.2
cocoapods-dependencies : 1.1.0
cocoapods-plugins      : 1.0.0
cocoapods-search       : 1.0.0
cocoapods-stats        : 1.0.0
cocoapods-trunk        : 1.3.0
cocoapods-try          : 1.1.0
cocoapods_debug        : 0.1.0

Project that demonstrates the issue

https://github.com/paulb777/imp-in-both

@dnkoutso dnkoutso added this to the 1.5.1 milestone Apr 5, 2018
@segiddins
Copy link
Member

does this not happen without use modular headers?

@paulb777
Copy link
Member Author

paulb777 commented Apr 5, 2018

Oh, you're right. It happens without use_frameworks! whether use_modular_headers! is there or not.

@paulb777 paulb777 changed the title With use_modular_headers!, "implemented in both" loader errors Without use_frameworks!, "implemented in both" loader errors running tests Apr 5, 2018
@ileitch
Copy link

ileitch commented Apr 6, 2018

We've a similar issue. Our setup is a framework shared by two apps in a single workspace.

With use_frameworks! pods like GoogleMaps (which are just static libs wrapped in a framework) will cause these warnings since it's implemented in both the shared framework and the apps. We have a nasty wrapper around GoogleMaps that allows us to use a single implementation of GoogleMaps at runtime from both the framework and app.

With use_modular_headers! the situation now applies to many other pods. Basically any pod that maintains global internal state won't work at expected because of the multiple implementations.

Related: #7155

@lucabartoletti
Copy link

Is this change supposed to fix #6918 ?

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 a pull request may close this issue.

5 participants