Skip to content

Commit

Permalink
Merge pull request #17388 from brnhensley/patch-19
Browse files Browse the repository at this point in the history
chore: add language identifiers, minor fixes
  • Loading branch information
ally-sassman committed May 23, 2024
2 parents 25ef388 + 033f00e commit 22d35b4
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ A user different than `root` can be used in the managed policy.
id="cloud-formation-template"
title="CloudFormation template"
>
```

```yml
AWSTemplateFormatVersion: 2010-09-09
Outputs:
NewRelicRoleArn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ These procedures appear in our guided install. Keep in mind that even if you're
id="project-level"
title="Project level `build.gradle` file:"
>
In this example, `<AGENT_VERSION>` represents your agent version number. See the [agent release notes](/docs/release-notes/mobile-release-notes/android-release-notes), and use the latest version.
In this example, `AGENT_VERSION` represents your agent version number. See the [agent release notes](/docs/release-notes/mobile-release-notes/android-release-notes), and use the latest version.

```groovy
buildscript {
Expand All @@ -66,7 +66,7 @@ These procedures appear in our guided install. Keep in mind that even if you're
}
dependencies {
classpath "com.newrelic.agent.android:agent-gradle-plugin:<AGENT_VERSION>"
classpath "com.newrelic.agent.android:agent-gradle-plugin:AGENT_VERSION"
}
}
```
Expand All @@ -76,7 +76,7 @@ These procedures appear in our guided install. Keep in mind that even if you're
id="app-level"
title="App level `build.gradle` file:"
>
In this example, `<AGENT_VERSION>` represents your agent version number. See the [agent release notes](/docs/release-notes/mobile-release-notes/android-release-notes), and use the latest version.
In this example, `AGENT_VERSION` represents your agent version number. See the [agent release notes](/docs/release-notes/mobile-release-notes/android-release-notes), and use the latest version.

```groovy
repositories {
Expand All @@ -87,7 +87,7 @@ These procedures appear in our guided install. Keep in mind that even if you're
apply plugin: 'newrelic'
dependencies {
implementation 'com.newrelic.agent.android:android-agent:<AGENT_VERSION>'
implementation 'com.newrelic.agent.android:android-agent:AGENT_VERSION'
}
```
</Collapser>
Expand All @@ -102,7 +102,7 @@ These procedures appear in our guided install. Keep in mind that even if you're

3. Start the Android agent. In your default Activity found in your manifest, import the `NewRelic` class:

```
```java
import com.newrelic.agent.android.NewRelic;
```

Expand All @@ -111,13 +111,13 @@ These procedures appear in our guided install. Keep in mind that even if you're
4. After you've imported the `NewRelic` class, you need to add an additional snippet to the `onCreate()` method, which includes your app token, which is generated in the guided install. The snippet looks like this:

```java
NewRelic.withApplicationToken("<GENERATED_TOKEN>").start(this.getApplicationContext());
NewRelic.withApplicationToken("GENERATED_TOKEN").start(this.getApplicationContext());
```

5. If you're using minification (for example, like with ProGuard or Dexguard), you need to add `newrelic.properties` file to your app-level directory (projectname/app). This step only applies to ProGuard and DexGuard users.
5. If you're using minification (for example, like with ProGuard or Dexguard), you need to add `newrelic.properties` file to your app-level directory (_projectname/app_). This step only applies to ProGuard and DexGuard users.

```
com.newrelic.application_token=<GENERATED_TOKEN>
```ini
com.newrelic.application_token=GENERATED_TOKEN
```

To finish set up for minification, follow the steps in [configure ProGuard or DexGuard for Android apps](/docs/mobile-monitoring/new-relic-mobile-android/install-configure/configure-proguard-or-dexguard-android-apps).
Expand All @@ -132,7 +132,7 @@ Because the Android agent isn't yet available as a community plugin, you need to

1. Add this snippet to your `settings.gradle(.kts)` file through `pluginManagement {}` block:

```
```groovy
pluginManagement {
repositories {
mavenCentral() // adds repo for NewRelic artifacts
Expand All @@ -149,31 +149,31 @@ Because the Android agent isn't yet available as a community plugin, you need to
// for core Gradle plugins or plugins already available to the build script
plugins {
id("newrelic") version "${<AGENT_VERSION>}"
id("newrelic") version "${AGENT_VERSION}"
}
}
```

2. Declare the New Relic plugin:

```
```groovy
plugins {
// for binary Gradle plugins that need to be resolved
id("newrelic") version "<AGENT_VERSION>" apply false
id("newrelic") version "AGENT_VERSION" apply false
}
```

3. Apply the plugin to the app-level build files:

```
```groovy
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("newrelic")
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("newrelic")
}
```

In the above snippets, `<AGENT_VERSION>` represents your agent version number. We strongly recommend you use the latest agent for set up.
In the above snippets, `AGENT_VERSION` represents your agent version number. We strongly recommend you use the latest agent for set up.

## Android 4.x: Multidex support [#4x-multidex]

Expand All @@ -189,7 +189,7 @@ If you see the `java.lang.NoClassDefFoundError` error, then you must [manually s

1. Create a `proguard.multidex.config` file within the `/app` folder of your project. Update `mypackage` to reflect your package name.

```
```profile
####################
# keep class names #
####################
Expand All @@ -201,12 +201,12 @@ If you see the `java.lang.NoClassDefFoundError` error, then you must [manually s

2. Merge the following code into the app-level `build.gradle` file:

```
```groovy
android {
defaultConfig{
multiDexKeepProguard file("proguard.multidex.config")
}
defaultConfig{
multiDexKeepProguard file("proguard.multidex.config")
}
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,43 +117,54 @@ To enable New Relic to authenticate your Unity app's data, follow these steps:

To configure your Android app you need to customize your Gradle templates. If you're using Unity 2019 or later, complete the following steps:

1. Include the New Relic Maven repository URL in the Gradle build settings. To do this, open your `mainTemplate.gradle` file. This file is usually located in the `Assets/Plugins/Android folder`. Now, open the New Relic Maven URL like this:
1. Include the New Relic Maven repository URL in the Gradle build settings. To do this, open your `mainTemplate.gradle` file. This file is usually located in the `Assets/Plugins/Android` folder. Now, open the New Relic Maven URL like this:

```groovy
allprojects {
buildscript {
repositories {<DoNotTranslate>**ARTIFACTORYREPOSITORY**</DoNotTranslate>
google()
jcenter()
mavenCentral()
buildscript {
repositories {
ARTIFACTORY_REPOSITORY
google()
jcenter()
mavenCentral()
}
}
}
```

2. Add the New Relic `classpath` to your project-level `baseProjectTemplate.gradle` file. You can usually find this file located in the Android folder in your Unity project.

```groovy
dependencies {
// If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity.
// See which Gradle version is preinstalled with Unity here: https://docs.unity3d.com/Manual/android-gradle-overview.html
// See the official Gradle and Android Gradle Plugin compatibility table here: https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// To specify a custom Gradle version in Unity, go to "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)", and specify a path to a custom Gradle version.
classpath 'com.newrelic.agent.android:agent-gradle-plugin:7.2.0'
<DoNotTranslate>**BUILD_SCRIPT_DEPS**</DoNotTranslate>
}
// If you are changing the Android Gradle Plugin version,
// make sure it is compatible with the Gradle version preinstalled with Unity.
// See which Gradle version is preinstalled with Unity here:
// https://docs.unity3d.com/Manual/android-gradle-overview.html
// See the official Gradle and Android Gradle Plugin compatibility table here:
// https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// To specify a custom Gradle version in Unity, go to "Preferences > External Tools",
// uncheck "Gradle Installed with Unity (recommended)",
// and specify a path to a custom Gradle version.
classpath 'com.newrelic.agent.android:agent-gradle-plugin:7.2.0'
BUILD_SCRIPT_DEPS
}
```

If you're using an older Unity version that requires Gradle 7.0 or lower, you'll need to use a specific classpath dependency to ensure compatibility:

```groovy
dependencies {
// If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity.
// See which Gradle version is preinstalled with Unity here: https://docs.unity3d.com/Manual/android-gradle-overview.html
// See official Gradle and Android Gradle Plugin compatibility table here: https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// To specify a custom Gradle version in Unity, go to "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)", and specify a path to a custom Gradle version.
classpath 'com.newrelic.agent.android:agent-gradle-plugin:6.11.0'
<DoNotTranslate>**BUILD_SCRIPT_DEPS**</DoNotTranslate>
// If you are changing the Android Gradle Plugin version,
// make sure it is compatible with the Gradle version preinstalled with Unity.
// See which Gradle version is preinstalled with Unity here:
// https://docs.unity3d.com/Manual/android-gradle-overview.html
// See official Gradle and Android Gradle Plugin compatibility table here:
// https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// To specify a custom Gradle version in Unity, go to "Preferences > External Tools",
// uncheck "Gradle Installed with Unity (recommended)",
// and specify a path to a custom Gradle version.
classpath 'com.newrelic.agent.android:agent-gradle-plugin:6.11.0'
BUILD_SCRIPT_DEPS
}
```

Expand Down Expand Up @@ -348,7 +359,7 @@ SELECT * FROM MobileHandledException SINCE 24 hours ago
New Relic stores your Unity logs as custom events. You can query these logs and build dashboards for them using this NRQL query:

```sql
SELECT * FROM `Mobile Unity Logs` SINCE 30 MINUTES AGO
SELECT * FROM `Mobile Unity Logs` SINCE 30 MINUTES AGO
```

For more information on NRQL queries, see [Introduction to NRQL](/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language/#where).
Loading

0 comments on commit 22d35b4

Please sign in to comment.