MindscapeHQ/raygun4android

Compile requires android 24+?

DanFTRX opened this issue · 3 comments

I attempted to update my app from 3.0.6 to 4.0.1 today and I got the following build error:
Caused by: com.android.tools.r8.utils.AbortException: Error: Static interface methods are only supported starting with Android N (--min-api 24): void com.raygun.raygun4android.logging.TimberRaygunLogger.init()

The documentation says raygun is compatible with 16+ but this error indicates it requires 24+. Am I doing something wrong or was the compatibility changed?

Hi @DanFTRX,

no, the compatibility should still be fine, even though I will probably need up it to API 21 in one of the upcoming releases.

What you're experiencing here is the fact that Timber (one of RG4A's dependencies) is using a Java 8 feature. See more info on the Java 8 tooling here:

https://developer.android.com/studio/write/java8-support

The particular feature (Static interface methods) the message is complaining about is available for any minSdkVersion. I ran into this myself a few days ago with an app, but haven't documented it in the README.

The solution is to make sure you're using Java 8 in your app's build:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

Depending on your situation and what you use, you might need to add:

kotlinOptions {
    jvmTarget = "1.8"
}

Let me know if that solves the issue for you.

@TheRealAgentK Yeah that solved that issue for me. However I am not super thrilled about all my Log statements now having lint warnings because Raygun uses timber.

I'll move my new grip to it's own issue #69