robertoestivill
10/31/2019, 10:30 AMFirebasePerformance
object in order to configure it.
Documentation
https://firebase.google.com/docs/perf-mon/disable-sdk?platform=android
Groovy example from the documentation
groovy
android {
// ...
buildTypes {
debug {
FirebasePerformance {
// Set this flag to 'false' to disable @AddTrace annotation processing and
// automatic HTTP/S network request monitoring
// for a specific build variant at compile time.
instrumentationEnabled false
}
}
}
}
My build.gradle.kts
has something like
kotlin
buildTypes {
getByName("debug") {
// should disable it here but don't know how to get the reference
}
Any idea how can I get access to the FirebasePerformance
object from inside getByName("debug")
?mbonnin
10/31/2019, 2:33 PMconfigure<FirebasePerfExtension> {}
extensions.getByName("FirebasePerformance") {
this as FirebasePerfExtension
}
robertoestivill
10/31/2019, 3:30 PMval firebase = extensions.getByName("FirebasePerformance") as FirebasePerfExtension
firebase.setInstrumentationEnabled(true)
But is doesn't exist inside android{}
or outside
Extension with name 'FirebasePerformance' does not exist.
mbonnin
10/31/2019, 3:32 PMprivate static void registerExtension(AppExtension androidExt) {
androidExt.getBuildTypes().all((buildType) -> {
((ExtensionAware)buildType).getExtensions().add("FirebasePerformance", FirebasePerfExtension.class);
});
androidExt.getProductFlavors().all((productFlavor) -> {
((ExtensionAware)productFlavor).getExtensions().add("FirebasePerformance", FirebasePerfExtension.class);
});
}
(buildType as ExtensionAware).extensions.getByName("FirebasePerformance")
extensions
, I think you'll need that)productFlavor
, not only buildType
robertoestivill
10/31/2019, 3:38 PMbuildTypes {
getByName("debug") {
val firebasePerf = (this as ExtensionAware).extensions.getByName("FirebasePerformance")
(firebasePerf as FirebasePerfExtension).setInstrumentationEnabled(true)
...
Nope. Still not found. I was walking this way this morning but could nailed the details...Extension with name 'FirebasePerformance' does not exist. Currently registered extension names: [ext]
registerExtension
? maybe that's what's missing š¤mbonnin
10/31/2019, 3:42 PMFirebasePerfPlugin
in IntelliJ, you should have it-Dorg.gradle.debug=true
from the command line and a remote config in idea to see what's going onrobertoestivill
10/31/2019, 3:51 PMbuildTypes {
getByName("debug") {
val firebasePerf = (this as ExtensionAware).extensions.getByName("FirebasePerformance")
(firebasePerf as FirebasePerfExtension).setInstrumentationEnabled(true)
...
mbonnin
10/31/2019, 3:57 PMrobertoestivill
10/31/2019, 4:09 PMgildor
10/31/2019, 4:25 PM