Giter VIP home page Giter VIP logo

heap-sdk-integration's Introduction

Heap SDK integration

The basic installation instructions for the Heap SDK do not describe how to set up the Plugin with the Plugin DSL. Here we go:

The problem

If you're running into an issue such as:

A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.heapanalytics.android'.
   > Could not create plugin of type 'HeapPlugin'.
      > Could not generate a decorated class for type HeapPlugin.
         > com/android/build/api/transform/Transform

you might want to try the following setup instead:

The solution

Add this resolution strategy to your settings.xml

// settings.gradle.kts

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
    // Add a resolution strategy to resolve the right module for "com.heapanalytics.android"
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == "com.heapanalytics.android") {
                useModule("com.heapanalytics.android:heap-android-gradle:${requested.version}")
            }
        }
    }
}

After that you'll be to use apply the plugin with its id:

// build.gradle.kts in app module

plugins {
    id("com.android.application") version "7.2.1"
    id("com.heapanalytics.android") version "1.10.4"
}

This also works with version catalogs:

# libs.versions.toml

[versions]
agp = "7.2.1"
heap = "1.10.4"

[plugins]
android_application = { id = "com.android.application", version.ref = "agp" }
heap = { id = "com.heapanalytics.android", version.ref = "heap" }
// build.gradle.kts in app module

plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.heap)
}

If this was useful for you, you can

"Buy Me A Coffee"

heap-sdk-integration's People

Contributors

bhurling avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.