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

'Tracker/Crash.h' file not found #29

Closed
mackoj opened this issue Mar 26, 2018 · 20 comments
Closed

'Tracker/Crash.h' file not found #29

mackoj opened this issue Mar 26, 2018 · 20 comments

Comments

@mackoj
Copy link

mackoj commented Mar 26, 2018

I have this 'Tracker/Crash.h' file not found when I tried to compile your SDK with Cocoapods SDK version ATInternet-Apple-SDK/Tracker (2.8.9).

I'm trying Cocoapods 1.5.0 because it can improve significantly app start time https://twitter.com/alloy/status/972503674009288705.

Dans le fichier TrackerTests-Bridging-Header.h

Remplacer

#import <Tracker/Crash.h>
#import <Tracker/Hash.h>

Par

#import "Crash.h"
#import "Hash.h"
@mackoj mackoj closed this as completed Mar 26, 2018
@mackoj mackoj reopened this Mar 26, 2018
@d-theo
Copy link
Contributor

d-theo commented Mar 27, 2018

Oh that's great news from Cocoapods. Do you use ATInternet-Apple-SDK/Tracker ? I believed that static framework were not available for frameworks that contain assets

@mackoj
Copy link
Author

mackoj commented Mar 27, 2018

I do use ATInternet-Apple-SDK/Tracker.
Great point I didn't know that but It doesn't seem to block Cocoapods I think we(as you from ATInternet and us user) should test this more.

In order to improve our startup time, we are trying to move every dependency into a lot of static libraries and then build around one dynamic library.

This is the explanation of our journey if you are interested if not we research how to do it without a lot of success until Cocoapods propose this feature.

We started by watching this WWDC video session and read this article.

We want to achieve something like Automatic or Artsy/Eigen did.

In order to passe all of our dependency into static dependency, we tried Amimono, Accelerator and Swift-Staticlibs but it wasn't a great success.

When Cocoapod announce that they will support swift static framework it's was a great news for us.

The first part of this support came back in 1.4.0 and a second part will come into 1.5.0.

Thanks for your time and work

@d-theo
Copy link
Contributor

d-theo commented Mar 27, 2018

I pushed a test branch where i'm going to see how it goes :)
pod 'ATInternet-Apple-SDK/Tracker', :git => 'https://github.com/at-internet/atinternet-apple-sdk', :branch => 'static_lib'

@mackoj
Copy link
Author

mackoj commented Apr 16, 2018

Sorry for the delay I was on vacation.
I have this issues now.

<unknown>:0: error: module map file '/Pods/Headers/Public/Tracker/ATInternet-Apple-SDK.modulemap' not found
<unknown>:0: error: module map file '/Pods/Headers/Public/Tracker/ATInternet-Apple-SDK.modulemap' not found
<unknown>:0: error: missing required module 'SwiftShims'

@mackoj
Copy link
Author

mackoj commented May 20, 2018

I still have this issue with the last version of Cocoapods and the last version of this SDK 2.8.9 and Cocoapods(1.5.2)
Please test your SDK with use_frameworks!(false) in your Podfile.

Thanks,

@d-theo
Copy link
Contributor

d-theo commented May 24, 2018

I am currently working on the branch 2.9beta, but I'm facing strange bugs with cocoapods

edit: the CoreData stack seems to fail to initialize with the static library flag in my podspec. I guess it has to do with the fact that assets are not well supported

@d-theo
Copy link
Contributor

d-theo commented May 25, 2018

I finally managed to make it works with static library on a fresh project !
If you have time, can you try the branch 2.9 and tell me if it works for you too ?

target 'YourApp' do
  use_frameworks!(false)
  pod "ATInternet-Apple-SDK/Tracker", :git => "https://github.com/at-internet/atinternet-apple-sdk.git", :branch => "2.9beta"
end

I may need more tests to check ObjC compatibility and if nothing with core data was broken in the process for older apps but the official update should be next week

@mackoj
Copy link
Author

mackoj commented May 25, 2018

Ok I will try thanks !

@d-theo
Copy link
Contributor

d-theo commented May 28, 2018

I have some trouble pushing the new spec (in master) with the static flag...
I think it's a CP bug, possibly related to this one :
CocoaPods/CocoaPods#7617

@d-theo
Copy link
Contributor

d-theo commented May 29, 2018

update : after (too much) hours of failure, I'm not able to push the SDK with the static feature. Its seems that CP 1.5.3 to not stable enough

@mackoj
Copy link
Author

mackoj commented May 29, 2018

Ok I understand will you try again when Cocoapods 1.6.0 is out ?

@d-theo
Copy link
Contributor

d-theo commented May 29, 2018

I will keep an eye on it 👍
If you really need the feature, you can still go with the static_lib branch or the commit 26697cc81bd227c9ad9798a68c460a67f8bd0ada

Unless we have some GDPR issues or hotfixes, chances are that the tracker is not going to be updated before swift5 ;)

@fabb
Copy link

fabb commented Jun 20, 2018

Cool, we'd also be interested in using this lib as a static framework.

Could it be that the podspec needs to be modified in order for #import "TrackerTests-Bridging-Header.h" not be included in the umbrella header that Cocoapods generates?

My umbrella header (from the master branch) looks like this:

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif

#import "Crash.h"
#import "Hash.h"
#import "Tracker.h"
#import "TrackerExtension.h"
#import "TrackerTests-Bridging-Header.h"

FOUNDATION_EXPORT double TrackerVersionNumber;
FOUNDATION_EXPORT const unsigned char TrackerVersionString[];

There's really no need for TrackerTests-Bridging-Header.h in client projects I guess.

@fabb
Copy link

fabb commented Jun 20, 2018

Maybe you just need to declare the public_header_files in you podspec to fix the issue?

@d-theo
Copy link
Contributor

d-theo commented Jun 20, 2018

Hello,
the main issue was related to s.resources and importing all the .png in there. I changed it by including all the pngs into a bundle and cocoapods seems to be ok again.
Good news after this change, pod spec lint finally worked with the static flag 👍

Right now i'm working on something else that should go live soon so I don't have many bandwidth to work on it (i'm just the maintainer btw) but be sure that it's going to work soonish :)

@fabb
Copy link

fabb commented Jun 20, 2018

@d-theo I looked at the static_lib branch. It is not necessary that you set s.static_framework = true. Cocoapods 1.5.0 will automatically integrate all frameworks statically if the use_frameworks! statement is removed from the client Podfile.
When setting static_framework = true, the pod will always be built static, even if use_frameworks! is specified.
You might still decide to keep the static_framework setting, but I wanted to point out the difference.

@fabb
Copy link

fabb commented Jun 20, 2018

@d-theo And another thing that I saw in the diff: when you add TrackerTests-Bridging-Header.h to the exclude_files of the Tracker subspec, then it is not necessary to change the imports in TrackerTests-Bridging-Header.h. I guess the test header shouldn't be part of the public interface of the pod anyways?

@d-theo
Copy link
Contributor

d-theo commented Jun 20, 2018

Yeah I guess so :)

@d-theo
Copy link
Contributor

d-theo commented Jul 3, 2018

hi guys,

I finally pushed a version (2.9.4) without TrackerTests-Bridging-Header.h (and some small fixes) and it looks like it's working perfectly 👍
I kept the static_framework = true and will see if there are limitations.

From what I understand it could help people that still needs to keep use_frameworks! for some reason. With the static_framework = true they would still get the compilation boost from the libs that support static builds.

Also we changed our git process from Private Development, Public Releases and we will work only on this repo in hope to make easier the CI process ;)

@mackoj
Copy link
Author

mackoj commented Jul 3, 2018

thanks

@d-theo d-theo closed this as completed Aug 24, 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