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

SwiftNIO dependency causes build to fail #828

Closed
andersonfds opened this issue Jan 27, 2023 · 13 comments
Closed

SwiftNIO dependency causes build to fail #828

andersonfds opened this issue Jan 27, 2023 · 13 comments
Labels
bug Something isn't working platform: ios iOS is affected

Comments

@andersonfds
Copy link

Installed patrol and followed the install guide and after that I'm unable to build my application, seems that SwiftNIO is causing this error

image

Is there any fix or workaround?

Thanks.

@bartekpacia
Copy link
Contributor

Hi @andersonfds, thanks for reporting this,

It indeed looks strange – I havne't seen this before. What's your minimum iOS version (in Podfile and Xcode project settings?)

@andersonfds
Copy link
Author

Minimum iOS prior to patrol was 12.1, I've changed to 13.0 as patrol requires 13.0

@andersonfds
Copy link
Author

To reproduce the problem you just have to add this to your Podfile:

target.build_configurations.each do |config|
   config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
   config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' # This line seems to make it stop working
   config.build_settings['SWIFT_VERSION'] = '5.4'
end

@bartekpacia
Copy link
Contributor

Can you share the repository with me or create a minimal, reproducible example? It really helps me get up to speed with such bugs :)

@bartekpacia bartekpacia added bug Something isn't working platform: ios iOS is affected labels Jan 29, 2023
@andersonfds
Copy link
Author

Okay, I created a minimal reproducible example. The problem is on the Podfile, specifically when you add the BUILD_LIBRARY_FOR_DISTRIBUTION flag. So basically if you remove that line it works beautifully, still, I need that flag for some other plugins on my application

Here's the repo link: https://github.com/andersonfds/patrol_bug_example

@bartekpacia
Copy link
Contributor

Thank you, I'll take a look at it soon.

@wheeOs
Copy link

wheeOs commented Mar 9, 2023

I'm also facing this issue. During my research for a solution I came across this here grpc/grpc-swift#1274 (the core: grpc/grpc-swift#1063 (comment)) and it seems like the bug is related to protobuf which patrol uses as a dependency.

I'm looking forward for a solution, since currently I have to exclude patrol from my project as my iOS builds won't work anymore otherwise

@wheeOs
Copy link

wheeOs commented Mar 23, 2023

@andersonfds

this is what helps me out. But I hope there will be a solution within the project of patrol rather than on application level:

post_install do |installer|
  excluded_pods = [
  '_NIODataStructures',
  'gRPC-Swift',
  'SwiftNIO',
  'SwiftNIOCore',
  'SwiftNIOPosix',
  'SwiftNIOConcurrencyHelpers',
  'SwiftNIOExtras',
  'SwiftNIOFoundationCompat',
  'SwiftNIOHPACK',
  'SwiftNIOHTTP1',
  'SwiftNIOHTTP2',
  'SwiftNIOSSL',
  'SwiftNIOTLS',
  'SwiftNIOTransportServices'
  ]
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      unless excluded_pods.include?(target.name)
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
      end
    end
    flutter_additional_ios_build_settings(target)
  end
end

@bartekpacia
Copy link
Contributor

bartekpacia commented Mar 23, 2023

@wheeOs I'm glad you found a workaround and shared it here. Thank you and sorry for the problems.

still, I need that flag for some other plugins on my application

What plugins require that flag?

@wheeOs
Copy link

wheeOs commented Apr 11, 2023

What plugins require that flag?

@bartekpacia I think that wasn't addressed to me but I can say that this sdk requires that flag for example

@andersonfds
Copy link
Author

Hey the plugins I'm using that requires that flag are intellectual property of one of my company's partner so I can't really talk about 'em but as @wheeOs said, there are some plugins out there that also requires that flag.

@bartekpacia
Copy link
Contributor

SwiftNIO is no longer our dependency as of #1681.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working platform: ios iOS is affected
Projects
None yet
Development

No branches or pull requests

3 participants