Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Install NewRelic in an Android library?

android

#1

Hi,

I’m trying to install the newrelic plugin in an Android library project but it seems that the android application dependencies are required :

Error:(42, 0) Could not find property 'applicationVariants' on com.android.build.gradle.LibraryExtension_Decorated@316619b0.

Is it possible possible to install the newrelic plugin in a library project ?

Thanks for your help !


Newrelic in a library/application?
#2

The New Relic agent requires an application project to properly perform instrumentation. Unfortunately we don’t work in a library project (I have seen this work with ant) building with gradle.


#3

As it’s a year old answer, could you please confirm whether integrating newrelic mobile in library project is possible, with using latest version of NewRelic?

I am also getting the same error while integrating NewRelic into the library project.


#4

The New Relic Android agent does not work within a library. It is designed to instrument within an application context. New Relic is not a standard 3rd party library because of the instrumentation our SDK generates for the app at build time.

Adding the New Relic agent to multiple apps can be made simpler by including it within the root level build.gradle.


#5

Is it possible to trace http requests through APIs such as noticeHttpTransaction, in a library project ?


#6

@yingxin, unfortunately the way the New Relic Android SDK does the instrumentation of Android apps, they must be applications and not library projects. Library projects cannot themselves be instrumented as the instrumentation must happen at app compile time.


#7

Hey guys, since the last respond to this from NR was almost 2 years ago, do we have any update if this is possible to do?

We’re currently using agent version 5.12.0


#8

Hi @toomanyeduardos, I see we’re digging into this in a support ticket. I’ll loop back here when we have more information on this specific configuration.


#9

Any Update on this in the latest SDK


#10

Hey @anam_upender_reddy - The way the agent works has not changed much from the time the last update here was posted - that is to say that we still require apps to be application projects and not libraries.