newrelic / newrelic-android-agent

SDK to enable instrumentation of Android mobile apps in New Relic
Apache License 2.0
15 stars 15 forks source link

Allow set custom build id when variantMapsEnabled is false #304

Open SilentCatD opened 2 weeks ago

SilentCatD commented 2 weeks ago

Hi there,

Recently, we encountered a problem with integration with Shorebird CodePush, the reason is the BUILD_ID keep changing when we perform code patching.

This entails cleaning the Flutter project, causing the generate NewRelicConfig gradle task to be run and generate a new config with new BUILD_ID.

This is a problem for codepush, because changing in this generated file is considered native change.

Please refer to these issue for more information:

https://github.com/newrelic/newrelic-flutter-agent/issues/123 https://github.com/shorebirdtech/shorebird/issues/755

I have also filed a feature request ticket in newrelic support: NR-334435

Nevertheless, this PR will allow for specify custom build id inside app/build.gradle file, along with original newrelic config.

Currently, in our Flutter app, I use it like this:

// app/build.gradle file

newrelic {
    variantMapsEnabled = false
    buildId = "${flutterVersionName}.${flutterVersionCode}"
}
CLAassistant commented 2 weeks ago

CLA assistant check
All committers have signed the CLA.