Charts icon indicating copy to clipboard operation
Charts copied to clipboard

Library evolution support on cocoapods

Open aswathr opened this issue 2 years ago • 2 comments

What did you do?

  1. Added Charts as a dependency in my framework project with Cocoapods.
  2. Switched BUILD_LIBRARY_FOR_DISTRIBUTION = YES
  3. Build framework

What did you expect to happen?

Build to succeed

What happened instead?

Build fails with errors on SwiftAlgorithms Screenshot 2022-07-26 at 2 01 21 PM

Charts Environment

Charts version/Branch/Commit Number: 4.0.3 Xcode version: 13.3 Swift version: 5 Platform(s) running Charts: iOS 15 target (framework) macOS version running Xcode: 12.1

Demo Project

ChartsSampleEvolution.zip

Possible fix

Library evolution can be disabled for SwiftAlgorithms using the post_install hook, which I did.

post_install do |installer|
    installer.pods_project.targets.each do |target|
        puts "#{target.name}"
        if target.name == "SwiftAlgorithms"
          target.build_configurations.each do |config|
            config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
          end
        end
    end
end

but the warning that throws Screenshot 2022-07-26 at 2 10 32 PM

can be silenced by changing import Algorithms to @_implementationOnly import Algorithms, which IMO shouldn't cause any issues as Charts doesn't seem to expose publicly any types of SwiftAlgorithm?

aswathr avatar Jul 26 '22 08:07 aswathr

I have same issue, last version that works with BUILD_LIBRARY_FOR_DISTRIBUTION was 4.0.0

matopeto avatar Sep 14 '22 10:09 matopeto

Same issue for me.

pykaso avatar Sep 14 '22 10:09 pykaso

Closed by #4912

pmairoldi avatar Mar 21 '23 02:03 pmairoldi