Feature Idea: Android Java 8 NPE

When compiling my Android project with Java 8 I get the following errors strewn throughout my build logs:

build.gradle

compileOptions {
     sourceCompatibility JavaVersion.VERSION_1_8
     targetCompatibility JavaVersion.VERSION_1_8
 }

Logs:

 [newrelic.info] [java.net.URL] wrapping call to java/net/URL.openConnection()Ljava/net/URLConnection; with com/newrelic/agent/android/instrumentation/HttpInstrumentation.openConnection(Ljava/net/URLConnection;)Ljava/net/URLConnection;
 [newrelic.error] Unfortunately, an error has occurred while processing an unknown class. Please copy your build logs and the jar containing this class and visit http://support.newrelic.com, thanks!
 null
 java.lang.ArrayIndexOutOfBoundsException
 [newrelic.error] Unfortunately, an error has occurred while processing an unknown class. Please copy your build logs and the jar containing this class and visit http://support.newrelic.com, thanks!
 null
 java.lang.ArrayIndexOutOfBoundsException
 [newrelic.error] Unfortunately, an error has occurred while processing an unknown class. Please copy your build logs and the jar containing this class and visit http://support.newrelic.com, thanks!
 null

It occurs on both
classpath 'com.newrelic.agent.android:agent-gradle-plugin:5.7.1'
and
classpath 'com.newrelic.agent.android:agent-gradle-plugin:5.8.4'

Does NewRelic plan on supporting Java 8 any time soon?

Thanks!
Nick


  • I want Android Java 8 support, too
  • I have more info to share (reply below)
  • I have a solution for this

0 voters

We take feature ideas seriously and our product managers review every one when plotting their roadmaps. However, there is no guarantee this feature will be implemented. This post ensures the idea is put on the table and discussed though. So please vote and share your extra details with our team.

Hi @ndoyle, New Relic doesn’t currently support Java 8, but this is currently in review. We do not have a timeline for integrating this feature. I’ll log a feature request so our product team knows we have customers using Java 8.

Thank you for letting us know!

@nromike, thanks for the reply.

We’re really interested in utilizing lambda functions and streams in our application, so we look forward to NewRelic supporting Java 8.

Cheers,
Nick

Thanks for letting us know, @ndoyle! Please be sure to also check out this thread (below) regarding Java 8 support—I believe there is an update from our engineering team in there. :blush: Thanks!

Hi @Linds,

I’m actually asking about Android Java 8 support, not the Java Agent. I believe they are two separate agents as Java 8 definitely does not work on Android.

Cheers,
Nick

You are absolutely right! My mistake, @ndoyle!

In that case, I will add a fresh poll to this thread so that you are able to vote on Android Java 8 support! :wink:

I’ll also pass your need for this along to our product team. Thanks!

1 Like

I want to update anyone following along at home. The New Relic Android agent can be used with Java 8 if Retrolambda is used.

At this time Android support for Java 8 is limited and requires the Jack toolchain which is not supported by the agent.

It’s worth noting that Google recently announced a change in direction for Java 8 support and the future of the Jack toolchain.

Stay tuned for future updates!

1 Like