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

'Charts/Charts-Swift.h' file not found #3603

Closed
MohamedKamashany opened this issue Aug 15, 2018 · 2 comments
Closed

'Charts/Charts-Swift.h' file not found #3603

MohamedKamashany opened this issue Aug 15, 2018 · 2 comments

Comments

@MohamedKamashany
Copy link

MohamedKamashany commented Aug 15, 2018

I'm trying to import #import <Charts/Charts-Swift.h> in header file. It works well in the running mode before adding test target. But after adding test target to my project and trying to build my project in the testing mode, it tells me that 'Charts/Charts-Swift.h' file not found.

Charts Environment

**Charts version/Branch/Commit Number: 3.1.1
**Xcode version:9.3
**Swift version:4.1
**Platform(s) running Charts: iOS
**macOS version running Xcode: 10.13.2
screen shot 2018-08-15 at 11

@liuxuan30
Copy link
Member

liuxuan30 commented Aug 17, 2018

To quote what carthage used to say:

Adding frameworks to unit tests or a framework
Using Carthage for the dependencies of any arbitrary target is fairly similar to using Carthage for an application. The main difference lies in how the frameworks are actually set up and linked in Xcode.

Because unit test targets are missing the Linked Frameworks and Libraries section in their General settings tab, you must instead drag the built frameworks to the Link Binaries With Libraries build phase.

In the Test target under the Build Settings tab, add @loader_path/Frameworks to the Runpath Search Paths if it isn't already present.

In rare cases, you may want to also copy each dependency into the build product (e.g., to embed dependencies within the outer framework, or make sure dependencies are present in a test bundle). To do this, create a new Copy Files build phase with the Frameworks destination, then add the framework reference there as well. You shouldn't use the carthage copy-frameworks command since test bundles don't need frameworks stripped, and running concurrent instances of copy-frameworks (with parallel builds turn on) is not supported.

Is that your case?

@liuxuan30
Copy link
Member

you have to figure out how do you add the framework.

@jjatie jjatie closed this as completed Sep 17, 2018
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

3 participants