cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
540 stars 649 forks source link

App Usage: Requires a newer version of the Kotlin Gradle plugin #506

Open magicmass opened 2 years ago

magicmass commented 2 years ago

@thomasnilsson

Device / Emulator and OS

e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors. 
e: /Users/rootuser/development/flutter/.pub-cache/hosted/pub.dartlang.org/app_usage-2.0.0/android/src/main/kotlin/dk/cachet/app_usage/AppUsagePlugin.kt: (28, 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.

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/rootuser/Documents/GitHub/toni/android/build.gradle:              │
│ ext.kotlin_version = '<latest-version>'                                  │
└──────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1

Describe the bug

In my android build.gradle file I have changed my compile SDK to 31 and my target SDK to 31 but I'm still receiving this error.

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.1, on macOS 12.3 21E5222a darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code
        that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] IntelliJ IDEA Community Edition (version 2021.3.1)
[✓] VS Code (version 1.64.2)
[✓] Connected device (2 available)
    ! Device emulator-5554 is offline.
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

arunSriramulaWYH commented 2 months ago

@magicmass Did you find any solution for this? I'm facing the same problem and have tried many solutions but nothing worked.

jeanlucthumm commented 1 month ago

Also still having this issue