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> {}
mbonnin
10/31/2019, 2:34 PMmbonnin
10/31/2019, 2:37 PMextensions.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 PMmbonnin
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);
});
}
mbonnin
10/31/2019, 3:33 PM(buildType as ExtensionAware).extensions.getByName("FirebasePerformance")
mbonnin
10/31/2019, 3:34 PMextensions
, I think you'll need that)mbonnin
10/31/2019, 3:35 PMproductFlavor
, 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...robertoestivill
10/31/2019, 3:38 PMExtension with name 'FirebasePerformance' does not exist. Currently registered extension names: [ext]
robertoestivill
10/31/2019, 3:41 PMregisterExtension
? maybe that's what's missing 🤔mbonnin
10/31/2019, 3:42 PMmbonnin
10/31/2019, 3:43 PMFirebasePerfPlugin
in IntelliJ, you should have itmbonnin
10/31/2019, 3:46 PMmbonnin
10/31/2019, 3:50 PM-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)
...
robertoestivill
10/31/2019, 3:51 PMmbonnin
10/31/2019, 3:57 PMrobertoestivill
10/31/2019, 4:09 PMgildor
10/31/2019, 4:25 PM