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

Vendored Framework: "... is not a member type of ..." error #322

Closed
miquelalvarado opened this issue Apr 3, 2024 · 9 comments · Fixed by #329
Closed

Vendored Framework: "... is not a member type of ..." error #322

miquelalvarado opened this issue Apr 3, 2024 · 9 comments · Fixed by #329
Assignees
Labels

Comments

@miquelalvarado
Copy link

Describe the bug
Since the introduction of the JSONSafeEncoder framework we get an error each time we try to add both Segment and JSONSafeEncoder as vendored frameworks (through CocoaPods) to our application project.

When compiling our app we get several errors:
Screenshot 2024-04-03 at 11 12 07

If we jump to a file where it errors you can see as the module name seems to be duplicated (it probably wouldn't even have to be added at all):
Screenshot 2024-04-03 at 11 12 25

I've been searching for the root cause and a possible workaround but workarounds doesn't seem to work when cleaning the project and building again. In any case it seems to be related with the struct JSONSafeEncoder being named exactly the same as the file name as you can see here.

SPM integration works well

To Reproduce
Steps to reproduce the behavior:

  1. Create an example project using CocoaPods and adding Segment as well as Sovran and JSONSafeEncoder as vendored frameworks such as:
    s.vendored_frameworks = [
      "VendoredFrameworks/Segment.xcframework",
      "VendoredFrameworks/Sovran.xcframework",
      "VendoredFrameworks/JSONSafeEncoder.xcframework",
    ]
  1. Compile the project
  2. See error

Expected behavior
The project compiles as when integrated through SPM.

Platform (please complete the following information):

  • Library Version in use: Tried with several of the latest versions, it happens with all of them. Latest release as well (1.5.9)
  • Platform being tested: iOS
@bsneed
Copy link
Contributor

bsneed commented Apr 3, 2024

We don't/won't support Cocoapods. You can have a look at a couple of the forks where pod specs have been added and maybe find some guidance from there.

@bsneed bsneed closed this as completed Apr 3, 2024
@miquelalvarado
Copy link
Author

Hi @bsneed! Yes, I know you don't support Cocoapods so that's why we are using the downloadable xcframework file you provide from the releases section to integrate it (through a feature of CocoaPods called vendored frameworks) in our project.

That xcframework you are publishing is not working right now when integrated into a project. So that's what's making me think it should be supported.
The solution to it seems to be as easy as renaming the file containing the JSONSafeEncoder struct to something else (though I haven't been able to validate it).

I'm keeping the issue as closed and leaving to you the decision of reopening it if you consider my point valid. Thanks!

@bsneed
Copy link
Contributor

bsneed commented Apr 11, 2024

Hi @miquelalvarado, my apologies. I misunderstood. I'll go have a look at it shortly.

@bsneed bsneed reopened this Apr 11, 2024
@miquelalvarado
Copy link
Author

No problem, thanks! 😊

@bsneed
Copy link
Contributor

bsneed commented Apr 16, 2024

Hi @miquelalvarado, I just went in and looked at this. It looks like that's the swift generated header you're looking at. The actual code looks like this ...

image

The link you posted has a solution at the bottom that might be helpful, did you try this?

just Add "-no-verify-emitted-module-interface" to Other Swift Flags to your Build Settings if you are using SPM or Cocoapods.

If that doesn't work, I can change up the module/class names as necessary but would like to avoid it if I can.

@bsneed bsneed closed this as completed Apr 16, 2024
@bsneed
Copy link
Contributor

bsneed commented Apr 16, 2024

oops, hit the wrong button. reopening.

@bsneed bsneed reopened this Apr 16, 2024
@miquelalvarado
Copy link
Author

Hi @bsneed,

Sorry I didn't add that information in my first message but yes, I tried that as well. I've prepared though, a simple project to test it out of my main project and remove other variables that might be involved; and the result is the same. I'm attaching a zip with the project as well as a screenshot where you can see the result:

VendoredFrameworksTest.zip

Screenshot 2024-04-19 at 10 54 48

@bsneed
Copy link
Contributor

bsneed commented Apr 19, 2024

Thanks @miquelalvarado, I'll open it now and have a look.

@bsneed
Copy link
Contributor

bsneed commented Apr 19, 2024

Should be resolved now, thanks for your patience @miquelalvarado !

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

Successfully merging a pull request may close this issue.

2 participants