Skip to content

[google_sign_in]: source release 1.8 requires target release 1.8 error with older AGP/Gradle versions #125482

Closed
flutter/packages
#3825

Description

@MohamedSafvanKP-MSIL

Is there an existing issue for this?

Steps to reproduce

  1. take the latest google_sign_in: ^6.1.0 pub upgrade
  2. it will point to google_sign_in_android: ^6.1.11
  3. and run the application.

note: it is working with google_sign_in_android: 6.1.9
issue facing from the latest version.

Expected results

The build should run as google_sign_in_android: 6.1.9 version.

Actual results

Execution failed for task ':google_sign_in_android:compileReleaseJavaWithJavac'.

warning: source release 1.8 requires target release 1.8

Build got failed.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':google_sign_in_android:compileReleaseJavaWithJavac'.
> warning: source release 1.8 requires target release 1.8

in android build.gradle using same java versions.

        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.7.8, on macOS 13.2 22D49 darwin-arm64, locale en-IN)
    • Flutter version 3.7.8 on channel stable at /Users/mohmedsafvankp/flutter_sdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 90c64ed42b (5 weeks ago), 2023-03-21 11:27:08 -0500
    • Engine revision 9aa7816315
    • Dart version 2.19.5
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/mohmedsafvankp/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2022.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 11.0.15+0-b2043.56-8887301)

[✓] IntelliJ IDEA Community Edition (version 2023.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

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

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 12 (API 31) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 13.2 22D49 darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 112.0.5615.137

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Activity

  1. added
    c: regressionIt was better in the past than it is now
    platform-androidAndroid applications specifically
    packageflutter/packages repository. See also p: labels.
    P1High-priority issues at the top of the work list
    on Apr 25, 2023
  2. stuartmorgan-g commented on Apr 25, 2023

    @stuartmorgan-g
    Contributor

    Interesting; I didn't include an explicit targetCompatibility because current docs say it defaults to the value of sourceCompatibility. It sounds like that wasn't always the case, so I'll add it in.

    What version of the Android Gradle Plugin and of Gradle are you using in your project?

  3. caua-n commented on Apr 25, 2023

    @caua-n

    I have the same issue, cant debug and cant compile. Nothing
    image

  4. stuartmorgan-g commented on Apr 25, 2023

    @stuartmorgan-g
    Contributor

    I have the same issue

    What version of the Android Gradle Plugin and of Gradle are you using in your project?

  5. MohamedSafvanKP-MSIL commented on Apr 25, 2023

    @MohamedSafvanKP-MSIL
    Author

    @stuartmorgan kindly find my grade version details:
    classpath 'com.android.tools.build:gradle:4.1.1'
    and
    https://services.gradle.org/distributions/gradle-6.5-all.zip

  6. changed the title [-]Recent google_sign_in_android: ^6.1.11 having issue while generating android build related to java version.[/-] [+][google_sign_in]: `source release 1.8 requires target release 1.8` error with older AGP/Gradle versions[/+] on Apr 25, 2023
  7. EwanZaidi commented on Apr 26, 2023

    @EwanZaidi

    Same issue with me, how can I fix it? Need to deploy to play store immediately

  8. stuartmorgan-g commented on Apr 26, 2023

    @stuartmorgan-g
    Contributor

    If you need an immediate workaround, you can pin an earlier version of google_sign_in_android, as noted in the original report. Alternately, I expect that updating the version of AGP and Gradle used in your project would resolve the issue.

  9. caua-n commented on Apr 26, 2023

    @caua-n

    I have the same issue

    What version of the Android Gradle Plugin and of Gradle are you using in your project?

    classpath 'com.android.tools.build:gradle:4.1.0'

  10. MohamedSafvanKP-MSIL commented on Apr 27, 2023

    @MohamedSafvanKP-MSIL
    Author
  11. donaldamadi commented on Apr 28, 2023

    @donaldamadi

    https://services.gradle.org/distributions

    I have the same issue

    What version of the Android Gradle Plugin and of Gradle are you using in your project?

    classpath 'com.android.tools.build:gradle:4.1.0'

    For a quick workaround, changing my AGP to classpath 'com.android.tools.build:gradle:4.2.0' did the trick for me

  12. github-actions commented on May 12, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  13. locked as resolved and limited conversation to collaborators on May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listc: regressionIt was better in the past than it is nowp: google_sign_inThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specifically

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions