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:
- How to Fix com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
- As Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- Android Studio sync build.gradle appears: Failed to resolve: com.android.support:appcompat problem
- Android Studio | Failed to find target with hash string ‘android-26’ in: D:\Android\sdk
- android Caused by: java.util.ConcurrentModificationException
- Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibat
- Caused by: java.lang.ClassNotFoundException: com.alibaba.nacos.api.naming.NamingMaintainService
- About Android studio error: (26,13) failed to resolve: com.android.support : appcompat-v7:27. + error
- Failed to find target with hash string ‘android-25’ in:D:\SDK
- Failed to find target with hash string”android-21″ in:D:\AndroidVersionSdk
- Failed to read artifact descriptor for com.google.errorprone:javac:jar:9+181-r4173-1
- How to select the jar package version for Maven package when the jar package versions referenced by multiple modules are inconsistent
- Caused by: java.net.SocketException : connection reset or caused by: java.sql.SQLRecoverableException solve
- Failed to resolve: com.android.support:appcompat-v7:25.3.0
- [unity] Android package error java.lang.ClassNotFoundException Did not find class com.unity3d . player.MainActivity
- Failed to resolve: com.android.support:appcompat-v7:27.
- Default interface methods are only supported starting with Android N (–min-api 24): com.XXXX
- Error: Error parsing D:\new_android\Android SDK\system-images\android-25\android-wear\armeabi-v7a\de
- Android studio failed to resolve: com.github.CymChad :BaseRecyclerViewAdap terHelper:2.9.46