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_8 targetCompatibility 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
完事
更多相关文章
- Unable to execute dex: Multiple dex files define解决方案
- android studio 导入 Launcher3 的一些问题
- 解决Error:Android(安卓)Dex: com.android.dex.DexIndexOverflow
- Android:关闭软键盘自动弹出的解决方案
- Eclipse中使用Ant打Android包报错及解决方案
- Android布局低级错误
- 编译android源码
- Android
- android常遇错误