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

Unable to build project on Flutter 2.10 #212

Closed
Chinmay-KB opened this issue Feb 11, 2022 · 0 comments · Fixed by #213
Closed

Unable to build project on Flutter 2.10 #212

Chinmay-KB opened this issue Feb 11, 2022 · 0 comments · Fixed by #213
Labels
type: bug Issues that need priority attention. Things which are obviously broken and are reported as such.

Comments

@Chinmay-KB
Copy link
Contributor

Describe the bug
Trying to build the project throws the following bug

Launching lib/main.dart on Nokia 5 4 in debug mode...
Warning: The plugin audio_service requires Android SDK version 31.
Warning: The plugin flutter_local_notifications requires Android SDK version 31.
Warning: The plugin flutter_plugin_android_lifecycle requires Android SDK version 31.
Warning: The plugin hexcolor requires Android SDK version 31.
Warning: The plugin image_picker requires Android SDK version 31.
Warning: The plugin integration_test requires Android SDK version 31.
Warning: The plugin path_provider_android requires Android SDK version 31.
Warning: The plugin shared_preferences_android requires Android SDK version 31.
Warning: The plugin url_launcher_android requires Android SDK version 31.
Warning: The plugin video_player_android requires Android SDK version 31.
Warning: The plugin webview_flutter_android requires Android SDK version 31.
One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to /Users/user/mobile/mobile-app/android/app/build.gradle:
android {
  compileSdkVersion 31
  ...
}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Multiple task action failures occurred:
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > The minCompileSdk (31) specified in a
        dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
        is greater than this module's compileSdkVersion (android-30).
        Dependency: androidx.window:window-java:1.0.0-beta04.
        AAR metadata file: /Users/user/.gradle/caches/transforms-2/files-2.1/625039eaad011f884ddd84f857a44b7f/jetified-window-java-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
      > The minCompileSdk (31) specified in a
        dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
        is greater than this module's compileSdkVersion (android-30).
        Dependency: androidx.window:window:1.0.0-beta04.
        AAR metadata file: /Users/user/.gradle/caches/transforms-2/files-2.1/a78fdf90e4c1f8464b19895cfb365f3f/jetified-window-1.0.0-beta04/META-INF/com/android/build/gradle/aar-metadata.properties.

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

Making the necessary change and building it again throws this issue

Launching lib/main.dart on Nokia 5 4 in debug mode...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Note: /Users/user/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fk_user_agent-2.1.0/android/src/main/java/io/flutterfastkit/fk_user_agent/FkUserAgentPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: /Users/user/.gradle/caches/transforms-2/files-2.1/06445d7ee3d674db365da5b7e383aeec/jetified-window-1.0.0-beta04-api.jar!/META-INF/window_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/user/.gradle/caches/transforms-2/files-2.1/185d46b6321985f52dcc07c04b9e0199/jetified-kotlin-stdlib-common-1.5.31.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.5.1, expected version is 1.1.15.
e: /Users/user/.gradle/caches/transforms-2/files-2.1/57fff25d753f492b2e9dfa8a7a25a127/jetified-kotlin-stdlib-jdk7-1.5.30.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.5.1, expected version is 1.1.15.
e: /Users/user/.gradle/caches/transforms-2/files-2.1/7ed1fc227d449123990dfe95b91bbf13/jetified-kotlin-stdlib-1.5.31.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/user/.gradle/caches/transforms-2/files-2.1/989d7c521cad3a1e2e82ee6a7a836f54/jetified-kotlinx-coroutines-android-1.5.2.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/user/.gradle/caches/transforms-2/files-2.1/9c675fcd73ec0913dfa5836b73d5959f/jetified-window-java-1.0.0-beta04-api.jar!/META-INF/window-java_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/user/.gradle/caches/transforms-2/files-2.1/cdd51607f1d98bcc689bce197d763afe/jetified-kotlin-stdlib-jdk8-1.5.30.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.5.1, expected version is 1.1.15.
e: /Users/user/.gradle/caches/transforms-2/files-2.1/ced2a85cd1d4e10ca7b42bb11579f9f7/jetified-kotlinx-coroutines-core-jvm-1.5.2.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: /Users/user/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/hexcolor-2.0.6/android/src/main/kotlin/com/ggichure/github/hexcolor/HexcolorPlugin.kt: (20, 5): 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/user/.gradle/caches/transforms-2/files-2.1/7ed1fc227d449123990dfe95b91bbf13/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
e: /Users/user/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/hexcolor-2.0.6/android/src/main/kotlin/com/ggichure/github/hexcolor/HexcolorPlugin.kt: (21, 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/user/.gradle/caches/transforms-2/files-2.1/7ed1fc227d449123990dfe95b91bbf13/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
e: /Users/user/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/hexcolor-2.0.6/android/src/main/kotlin/com/ggichure/github/hexcolor/HexcolorPlugin.kt: (25, 5): 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/user/.gradle/caches/transforms-2/files-2.1/7ed1fc227d449123990dfe95b91bbf13/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
e: /Users/user/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/hexcolor-2.0.6/android/src/main/kotlin/com/ggichure/github/hexcolor/HexcolorPlugin.kt: (26, 14): 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/user/.gradle/caches/transforms-2/files-2.1/7ed1fc227d449123990dfe95b91bbf13/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
e: /Users/user/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/hexcolor-2.0.6/android/src/main/kotlin/com/ggichure/github/hexcolor/HexcolorPlugin.kt: (28, 14): 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/user/.gradle/caches/transforms-2/files-2.1/7ed1fc227d449123990dfe95b91bbf13/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class
e: /Users/user/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/hexcolor-2.0.6/android/src/main/kotlin/com/ggichure/github/hexcolor/HexcolorPlugin.kt: (33, 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/user/.gradle/caches/transforms-2/files-2.1/7ed1fc227d449123990dfe95b91bbf13/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/Unit.class

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':hexcolor: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 28s
┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.                       │
│ Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then │
│ update /Users/user/mobile/mobile-app/android/build.gradle:                                   │
│ ext.kotlin_version = '<latest-version>'                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Changing kotlin version to 1.6.10 fixes this issue

To Reproduce
Steps to reproduce the behavior:

  1. run flutter upgrade to upgrade it to 2.10.
  2. Run flutter build

Smartphone (please complete the following information):

  • Device: Nokia 5.4
@Chinmay-KB Chinmay-KB added the type: bug Issues that need priority attention. Things which are obviously broken and are reported as such. label Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issues that need priority attention. Things which are obviously broken and are reported as such.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant