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_warnings

BUILD 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

完事

更多相关文章

  1. Unable to execute dex: Multiple dex files define解决方案
  2. android studio 导入 Launcher3 的一些问题
  3. 解决Error:Android(安卓)Dex: com.android.dex.DexIndexOverflow
  4. Android:关闭软键盘自动弹出的解决方案
  5. Eclipse中使用Ant打Android包报错及解决方案
  6. Android布局低级错误
  7. 编译android源码
  8. Android
  9. android常遇错误

随机推荐

  1. 疑难杂症
  2. 运行android程序访问网络,出错,需要加上权
  3. android 命名规范(阿里开发手册)
  4. 关于android中PendingIntent.getBroadcas
  5. Task和Activity相关的一些属性
  6. Android(安卓)如何分析解决Android(安卓)
  7. 在Android的webview中定制js的alert,conf
  8. Android应用程序避免Context相关的内存泄
  9. Android中activity之间如何传递Hashmap数
  10. Android自定义控件:Android(安卓)L控件点