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>
Read More:
- Default interface methods are only supported starting with Android N (–min-api 24): com.XXXX
- As Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- Solve gradle project refresh failed
- How to Fix Android Error:This Gradle plugin requires Studio 3.0 minimum
- Android Studio Error: Invoke-customs are only supported starting with Android O (–min-api 26)
- Perfect solution Error:Execution failed for task ‘: APP:transformClassesWithDexForDebug ‘… Problem
- Failed to find Build Tools revision 27.0.3
- Add a warehouse in allprojects repositories and report an error
- Errorjava.lang.NullPointerException(no error message)
- Android Studio sync build.gradle appears: Failed to resolve: com.android.support:appcompat problem
- android studio Error Gradle project sync failed. Please fix your project and try again
- Failed to find target with hash string ‘android-25’ in:D:\SDK
- Import Android project Error:Internal error : org.gradle.tooling .BuildException: Could not execute build…
- Android Error | Failed to find target with hash string ”android-23′ in…
- [Solved] Android gradle Error: gradle project sync failed. Please fix your project and try again
- ERROR: Unsupported method: AndroidProject.getVariantNames().
- Error occurred during initialization of VM Could not reserve enough space for object heap
- Error in project operation org.springframework.beans . factory.BeanCreationException : error creating bean with name can be configured by
- Initialization of bean failed; nested exception is java.lang.StackOverflowError
- Execution failed for task ‘:app:stripDebugDebugSymbols‘.