-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
'LineChartView' is unavailable: cannot find Swift declaration for this class #2145
Comments
Did you |
will you try ChartsDemo and refer it? Don't see this happens.. |
just saw it's a Feb 7 issue, and no response then. closing. |
I did import Charts and spent a lot of time comparing the demo project to my own. My issue is probably a little unique, but hopefully this helps someone. The problem is that my project has a number of custom named targets (ie not Release or Debug). Because I was compiling Charts as a subproject, Xcode would attempt to compile the target in Charts that corresponded to the target name I was compiling in my main project. When no such match is found, the Release target is compiled in the sub project. The problem with this is that my header search paths were not set to look at that path. I used an environment variable that pointed to the current build config (I am going off memory so I don't have the variable name handy - will add it in later). So, when I tried to compile the main project, it wouldn't be able to find Charts.framework because it's path was not there. It threw me off for a bit, because the header path LOOKED correct. In any case, the answer was to add an additional search path that hard coded the /Release path as this would be the default build location in the event of a mismatch. Hopefully that helps at least one person! |
Thanks @jrames for details. |
I followed the directions outlined in 'Usage' of the Readme to copy the latest Charts master (commit #8532371) into my workspace in Xc8.2.1. I'm receiving the error mentioned in the subject when I attempt to build. Below are details on my setup and what I've tried.
First, I copied the contents of the library to my project folder (using Finder). Then I dragged Charts.xcodeproj under my main workspace. I then added Charts as an embedded binary, and everything looks as I'd expect (it appears in Embedded Binaries and Linked Frameworks). I'm only doing this for Charts.framework as I don't need Realm support.
After doing so, I am able to #import Charts into a Swift file in the project. Autocomplete also picks up the library contents. Here is what I attempted:
let newView = LineChartView(frame: viewRect)
When I build (for the simulator), I get the following error:
I've tried:
The text was updated successfully, but these errors were encountered: