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

No such module 'Algorithms' #4611

Closed
Mr-Persona opened this issue Mar 24, 2021 · 29 comments
Closed

No such module 'Algorithms' #4611

Mr-Persona opened this issue Mar 24, 2021 · 29 comments
Assignees

Comments

@Mr-Persona
Copy link

Mr-Persona commented Mar 24, 2021

I updated Charts today. An error occurred while compiling the project, error tip is no such module 'Algorithms'. I installed Charts through pods.
I next install swift-algorithms by Swift Page Manager, but still can't solve the problem.

Charts version: 4.0.0

@leo150
Copy link
Contributor

leo150 commented Mar 27, 2021

Same issue. Linking Charts with Algorithms doesn't help.

@Mr-Persona
Copy link
Author

Mr-Persona commented Mar 29, 2021

Same issue. Linking Charts with Algorithms doesn't help.

4.0.0 does not support the pods, only use Swift Package. Because the latest version depend on Algorithms, Algorithms is Apple's open source library, unfortunately, Algorithms can only be installed through Swift Package.

@philipbel
Copy link

Thanks for the info, @Mr-Persona!
Should the pod then be removed altogether?

@SchwartzLizer
Copy link

CleanShot 2021-05-05 at 11 30 45
Same problem I use SPM but still got error

@rodgutierrez
Copy link

has anyone found a solution to this yet? i'm using Carthage and running into the same issue.

@leo150
Copy link
Contributor

leo150 commented May 12, 2021

@rodgutierrez yes, import it as Swift Package instead of a pod.

@pateldhruvil96
Copy link

pateldhruvil96 commented May 25, 2021

@leo150 Hey, I have installed via SPM still it's showing same error: No such module 'Algorithms'

@nick-havz
Copy link

answered in #4646

@zhen-easytag
Copy link

I forked the repo and cocoapod to my project, but always having "no such module 'algorithms' ", even I added Algorithms package. But no problem with original repo. Anyone has solution? Thanks~

@dbquarrel
Copy link

I think in your app's project you need to go to File > Swift Packages and try some of the menu items there. When you're done you should see the swift packages showing up on the bottom of your project file listing.

Screen Shot 2021-06-26 at 15 29 37

After this you should be able to build. I am having a problem after this though, I can't build using xcodebuild anymore.

In terms of this project maintenance you guys should really make some notes on the front page of the project like:

  1. we're not supporting CocoaPods anymore
  2. migration info to get off of CocoaPods

This kind of thing is a bloody nightmare for those who do not use swift.

@dbquarrel
Copy link

dbquarrel commented Jun 26, 2021

Xcode itself can build a release version of my app, but using xcodebuild at the commandline to archive, there has to be some extra magic, I get this error, even after I can see xcodebuild build the swiftmodule, it can't find it.

xcodebuild -destination generic/platform=iOS -scheme 'Release Builder' -sdk iphoneos -archivePath /tmp archive

Generates this eventually

/Users/samurai/Projects/misc/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift:12:8: error: no such module 'Algorithms'
import Algorithms
       ^

** ARCHIVE FAILED **

Actually I get this while trying to archive with Xcode too. It is definitely not a straightforward migration from Cocoapods last version to 4.0.0 without pods...

Screen Shot 2021-06-26 at 15 46 42

@Turas
Copy link

Turas commented Jun 27, 2021

  1. remove Charts from Swift Packages
  2. add Swift Algorithms "https://github.com/apple/swift-algorithms"
  3. add Charts

for me works that

@raffaelps
Copy link

One solution for this?

@pokryfka
Copy link

pokryfka commented Oct 17, 2021

Same issue. Linking Charts with Algorithms doesn't help.

4.0.0 does not support the pods, only use Swift Package. Because the latest version depend on Algorithms, Algorithms is Apple's open source library, unfortunately, Algorithms can only be installed through Swift Package.

Please revert #4497

  • Changing dependency is not a patch change, patch (and minor) change should be backward compatible, this one breaks integration.
  • It adds no value feature wise but it adds dependency on an experimental (version 0.0.1) 3rd party library
  • It will makes integration of Charts much more difficult in most scenarios (a few different Targets in app, Carthage, ...)

@liuxuan30
Copy link
Member

Yeah as the last day of 2021, there is still no solution. I came across CocoaPods/CocoaPods#10049 not sure if this will be a workaround. But I have no time to look deeper.. anyone ? thanks

@Mr-Persona
Copy link
Author

Mr-Persona commented Dec 31, 2021 via email

@pmairoldi
Copy link
Collaborator

Version 4.0.2 now available on cocoapods

@Mr-Persona
Copy link
Author

Mr-Persona commented Mar 12, 2022 via email

1 similar comment
@Mr-Persona
Copy link
Author

Mr-Persona commented Apr 8, 2022 via email

@mankarth004
Copy link

Works for me as well, thanks

@SarahDelCastillo
Copy link

I'm working on migrating a project from Cocoapods to SPM, unfortunately Charts remains the only package that prevents the completion of this task. I've tried all the differents solutions given on this thread to no avail. I even tried previous versions of Charts but it only caused different problems. Cleaning build folder, cleaning Derived Data, even restarting my machine, nothing seems to fix it.

Is there a solution to this issue ?

@Mr-Persona
Copy link
Author

Mr-Persona commented Nov 15, 2022 via email

@mavrakis
Copy link

I confirm I have the same issue using SPM. I installed first Charts without swift-algorithms and swift-numerics, got the issue. After looking at this thread, I installed swift-algorithms and swift-numerics, deleted Charts, installed Charts again. I got the same compile time error No such module 'Algorithms'
Thanks for your help

@novinfard
Copy link

I confirm I have the same issue using SPM. I installed first Charts without swift-algorithms and swift-numerics, got the issue. After looking at this thread, I installed swift-algorithms and swift-numerics, deleted Charts, installed Charts again. I got the same compile time error No such module 'Algorithms'
Thanks for your help

Use explicit version 4.1.0 for Charts
Screenshot 2023-02-05 at 11 10 21

@Mr-Persona
Copy link
Author

Mr-Persona commented Feb 5, 2023 via email

@carlos0193
Copy link

I confirm I have the same issue using SPM. I installed first Charts without swift-algorithms and swift-numerics, got the issue. After looking at this thread, I installed swift-algorithms and swift-numerics, deleted Charts, installed Charts again. I got the same compile time error No such module 'Algorithms'
Thanks for your help

Use explicit version 4.1.0 for Charts Screenshot 2023-02-05 at 11 10 21

it doesn't work for me

@sirisb
Copy link

sirisb commented Mar 29, 2023

I chose only Charts and no ChartsDynamic, now I get this error,

Cannot find type 'IAxisValueFormatter' in scope.
I am using Charts 4.1.0. It doesn't work.

@Mr-Persona
Copy link
Author

Mr-Persona commented Mar 29, 2023 via email

@pmairoldi
Copy link
Collaborator

I chose only Charts and no ChartsDynamic, now I get this error,

Cannot find type 'IAxisValueFormatter' in scope. I am using Charts 4.1.0. It doesn't work.

Same issue as #4986. There was a name change in Charts 4 for interfaces.

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