我用android studio 连接mysql数据库,用的是从maven上下载的JDBC包。但是点击运行后它提示:
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): com.mysql.cj.protocol.Message com.mysql.cj.interceptors.QueryInterceptor.postProcess(com.mysql.cj.protocol.Message, com.mysql.cj.protocol.Message)","sources":[{}],"tool":"D8"}
FAILURE: Build failed with an exception.
-
What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform file 'mysql-connector-java-8.0.11.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=15, org.gradle.usage=java-runtime-jars}
Execution failed for DexingTransform: D:\Anzhuo-SDK\android project\app\libs\mysql-connector-java-8.0.11.jar.
> Error while dexing.
Failed to transform file 'mysql-connector-java-8.0.11.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=15, org.gradle.usage=java-runtime-jars}
Execution failed for DexingTransform: D:\Anzhuo-SDK\android project\app\libs\mysql-connector-java-8.0.11.jar.
> Error while dexing. Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 19s
我想问一下,这是为什么?是因为JAR的版本问题吗?