I'm having problems trying to create my Android project, which depends on New Relic. See the class table and trace below.
Command:
./gradlew clean assembleProdDebug assembleProdDebugTest
See output output below:
... :my-project:my-project:packageReleaseJniLibs[newrelic] Error encountered while loading the New Relic agent java.io.IOException: File exists at sun.tools.attach.BsdVirtualMachine.createAttachFile(Native Method) at sun.tools.attach.BsdVirtualMachine.<init>(BsdVirtualMachine.java:74) at sun.tools.attach.BsdAttachProvider.attachVirtualMachine(BsdAttachProvider.java:63) at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208) at com.sun.tools.attach.VirtualMachine$attach.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at com.newrelic.agent.android.NewRelicTask.injectAgent(NewRelicTask.groovy:45) at com.newrelic.agent.android.NewRelicTask$injectAgent$0.callCurrent(Unknown Source) FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':my-project:newRelicInstrumentTask'. > java.io.IOException: File exists
He complains about βFile exists,β but he says nothing about which file or where and how to solve it.
The top level build.gradle file has the following dependency:
classpath "com.newrelic.agent.android:agent-gradle-plugin:4.+"
and each of the two applications has the following:
compile 'com.newrelic.agent.android:android-agent:4.273.4'
The new Relic and build process worked fine until I combined the two applications into the same Android studio project. I did this because two applications have a lot of code with each other.
Has anyone had the same problem? Any ideas on how to solve it? Just ask if you need more information.
source share