Skip to content Skip to sidebar Skip to footer

Getting "caused By: Java.lang.runtimeexception" In My Android App

In my Android app, I am facing 'Caused by: java.lang.RuntimeException' since couple of days. Actually I am using some third-party (.jar) library files for audio watermark detection

Solution 1:

Seems that google's gson is included in retrofit's one. Please check this answer.

Solution 2:

This issue is caused by bad using of gradle plugin, means the version gradle plugin is too low. So to resolve your issue, you must upgrade gradle plugin to 3.5.3 and higher.

buildscript{
    ........
 
    dependencies {
          classpath 'com.android.tools.build:gradle:3.2.1'
    }
 
}

You can refer to this reported issue on Gson github repository :https://github.com/google/gson/issues/1597

And on side effects, you must upgrade gradle wrapper

distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

And add the compile options config on the build gradle file :

android{
    ......
 
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

Post a Comment for "Getting "caused By: Java.lang.runtimeexception" In My Android App"