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

flutter_contacts plugin is preventing the host app from upgrading into AGP 8.2.2 #147

Closed
Hirohumi opened this issue Feb 18, 2024 · 3 comments
Labels
version conflict Version conflict with gradle, kotlin, other packages, etc.

Comments

@Hirohumi
Copy link

After upgrading the Android Gradle Plugin of the host app to version 8.2.2, flutter run fails with following messages:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_contacts:compileDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain


* 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 4s

The build environment is

[✓] Flutter (Channel stable, 3.19.0, on macOS 12.7.3 21H1015 darwin-x64, locale en-CN)
• Flutter version 3.19.0 on channel stable at /Volumes/Lenovo/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision bae5e49bc2 (4 days ago), 2024-02-13 17:46:18 -0800
• Engine revision 04817c99c9
• Dart version 3.3.0
• DevTools version 2.31.1
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Volumes/Lenovo/Library/Android/sdk
• Platform android-34-ext8, build-tools 34.0.0
• ANDROID_HOME = /Volumes/Lenovo/Library/Android/sdk
• ANDROID_SDK_ROOT = /Volumes/Lenovo/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Volumes/Lenovo/Applications/Xcode14.2/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.13.0

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.86.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.82.0

[✓] Connected device (3 available)
• ScarletWitch (mobile) • ASCARLH001LC1500328 • android-arm64 • Android 11 (API 30)
• macOS (desktop) • macos • darwin-x64 • macOS 12.7.3 21H1015 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 121.0.6167.139

[✓] Network resources
• All expected network resources are available.

Proposed solution:

Add

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }
}

to android/build.gradle so compileDebugKotlin task will select java 1.8 as its target.

@joachim-quis
Copy link
Contributor

@Hirohumi can you please try again with version 1.1.8?

@Dhana-Krishnasamy
Copy link

I still see the same error with version 1.1.8

@joachim-quis
Copy link
Contributor

Hi all - thanks for your patience and the recommended solutions.

This should be fixed in version 1.1.9. If it is not, please let me know, and reopen this conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version conflict Version conflict with gradle, kotlin, other packages, etc.
Projects
None yet
Development

No branches or pull requests

3 participants