Reputation: 2655
I'm just getting started with the iOS charts library :
I followed all the steps described under 'Usage' on the main page (https://github.com/danielgindi/ios-charts):
I added a UIView
and made it subclass LineChartView
--> in ViewController.swift
: the line import Charts
gives an error: Cannot load underlying module for 'Charts'
Why is that ?
Thank you !
Upvotes: 2
Views: 4670
Reputation: 182
Make sure your scheme is targeting an iOS device or simulator. If you build for your Mac it'll give you this error.
Upvotes: 0
Reputation: 36447
I had the same issue with KeychainAccess pod. Even though the pod was installed it use to throw an error
‘Cannot load underlying module for KeychainAccess’.
The fix that worked for me :
Upvotes: 0
Reputation: 7499
After cleaning the product once I received this error. I then removed the framework from embedded binaries
, cleaned the product, then added it once more to embedded libraries
. I then built the product and retried the import
statement. The import statement worked.
Upvotes: 0
Reputation: 682
The answer comes a bit late, but what solved the problem for me was to clean my project by selecting the option Product > Clean
from my status bar. Hope it might help someone else in case you solved the problem already.
Upvotes: 1
Reputation: 3496
It's possibly related to this issue too: https://github.com/Alamofire/Alamofire/issues/122
In short: Seems like there's a bug in Xcode 6.3.1, where new projects have problems when importing Embedded Frameworks. In such a case, you need to let the project build first, and then add the framework to the project.
Upvotes: 4
Reputation: 1519
Sounds like your project haven't added the framework successfully. I just started with ios-charts as well, and I followed the steps on github as well and it worked like a charm. What I did was to just drag the Charts.xcodeproj
into my Project Navigator and it worked like a charm. If this doesn't work for you, however, make sure you are using iOS 8. If you are not, then you have to add the .swift
-files to your project. If you are using iOS 8 and the approach still doesn't work, I'd try to install it using CocoaPods instead. I'm fairly new in CocoaPods so can't really help you there, but just google on how to install frameworks using CocoaPods and you should find what you seek.
Sorry if I wasn't of much help!
Upvotes: 1