http_certificate_pinning icon indicating copy to clipboard operation
http_certificate_pinning copied to clipboard

with new kotlin version not working

Open yogeshmarathe2012 opened this issue 1 year ago • 1 comments

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode... Running Gradle task 'assembleDebug'... e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors e: C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: C:/Users/.gradle/caches/transforms-3/c321e7444a5c731da2398570d6ef04f1/transformed/jetified-kotlin-stdlib-common-1.9.0.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (34, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (35, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (39, 6): Class 'kotlin.jvm.JvmStatic' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/jvm/JvmStatic.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (42, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (48, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (54, 7): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (55, 43): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (56, 11): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (58, 24): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (62, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (68, 20): Unresolved reference: HashMap e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (68, 61): Unresolved reference: HashMap e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (78, 18): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (82, 18): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (87, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (91, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (95, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (99, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (107, 32): Unresolved reference: map e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (107, 38): Cannot infer a type for this parameter. Please specify it explicitly. e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (107, 75): Unresolved reference: toRegex e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (110, 4): Class 'kotlin.jvm.Throws' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/jvm/Throws.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (116, 18): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (117, 20): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (117, 28): Type mismatch: inferred type is (String) -> Unit but (String, String) -> Unit was expected e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (117, 30): Expected 2 parameters of types String, String e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (117, 31): Destructuring declaration initializer of type String must have a 'component1()' function e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (117, 36): Destructuring declaration initializer of type String must have a 'component2()' function e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (117, 57): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (119, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. The class is loaded from C:/Users/.gradle/caches/transforms-3/431ce31617111116ed092b20fb775fda/transformed/jetified-kotlin-stdlib-1.9.0.jar!/kotlin/Unit.class e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (129, 20): Unresolved reference: map e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (129, 33): Unresolved reference: format e: C:\Users\AppData\Local\Pub\Cache\hosted\pub.dev\http_certificate_pinning-2.1.3\android\src\main\kotlin\diefferson\http_certificate_pinning\HttpCertificatePinningPlugin.kt: (129, 48): Unresolved reference: it

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':http_certificate_pinning:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction Compilation error. See log for more details

  • 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

BUILD FAILED in 49s

┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────┐ │ [!] Your project requires a newer version of the Kotlin Gradle plugin. │ │ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │ │ update the │ │ version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins block of │ │ android\settings.gradle. │ │ │ │ Alternatively (if your project was created before Flutter 3.19), update │ │ android\build.gradle │ │ ext.kotlin_version = '' │ └──────────────────────────────────────────────────────────────────────────────────────────────┘ Error: Gradle task assembleDebug failed with exit code 1

yogeshmarathe2012 avatar Jul 23 '24 12:07 yogeshmarathe2012

Same issue is occuring in my case. However, if I update the Kotlin version in plugins' gradle file, then it runs successfully. But it still gives the same error mentioned in this issue #55.

nachiket-gohil avatar Sep 02 '24 06:09 nachiket-gohil

Hey Guys, there is a new version, could you check is this still happening in the version 3.0.0?

diefferson avatar Feb 26 '25 19:02 diefferson

For me, it's happening another error in version 3.0.0:

.pub-cache/hosted/pub.dev/http_certificate_pinning-3.0.0/android/src/main/kotlin/diefferson/http_certificate_pinning/HttpCertificatePinningPlugin.kt:99:47 'fun String.toUpperCase(): String' is deprecated. Use uppercase() instead.

I upgraded to Kotlin 2+ and AGP 8.11.1

android/settings.gradle:

id "com.android.application" version '8.9.0' apply false
id "org.jetbrains.kotlin.android" version "2.1.10" apply false

android/gradle/wrapper/gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip

DouglasOGarrido avatar Mar 05 '25 17:03 DouglasOGarrido

For me, it's happening another error in version 3.0.0:

.pub-cache/hosted/pub.dev/http_certificate_pinning-3.0.0/android/src/main/kotlin/diefferson/http_certificate_pinning/HttpCertificatePinningPlugin.kt:99:47 'fun String.toUpperCase(): String' is deprecated. Use uppercase() instead.

I upgraded to Kotlin 2+ and AGP 8.11.1

android/settings.gradle:

id "com.android.application" version '8.9.0' apply false
id "org.jetbrains.kotlin.android" version "2.1.10" apply false

android/gradle/wrapper/gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip

quick fix is to change toUpperCase to uppercase on mentioned line. However i have created a separate issue for this 77

avinashk369 avatar Mar 07 '25 07:03 avinashk369

Fixed on version 3.0.1.

diefferson avatar Mar 17 '25 16:03 diefferson