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

Kotlin version errors #145

Closed
Voklen opened this issue Sep 8, 2023 · 2 comments
Closed

Kotlin version errors #145

Voklen opened this issue Sep 8, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Voklen
Copy link
Contributor

Voklen commented Sep 8, 2023

Describe the bug
Flutter throws errors when building a project with this plugin, interestingly it still builds the apk even though the errors are thrown.

To Reproduce

flutter create flutter_test_app
cd flutter_test_app
flutter pub add shared_storage
# Change Kotlin version in android/build.gradle to 1.8.10 (or 1.8.0 or 1.9.0, the same thing happens)
flutter build apk

Expected behavior
No build errors

Actual behavior

Flutter build output
e: /home/sasha/programming/flutter/flutter_test_app/build/shared_storage/.transforms/074fd4077a52b6db7055abd875a5f8b6/transformed/out/jars/classes.jar!/META-INF/shared_storage_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /home/sasha/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.21/43d50ab85bc7587adfe3dda3dbe579e5f8d51265/kotlin-stdlib-1.8.21.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.8.0, expected version is 1.6.0.
e: /home/sasha/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.21/43d50ab85bc7587adfe3dda3dbe579e5f8d51265/kotlin-stdlib-1.8.21.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /home/sasha/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.21/43d50ab85bc7587adfe3dda3dbe579e5f8d51265/kotlin-stdlib-1.8.21.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.8.0, expected version is 1.6.0.
e: /home/sasha/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.21/d749cd5ae25da36d06e5028785038e24f9d37976/kotlin-stdlib-common-1.8.21.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.8.0, expected version is 1.6.0.
Running Gradle task 'assembleRelease'...                          116.1s
✓  Built build/app/outputs/flutter-apk/app-release.apk (18.7MB).

Version information

Flutter doctor
[✓] Flutter (Channel stable, 3.13.3, on Arch Linux 6.4.12-arch1-1, locale en_GB.UTF-8)
  • Flutter version 3.13.3 on channel stable at /home/sasha/programs/flutter
  • Upstream repository https://github.com/flutter/flutter.git
  • Framework revision 2524052335 (2 days ago), 2023-09-06 14:32:31 -0700
  • Engine revision b8d35810e9
  • Dart version 3.1.1
  • DevTools version 2.25.0
@Voklen Voklen added the bug Something isn't working label Sep 8, 2023
@alexcmgit
Copy link
Owner

alexcmgit commented Sep 8, 2023

Does the built apk works when running in a real/emulated device?

Also, seems your project is using gradle 1.6.0 and this project is using gradle 1.8.0, see if #141 works for you.

Make sure gradle cache is clear before building when gradle version is set to 1.8: https://stackoverflow.com/questions/75260986/the-binary-version-of-its-metadata-is-1-8-0-expected-version-is-1-6-0

@Voklen
Copy link
Contributor Author

Voklen commented Sep 8, 2023

Now it works perfectly, I can't believe I saw the first line with the

e: /home/sasha/programming/flutter/flutter_test_app/build/shared_storage/...

but not the next which pointed to the problem being the gradle cache

e: /home/sasha/.gradle/caches/...

Anyway, thank you for the quick response, I love the project and it's been essential in making Daily Diary

@Voklen Voklen closed this as completed Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants