1

Im using the heap.io and their Android SDK and they advise you to setup their library like:

  • build.gradle:
android {
    defaultConfig {
        // Add this section to enable Heap event capture.
        ext {
          heapEnabled = true
        }
        // ...
    }
    // ...
}

But this is using the gradle groovy sintax, Im trying to use it with the Kotlin DSL of gradle like:

  • build.gradle.kts
android {
    defaultConfig {
        ext {
            set("heapEnabled", true)
        }

But it does not work for some reason, so:

Why that may be happening?

Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162

3 Answers3

1

This works:

(this as ExtensionAware).extensions.extraProperties.set("heapEnabled", true)

I believe Heap is looking into making it so the cast isn't necessary.

salbury
  • 91
  • 1
  • 7
0

extra.set("heapEnabled", false)

Erik B
  • 2,810
  • 1
  • 34
  • 38
-2

I was able to make it work using withGroovyBuilder like:

android {
    defaultConfig {
        withGroovyBuilder {
            "ext" {
                setProperty("heapEnabled", LhConfig.isAnalyticEnabled(project))
            }
        }

I still dont understand where is the issue :(

Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162