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

iOS compile issues - 'NewRelicAgent/NewRelic.h' file not found #31

Open
jibugeorge opened this issue Aug 17, 2018 · 18 comments
Open

iOS compile issues - 'NewRelicAgent/NewRelic.h' file not found #31

jibugeorge opened this issue Aug 17, 2018 · 18 comments

Comments

@jibugeorge
Copy link

I am trying to add the new relic agent by following the instructions. I am not able to build the application as I am getting the below compile error in my project's prefix header file and in the RNNewRelic.xcodeproj file

"'NewRelicAgent/NewRelic.h' file not found"

image

Has anyone else faced this issue?

@Clawg
Copy link

Clawg commented Sep 13, 2018

Same here, did you fix this?

@alexmbp
Copy link

alexmbp commented Sep 14, 2018

@Clawg @jibugeorge You have done something wrong with precompiled headers. I have fixed this issue, by adding libraries files directly to project (not adding project file). Also if you are using newer version of SDK - you will need to patch the library. It has one deprecated method:

-  [NewRelicAgent recordEvent:name attributes:args];
+  [NewRelicAgent recordCustomEvent:name attributes:args];

@Clawg
Copy link

Clawg commented Sep 16, 2018

@phuhk
Copy link

phuhk commented Sep 19, 2018

@Clawg @jibugeorge You have done something wrong with precompiled headers. I have fixed this issue, by adding libraries files directly to project (not adding project file). Also if you are using newer version of SDK - you will need to patch the library. It has one deprecated method:

-  [NewRelicAgent recordEvent:name attributes:args];
+  [NewRelicAgent recordCustomEvent:name attributes:args];

hi there, are you know which version of Newrelic should install from pod file, instead lastest version which must add above 2 functions?

@alexmbp
Copy link

alexmbp commented Sep 29, 2018

@phuhk I believe less that 6.x

@sliultron
Copy link

i got same error even with pch file added. how did you fix that with prefix header file ? @Clawg

@bharadwajsampath
Copy link

Use the newrelic agent which is less than version 6.
I used pod 'NewRelicAgent', '~> 5.12.0' and it works fine.
Reason: recordEvent has been removed in version 6 and has been marked as deprecated in 5.12

@martinCouso
Copy link

Hi @jibugeorge were you able to fix it? i tried the solutions mentioned in this issue but i keep getting the same error.

@jibugeorge
Copy link
Author

jibugeorge commented Mar 12, 2019 via email

@ims7inc
Copy link

ims7inc commented May 10, 2019

I got same error. Can anyone find the solution? i am tried with newRelicAgent 6.6.0

@rcidt
Copy link

rcidt commented May 17, 2019

@jibugeorge can you share the scripts?

@jibugeorge
Copy link
Author

@rcidt This is what worked for us

post_install do |installer|

  system("unlink $PWD/pods/NewRelicAgent/NewRelicAgent/NewRelicAgent.framework/Resources")
  system("unlink $PWD/pods/NewRelicAgent/NewRelicAgent/NewRelicAgent.framework/Headers")
  system("unlink $PWD/pods/NewRelicAgent/NewRelicAgent/NewRelicAgent.framework/NewRelicAgent")
  
  system("cp -R $PWD/Pods/NewRelicAgent/NewRelicAgent/NewRelicAgent.framework/versions/A/Resources $PWD/pods/NewRelicAgent/NewRelicAgent/NewRelicAgent.framework")
  system("cp -R $PWD/Pods/NewRelicAgent/NewRelicAgent/NewRelicAgent.framework/versions/A/Headers $PWD/pods/NewRelicAgent/NewRelicAgent/NewRelicAgent.framework")
  system("cp -R $PWD/Pods/NewRelicAgent/NewRelicAgent/NewRelicAgent.framework/versions/A/NewRelicAgent $PWD/pods/NewRelicAgent/NewRelicAgent/NewRelicAgent.framework")
end

@djGrill
Copy link

djGrill commented Oct 15, 2019

I resolved this by adding the prefix header file
https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/configuration/adding-prefix-header-ios-project

  1. Should the PCH file be added to our own project or to the RNNewRelic project?
  2. Should we name the PCH file PrefixHeader.pch as suggested in the README, or <target_name>-Prefix.pch as suggested here?
  3. Should we edit Build Settings > Prefix Header on our own project or on the RNNewRelic project?

Many thanks guys ✌️

@lochness42
Copy link

lochness42 commented Nov 21, 2019

I resolved this by adding the prefix header file
docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/configuration/adding-prefix-header-ios-project

  1. Should the PCH file be added to our own project or to the RNNewRelic project?
  2. Should we name the PCH file PrefixHeader.pch as suggested in the README, or <target_name>-Prefix.pch as suggested here?
  3. Should we edit Build Settings > Prefix Header on our own project or on the RNNewRelic project?

Many thanks guys ✌️

You have to add it to your own project

@minh-dai
Copy link

minh-dai commented Nov 23, 2020

2020
pod 'NewRelicAgent', '~> 7.0.0'
To import this artifact you'll have to use #import <NewRelic/NewRelic.h> instead of the previous#<NewRelicAgent/NewRelic.h>.

@Albert-Gao
Copy link

Albert-Gao commented May 12, 2021

Still have this issue, we are using NewRelic 6.8.0, the prefixed header has been added to the project and setup in the building settings, any solutions? tried all the methods above, not working

image

@glauberl-ciandt
Copy link

Still have this issue, we are using NewRelic 6.8.0, the prefixed header has been added to the project and setup in the building settings, any solutions? tried all the methods above, not working

image

Check @minh-dai response - they changed from NewRelicAgent to NewRelic.

@nisargdesai15
Copy link

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