Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for task ':flutter_nearby_connections:compileReleaseKotlin'. > Compilation error. See log for more details #22

Open
Akshay-akkay opened this issue Jul 30, 2021 · 1 comment

Comments

@Akshay-akkay
Copy link

flutter run gives this

`e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/NearbyService.kt: (97, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/NearbyService.kt: (98, 27): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/NearbyService.kt: (107, 71): Unresolved reference: java
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/NearbyService.kt: (108, 21): Unresolved reference: createNotificationChannel
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (24, 71): Unresolved reference: java
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (30, 13): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (31, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (32, 23): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (33, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (38, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (39, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (44, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (45, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (50, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (51, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (58, 17): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (65, 25): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (66, 25): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (69, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (71, 19): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class
e: /Users/akkay/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_nearby_connections-1.1.1/android/src/main/kotlin/com/nankai/flutter_nearby_connections/ServiceBindManager.kt: (72, 19): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
The class is loaded from /Users/akkay/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/kotlin/Unit.class

FAILURE: Build failed with an exception.

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

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 20s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
`

@malloy045
Copy link

malloy045 commented Aug 20, 2021

I solved this by upgrading Kotlin via Android Studio and making sure the new version matched ext.kotlin_version in build.gradle in my flutter project. In my case, I upgraded to 1.4.32:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants