最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Android application building fails after upgrading bouncycastle from 1.76 to 1.78 - Stack Overflow

programmeradmin1浏览0评论

I'm working on an Android project that was using Bouncy Castle version 1.76, but after upgrading to 1.78.1, the project is no longer building. The project is running on OpenJDK 17. Has anyone encountered this issue before, or does anyone know what might be causing the build failure?

Here are the error logs:

Failed to transform bcprov-jdk18on-1.78.jar (.bouncycastle:bcprov-jdk18on:1.78) to match attributes {artifactType=android-jni, .gradle.category=library, .gradle.libraryelements=jar, .gradle.status=release, .gradle.usage=java-runtime}.
      > Execution failed for JetifyTransform: /Users/oluwaseun.oyewale/.gradle/caches/modules-2/files-2.1/.bouncycastle/bcprov-jdk18on/1.78/619aafb92dc0b4c6cc4cf86c487ca48ee2d67a8e/bcprov-jdk18on-1.78.jar.
         > Failed to transform '/Users/oluwaseun.oyewale/.gradle/caches/modules-2/files-2.1/.bouncycastle/bcprov-jdk18on/1.78/619aafb92dc0b4c6cc4cf86c487ca48ee2d67a8e/bcprov-jdk18on-1.78.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 65. (Run with --stacktrace for more details.)
           Suggestions:
            - Check out existing issues at :460323&s=modified_time:desc, it's possible that this issue has already been filed there.
            - If this issue has not been filed, please report it at  (run with --stacktrace and provide a stack trace if possible).

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .

The error log when i try to run the application

I'm working on an Android project that was using Bouncy Castle version 1.76, but after upgrading to 1.78.1, the project is no longer building. The project is running on OpenJDK 17. Has anyone encountered this issue before, or does anyone know what might be causing the build failure?

Here are the error logs:

Failed to transform bcprov-jdk18on-1.78.jar (.bouncycastle:bcprov-jdk18on:1.78) to match attributes {artifactType=android-jni, .gradle.category=library, .gradle.libraryelements=jar, .gradle.status=release, .gradle.usage=java-runtime}.
      > Execution failed for JetifyTransform: /Users/oluwaseun.oyewale/.gradle/caches/modules-2/files-2.1/.bouncycastle/bcprov-jdk18on/1.78/619aafb92dc0b4c6cc4cf86c487ca48ee2d67a8e/bcprov-jdk18on-1.78.jar.
         > Failed to transform '/Users/oluwaseun.oyewale/.gradle/caches/modules-2/files-2.1/.bouncycastle/bcprov-jdk18on/1.78/619aafb92dc0b4c6cc4cf86c487ca48ee2d67a8e/bcprov-jdk18on-1.78.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 65. (Run with --stacktrace for more details.)
           Suggestions:
            - Check out existing issues at https://issuetracker.google/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
            - If this issue has not been filed, please report it at https://issuetracker.google/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).

* Try:
> 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..

The error log when i try to run the application

Share Improve this question edited Mar 2 at 14:09 Robert 43k18 gold badges109 silver badges172 bronze badges Recognized by Mobile Development Collective asked Mar 2 at 2:13 Oluwaseun OyewaleOluwaseun Oyewale 2113 silver badges15 bronze badges 2
  • 1 Please include the stack trace in the question as formatted text rather than a link to an image of formatted text. – Dave Newton Commented Mar 2 at 9:32
  • "Unsupported class file major version 65" means the library requires Java 21, so may be your build environment is too old? What version of Android Studio, Gradle and Android Gradle Plugin do you use? See also stackoverflow/q/79083992/150978 – Robert Commented Mar 2 at 14:10
Add a comment  | 

1 Answer 1

Reset to default -1

The error indicates you are using a wrong Java version and you need to change it.

In order to fix this, you need to navigate inside Android Studio to:

Android Studio -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle

and there, you should see a way to configure the Gradle JDK version:

发布评论

评论列表(0)

  1. 暂无评论