Android Studio编译错误总结

2021-01-15  本文已影响0人  岩巴上的枯松

Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:processMainDebugManifest'.
Caused by: java.lang.IllegalStateException: Duplicate key BuildableArtifactImpl (file collection)

解决方法:将打包渠道配置中的main修改为其他名称。


image.png

Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'com.github.dcendents.android-maven' not found.
Caused by: java.lang.IllegalStateException: compileSdkVersion is not specified.

解决方法:在项目下的build.gradle中dependenceies添加:
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

Error: Invoke-customs are only supported starting with Android O (--min-api 26) 或
Error:Default interface methods are only supported starting with Android N (--min-api 24)
解决方法:在app下build.gradle的defaultConfig下加入配置:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}


image.png
上一篇下一篇

猜你喜欢

热点阅读