本文主要是介绍Android 报错:AGPBI:MethodHandle.invoke are only supported starting whit android O mini api 26,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Android 报错:AGPBI:MethodHandle.invoke are only supported starting whit android O mini api 26
- 错误
- 解决方案
- 搜索到的解决方案(无法解决)
- 最终解决方案
- 完事
错误
错误描述文本:
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 ‘protobuf-java-3.10.0.jar’ to match attributes {artifactType=android-dex, dexing-enable-desugaring=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.usage=java-runtime-jars}
Execution failed for DexingNoClasspathTransform: /Volumes/MyDoc/android_demo/rd_sdk/RDCloudSDK/rdcloudlibrary/libs/protobuf-java-3.10.0.jar.
Error while dexing.
Failed to transform file ‘protobuf-java-3.10.0.jar’ to match attributes {artifactType=android-dex, dexing-enable-desugaring=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.usage=java-runtime-jars}
Execution failed for DexingNoClasspathTransform: /Volumes/MyDoc/android_demo/rd_sdk/RDCloudSDK/rdcloudlibrary/libs/protobuf-java-3.10.0.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.4.1/userguide/command_line_interface.html#sec:command_line_warningsBUILD FAILED in 34s
解决方案
搜索到的解决方案(无法解决)
连接:@凤李坤_1129 Invoke-customs are only supported starting with Android O (–min-api 26) Message{kind=ERROR,……
方法:
在gradle.build中添加以下内容:
android {....compileOptions {sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility JavaVersion.VERSION_1_8}
}
最终解决方案
由于文本提示中,显示’protobuf-java-3.10.0.jar’中出现的错误,所以我将’protobuf-java-3.10.0.jar’升级为’protobuf-java-3.11.1.jar’
下载链接:https://download.jar-download.com/cache_jars/com.google.protobuf/protobuf-java/3.11.1/jar_files.zip
下载公开jar包的一个库网站供大家使用https://jar-download.com/maven-repository-class-search.php
完事
这篇关于Android 报错:AGPBI:MethodHandle.invoke are only supported starting whit android O mini api 26的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!