newrelic / newrelic-react-native-agent

New Relic Mobile Agent SDK for React-Native Applications
Apache License 2.0
15 stars 21 forks source link

Getting "Invalid (null or empty) build ID detected! Crash will be ignored by collector" when i have configured build_id #173

Closed adame21 closed 2 weeks ago

adame21 commented 2 months ago

Description

So I have an android + react native app, which our team added newrelic for monitoring We seem to get these errors -

E Agent.getBuildId() was unable to find a valid build Id. Crashes and handled exceptions will not be accepted. E Invalid (null or empty) build ID detected! Crash will be ignored by collector. E ExceptionHelper: java.util.UUID:fromString(UUID.java:194) RandomUUID[java.lang.IllegalArgumentException] Invalid UUID string: E Unable to get obfuscated flag in crash --------- beginning of crash E Invalid (null or empty) build ID detected! Crash will be ignored by collector. E Unable to get obfuscated flag in crash

Steps to Reproduce

I just run the app and crash it after 10 second delay to test this

const appVersion = getVersion() NewRelicAgent.startAgent(config.NEW_RELIC_API_KEY, newRelicAgentConfiguration) NewRelicAgent.setMaxEventBufferTime(60) NewRelicAgent.setMaxEventPoolSize(4000) NewRelicAgent.setJSAppVersion(appVersion) NewRelicWrapper.updateSessionAttributes({env: config.ENV}) setTimeout(() => { const test: any = {} console.log(test.should.fail) }, 10000)

I have in my build.gradle dependencies

    classpath "com.newrelic.agent.android:agent-gradle-plugin:7.0.0"

in the app build.gradle

    apply plugin: "newrelic"

Expected Behavior

I expect the app to have the build ID provided in NewRelicAgent.setJSAppVersion(appVersion)

Relevant Logs / Console output

provided above

Your Environment

Additional context

ex: If appropriate and possible, it would be helpful to add Charles traces.

ndesai-newrelic commented 2 months ago

@adame21 can you share your Gradle version and AGP version for this? you need to use Gradle 7.4.or higher and same for AGP also.

adame21 commented 2 months ago

Hi thanks for the reply currently we have classpath "com.android.tools.build:gradle:7.0.4" classpath "com.newrelic.agent.android:agent-gradle-plugin:7.0.0"

which means we need to upgrade versions and test. unfortunately its not a trivial thing in our project, so ill have to take some time to do it. ill update if that resolved it here once thats done for now should i close the issue until i can update ? thanks !

ShalevC commented 2 months ago

@ndesai-newrelic there is no reference in the docs about gradle 7.4.+ . are you sure about that ?

ndesai-newrelic commented 2 months ago

@ShalevC yes,it is related AGP 7 changes, please check our androud agent gradle requirments.

MeetSwiggy commented 2 months ago

@ndesai-newrelic Even I am facing similar issue. Crashes are not getting reported in Newrelic post upgrade to agent-gradle-plugin v7.3.0. My gradle version is 7.5.1 and AGP is 7.2.1.

I cannot find anything related to gradle update in the release notes.

Can you point me to the right doc where the upgrade of gradle plugin is mentioned?

In the below image I can see AGP as 7.1 and Gradle version as 7.2 that is minimum required for newrelic android agent 7.3.0

image
ndesai-newrelic commented 1 month ago

@MeetSwiggy you need to use AGP version 7.4.0 or higher with gradle version 7.5.1