---
title: Install the New Relic plugin for Android Instant Apps
source: https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-android/install-configure/install-new-relic-plugin-android-instant-apps
---

[Android Instant Apps](https://developer.android.com/topic/instant-apps/index.html) allow users to quickly use your applications without installation. With the Android agent [version 5.17.0](https://docs.newrelic.com/docs/release-notes/mobile-release-notes/android-release-notes/android-5170) and higher, you can use New Relic to detect and instrument all feature modules for an instant app.

Use this documentation along with the standard New Relic procedures to [install Android apps with Gradle and Android Studio](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-android/install-configure/install-android-apps-gradle-android-studio). After following the standard installation procedures, follow these additional steps for Android instant apps.

## Terminology

This procedure uses the following terms that are specific to the Android Instant Apps plugin:

-   **Module**: Any packaged class and/or resource collection
-   **APK**: A module that packages the apps resources and DEX’ed classes
-   **Feature module**: A slimmed down module that contains only a subset of the total APK

## Install the plugin [#install]

To install the New Relic plugin for Android Instant Apps:

1.  First follow the steps in the [Install Android apps with Gradle and Android Studio](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-android/install-configure/install-android-apps-gradle-android-studio) documentation.
2.  Apply the agent plugin in every project Gradle build file.
3.  List the Android agent as a dependency.
4.  Start the agent from each [Activity class](https://developer.android.com/reference/android/app/Activity.html) in the feature that could be side-loaded through a Digital Asset Link intent, (for example, mobile.example.com/signin).

    **Minimal build.gradle example**

    ````gradle
    apply plugin: 'com.android.[application|library|feature|instantapp]'
    apply plugin: 'newrelic'

    dependencies {
        implementation "com.newrelic.agent.android:android-agent:${project.agentVersion}"
    }
    ```

    ````
5.  Review the considerations for [instrumentation](#instrument).

## Instrumentation [#instrument]

When instrumenting an instant app, be aware of the following considerations with APKs:

| **Instant apps and APKs**                                      | **Comments**                                                                                                                                                                                                                                                                                                                                                                                          |
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Instrumentation                                                | - Instrumentation of instant apps behaves the same as instrumentation with a normal APK. The agent will detect when an APK is an instant app. For feature APKs, the agent will inject a unique build ID that instant apps will use when reporting crashes. - The side-loaded (main) activity of every feature must call `NewRelic.start()` when the activity is created (as per normal instructions). |
| ProGuard and Dexguard support for feature and application APKs | Place the `newrelic.properties` file in the root (main) directory of the project.                                                                                                                                                                                                                                                                                                                     |

## ProGuard and Dexguard support [#proguard]

The Android Studio Gradle plugin will obfuscate any build configuration where `minifyEnabled` is set to `true`. In these conditions, the New Relic agent will forward the ProGuard map generated for the build to crash collectors, tagged with a unique build ID generated by the agent.

Obfuscation is best configured in the application or instant app project that includes other modules as dependencies. Modules may configure ProGuard as needed.

> #### ⚠️ IMPORTANT
>
> When using ProGuard or DexGuard with Android apps, follow the procedures to complete the additional, required configuration steps. For more information, see the [ProGuard and DexGuard configuration](https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-android/install-configure/configure-proguard-or-dexguard-android-apps) documentation.

## Troubleshoot auto-instrumentation [#troubleshooting]

If you are not whether the agent is auto-instrumenting an instant app project, try running these steps:

1.  Build app with `debug` (`-d`, `--debug`) option, and capture the build log.
2.  Search the log for evidence of instant apps by looking for either of these terms:

    -   ```
        This appears to be an Instant App
        ```
    -   ```
        BuildId[1a2b34c5-def6-7890-g123-h4567890a]
        ```
3.  The agent will add an attribute named `'instantApp'` to the app's session attributes if the app appears to be an instant app.
