negativetwelve / react-native-amplitude-sdk

React Native wrapper for Amplitude.
MIT License
2 stars 3 forks source link

[iOS] Cannot build with Carthage #7

Open arthur31416 opened 7 years ago

arthur31416 commented 7 years ago

Hi,

First, thanks for the work.

I have an issue regarding setup a bit similar to this one https://github.com/negativetwelve/react-native-amplitude-sdk/issues/6, but the difference is I'm using Carthage to install Amplitude.

To make things work, I changed in Amplitude.m this:

#import "RNAmplitude.h"
#import "Amplitude-iOS/Amplitude.h"
#import "AMPIdentify.h"

to this:

#import "RNAmplitude.h"
#import <Amplitude/Amplitude.h>
#import <Amplitude/AMPIdentify.h>

I'm not very familiar this kind of setups but would it still be compatible with an installation with a pod install?

negativetwelve commented 7 years ago

Hi @arthur31416 thanks for reporting your findings! It seems like the way I've declared the headers isn't compatible with some build setups. I originally had the code as you posted, but our app wasn't able to build (we have a somewhat intricate cocoapods setup).

I think in the long run, your solution is what we're going to want, but I'll need some time to investigate why that doesn't work and which paths i'll need to add to the HEADERS_SEARCH_PATH to make this work. If you have any ideas regarding that, I'd love to hear!

arthur31416 commented 7 years ago

Thanks for the prompt feedback!

Here is what I added to the HEADERS_SEARCH_PATH (which you have most likely tried):

$(SRCROOT)/../node_modules/react-native-amplitude-sdk/ios
negativetwelve commented 7 years ago

:+1: gotcha, yeah this works for most standard react-native installations but isn't working for our system (our node_modules are in a higher up directory). I won't be able to get to this this week, feel free to send a PR with the changes that you can then use as a fork in your project.

I'll post back here once I have some free time to investigate this!

negativetwelve commented 7 years ago

Also a PR for Carthage instructions would be great as well if you have time!

arthur31416 commented 7 years ago

So I forked your repo to have a working solution for Carthage.

As for the PR, is this fine with you? https://github.com/negativetwelve/react-native-amplitude-sdk/pull/8

negativetwelve commented 7 years ago

@arthur31416 Sorry for just now taking a look at this. If you want, you can submit a PR for carthage support, I'll gladly merge it and release a new version