1.Error: Invoke-customs are only supported starting with Android O (–min-api
在gradle.build中添加以下内容:
defaultConfig {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
2.Error: Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add ‘tools:replace=“android:appComponentFactory”’ to element at AndroidManifest.xml:15:2-101:16 to override.
<application
tools:replace="android:appComponentFactory"
android:appComponentFactory="任意字符"
3 Error: Program type already present: androidx.versionedparcelable.CustomVers
gradle.properties添加
android.useAndroidX=true
android.enableJetifier=true
4 ERROR: [TAG] Failed to resolve variable ‘animal.sniffer.version′ERROR:[TAG]Failedtoresolvevariable′{animal.sniffer.version}'ERROR: [TAG] Failed to resolve variable 'animal.sniffer.version
′
ERROR:[TAG]Failedtoresolvevariable
′
{junit.version}’
直接File->Invalidate Caches / restart,重启