first solution:
adds this dependency to android in build.gradle of a project:
compileOptions { targetCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8 }
p>
second solution:
add a configuration in the defaultConfig configuration under android in the project’s build.gradle file:
multiDexEnabled true
p>
the third solution is the one I want to share with you most, because this error report I tried a lot of methods, but it still doesn’t work, and finally because the JVM allocation mechanism memory space caused by the compilation error
add this sentence under gradle.properties for the project:
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
p>
p>
div>