我有一个使用gradle构建系统的项目,我愿意在其中添加新的遗迹监控。
该项目(包括New Relic)在Linux(Fedora 20)上运行良好,但不会构建在我的Mac开发系统上,并给出一个错误,说明已加载代理JAR,但代理未能初始化。
以下是错误的完整日志:
Dev-1:test 0x4d$ ./gradlew clean
> Configuring > 1/2 projects > :appobjc[4437]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
[newrelic.error] Agent startup error
java.lang.IllegalAccessException: Can not set static final java.lang.Object field java.util.logging.Logger.treeLock to com.newrelic.agent.compile.RewriterAgent$InvocationDispatcher
at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:73)
at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:77)
at sun.reflect.UnsafeQualifiedStaticObjectFieldAccessorImpl.set(UnsafeQualifiedStaticObjectFieldAccessorImpl.java:77)
at java.lang.reflect.Field.set(Field.java:741)
at com.newrelic.agent.compile.RewriterAgent.createInvocationDispatcher(RewriterAgent.java:772)
at com.newrelic.agent.compile.RewriterAgent.premain(RewriterAgent.java:137)
at com.newrelic.agent.compile.RewriterAgent.agentmain(RewriterAgent.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:407)
> Configuring > 1/2 projects > :appExcjava.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:407)
Caused by: java.lang.RuntimeException: java.lang.IllegalAccessException: Can not set static final java.lang.Object field java.util.logging.Logger.treeLock to com.newrelic.agent.compile.RewriterAgent$InvocationDispatcher
at com.newrelic.agent.compile.RewriterAgent.premain(RewriterAgent.java:168)
at com.newrelic.agent.compile.RewriterAgent.agentmain(RewriterAgent.java:102)
... 6 more
Caused by: java.lang.IllegalAccessException: Can not set static final java.lang.Object field java.util.logging.Logger.treeLock to com.newrelic.agent.compile.RewriterAgent$InvocationDispatcher
at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:73)
at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:77)
at sun.reflect.UnsafeQualifiedStaticObjectFieldAccessorImpl.set(UnsafeQualifiedStaticObjectFieldAccessorImpl.java:77)
at java.lang.reflect.Field.set(Field.java:741)
at com.newrelic.agent.compile.RewriterAgent.createInvocationDispatcher(RewriterAgent.java:772)
at com.newrelic.agent.compile.RewriterAgent.premain(RewriterAgent.java:137)
... 7 more
> Configuring > 1/2 projects > :appAgent failed to start!
[newrelic] Error encountered while loading the New Relic agent
com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:121)
at com.newrelic.agent.android.NewRelicGradlePlugin.apply(NewRelicGradlePlugin.java:47)
at com.newrelic.agent.android.NewRelicGradlePlugin.apply(NewRelicGradlePlugin.java:15)
at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:104)
at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:39)
at org.gradle.api.Project$apply.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
at org.gradle.api.Script$apply.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at build_hf6jnn002tc8mnuv025i0lb49.run(/Users/0x4d/Desktop/test/app/build.gradle:15)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:156)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:507)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:82)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:46)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/0x4d/Desktop/test/app/build.gradle' line: 15
* What went wrong:
A problem occurred evaluating project ':app'.
> com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 14.094 secs
我还测试了一个新生成的基本项目,但它以完全相同的错误失败。
如果有必要的话,我使用JDK 1.7u55版本。
谢谢
有新版本的new relic客户端可用。它解决了V3.361.0在较新JDK和proguard方面存在的问题。下面是您应该使用的方法来解决JDK问题。
classpath 'com.newrelic.agent.android:agent-gradle-plugin:3.378.0'
将其粘贴到您列出依赖项的build.gradle中。如果它不起作用,请告诉我。
我给新遗迹支持发了电子邮件,收到了以下回复:
你好,
感谢您写信给New Relic support。
适用于移动应用程序AndroidSDK的新遗迹版本处于测试阶段,包括与JDK v7u55和JDK v8兼容的修复
可在以下位置获取:https://gist.github.com/asm/bed819fb32253e4cb072.
我们正在等待发布此代理,直到我们从像您这样的用户那里听说SDK运行顺利,并且插装现在工作正常。
如果安装此SDK有任何问题,请告知我们。
我将打开这张票,以便您向我们发送更新信息。我们的自动系统会在几天内ping您,看看您的情况,然后在几天后尝试关单。如果是这样,请不要担心,随时回信,我们会立即为您提供帮助。
不幸的是,u55引入了一个改变,打破了New Relic代理。现在,如果可能的话,在构建时使用旧版本的Java来解决这个问题。这不应影响生成的APK。New Relic已意识到此问题,并正在努力尽快解决此问题。
我使用的是STS 3.6.0,在STS启动期间,我发现错误: 我不能为这个项目运行Gradle任务。有什么建议吗?
我一直在尝试建立一个工作区,以便为Minecraft 1.12.2制作一些基本的mods,为此我一直遵循以下指南:https://codakid.com/guide-to-Minecraft-modding-with-/ 在尝试运行构建时,我遇到了一些问题,但通过遵循以下关于eclipse设置的指南进行了修复:https://techwiseacademy.com/minecraft-moddin
每次我启动Android Studio我得到以下错误: Gradle Vertretungsplan Project项目刷新失败:无法获取使用Gradle分发http://services.gradle.org/distributions/gradle-1.6-bin.zip类型的ideaProject模型。配置项目: Vertretungsplan时出现问题。配置项目: Vertretungsp
我在弹性Beanstalk上运行我的Java web应用程序时遇到了问题。 它使用了一个我在Aurora mySQL服务上运行的mySQL数据库,当我的应用程序在我的Mac上本地运行时,我可以连接到该数据库并使用该数据库。 我还创建了一个弹性Beanstalk服务,并将WAR文件部署到该服务中,但当我试图访问它生成的endpoint时,我得到了Foling502错误: 代理错误 代理服务器收到来自
我开始了一个新的项目,并把火基地云: 这个错误出现了: 警告:API的变体。getJavaCompile()已过时,已替换为“variant”。getJavaCompileProvider()。它将于2019年底拆除。有关详细信息,请参阅https://d.android.com/r/tools/task-configuration-avoidance.确定什么是调用变量。getJavaCompi
我是IntelliJ和Android开发的新手。我的问题是,当我试图构建一个gradle项目时,它会失败并抛出错误代码B0。 我已经将我的Gradle版本更新到5.1.1,但错误仍然存在 谢谢,对不起我的英语!