2

I try to add connectivity to my Flutter project, my main goal is to support Android first. When I add ssh2 package I get error. Steps I follow:

  1. flutter pub add ssh2 for which output is: Changed 3 dependencies!
  2. flutter pub get
  3. Push 'play' button the output is:

FAILURE: Build failed with an exception Execution failed for task ':ssh2:compileDebugJavaWithJavac'. Could not resolve all files for configuration ':ssh2:debugCompileClasspath'. Failed to transform bcprov-jdk15on-1.69.jar (org.bouncycastle:bcprov-jdk15on:1.69) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}. Execution failed for JetifyTransform: C:\Users\mkaczmarczyk.gradle\caches\modules-2\files-2.1\org.bouncycastle\bcprov-jdk15on\1.69\91e1628251cf3ca90093ce9d0fe67e5b7dab3850\bcprov-jdk15on-1.69.jar. Failed to transform 'C:\Users\mkaczmarczyk.gradle\caches\modules-2\files-2.1\org.bouncycastle\bcprov-jdk15on\1.69\91e1628251cf3ca90093ce9d0fe67e5b7dab3850\bcprov-jdk15on-1.69.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace for more details.)

I tried everything proposed in https://www.geeksforgeeks.org/fix-execution-failed-for-task-appcompiledebugjavawithjavac-in-android-studio/ as well as "Invalidate Caches/ Restart" and similar.

When I try to run example from package's author I do it successfully up to version 1.6. With higher releases I get the same error.

Curious
  • 23
  • 3

1 Answers1

0

Had the same error, this was helping:

Flutter ssh2 2.2.3 package build errors (ssh2:compileDebugJavaWithJavac)

You need to update to gradle 7.0.2

Psylar
  • 1