Closed hughknaus closed 5 months ago
@hughknaus did you add newrelic classpath in your configuration?
@ndesai-newrelic I did have the classpath, but it not have the pointer to the files(...)
I'll try adding that.
Here's my what I have in my trapeze yaml (this didn't work by the way), not sure what the path should be:
- file: build.gradle
target:
buildscript:
dependencies:
insert: |
classpath: "com.newrelic.agent.android:agent-gradle-plugin:7.2.0"
classpath: files("../node_modules/@newrelic/newrelic-capacitor-plugin/android/src/main/java/com/newrelic/capacitor/plugin"). <--- WHAT PATH SHOULD THIS BE?
- file: app/build.gradle
target:
insert: |
apply plugin: 'newrelic'
- file: app/build.gradle
target:
dependencies:
insert: |
implementation "com.newrelic.agent.android:android-agent:7.2.0"
@hughknaus no need to add files in classpath.
@hughknaus It appears that there might be a bug in the Trapeze installation process where the classpath is not added correctly. In order to address this, you can manually add the classpath while following the installation steps.
@ndesai-newrelic I figured it out... silly mistake. I had a colon after classpath
so it was showing up like this in my build.gradle file:
classpath: "com.newrelic.agent.android:agent-gradle-plugin:7.2.0"
After removing the colon in my Trapeze file then it worked like magic. Sorry for taking your time.
Description & Steps to Reproduce
Following these steps: https://github.com/newrelic/newrelic-capacitor-plugin?tab=readme-ov-file#android-setup and those steps seem to have some overlap with some differences from https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-android/install-configure/install-android-agent-gradle/#manual-install. For one, I'm using Capacitor/Trapeze to build the Android project which works great with modifying
build.gradle
,app/build.gradle
, andAndroidManifest.xml
. However, in Android Studio it has the errorPlugin with id 'newrelic' not found.
So it cannot be built.I tried adding
import com.newrelic.agent.android.NewRelic;
to the MainActivity.java and adding anonCreate(...)
withNewRelic.withApplicationToken("<GENERATED_TOKEN>").start(this.getApplicationContext());
but issue remains.Expected Behavior
Expect that since I can build the Ionic/Angular app with Capacitor/Trapeze and generate the Android app that I would be able to build the app from within Android Studio.
Relevant Logs / Console output
Android Studio output:
Your Environment
Apple M2 Max, Sonoma 14.3 Ionic/Angular app building with Capacitor/Trapeze Android Studio Giraffe | 2022.3.1 Patch 1 ** Have not tried building iOS version yet