fluttercommunity / plus_plugins

Flutter Community Plus Plugins
BSD 3-Clause "New" or "Revised" License
1.55k stars 937 forks source link

[Bug]: Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20. #3184

Open yogeshmarathe2012 opened 4 weeks ago

yogeshmarathe2012 commented 4 weeks ago

Platform

Android 14

Plugin

connectivity_plus

Version

6.0.3

Flutter SDK

3.24.0

Steps to reproduce

i upgraded the flutter to latest version then i ran the project and project will reproduce the same error.

Code Sample

Future<bool> hasNetwork() async {

  final List<ConnectivityResult> connectivityResult =
      await (Connectivity().checkConnectivity());
  if (connectivityResult.contains(ConnectivityResult.mobile)) {
    return true;
  } else if (connectivityResult.contains(ConnectivityResult.wifi)) {
    return true;
  } else if (connectivityResult.contains(ConnectivityResult.none)) {
    return false;
  }
  return false;
}

Logs

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

Invalid depfile: C:\Users\.dart_tool\flutter_build\012add4e11820bf67ac5ecd7d8528369\kernel_snapshot_program.d
Invalid depfile: C:\Users\.dart_tool\flutter_build\012add4e11820bf67ac5ecd7d8528369\kernel_snapshot_program.d
Invalid depfile: C:\Users\.dart_tool\flutter_build\012add4e11820bf67ac5ecd7d8528369\kernel_snapshot_program.d
Invalid depfile: C:\Users\.dart_tool\flutter_build\012add4e11820bf67ac5ecd7d8528369\kernel_snapshot_program.d

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':connectivity_plus:generateDebugRFile'.
> Could not resolve all files for configuration ':connectivity_plus:debugCompileClasspath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20.
     Required by:
         project :connectivity_plus > org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error

* 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 2m 38s
Error: Gradle task assembleDebug failed with exit code 1

Flutter Doctor

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.0, on Microsoft Windows [Version 10.0.22631.4037], locale en-US)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✗] Visual Studio - develop Windows apps
    ✗ Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.92.0)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 2 categories.

Checklist before submitting a bug

sudo-ulmas commented 3 weeks ago

When running ./gradlew build

Task :connectivity_plus:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

miquelbeltran commented 3 weeks ago

The ticket is missing the complete flutter doctor -v report. flutter doctor is not enough, you have to run it with the -v option.

miquelbeltran commented 3 weeks ago

This doesn't look like a plugin bug but a configuration issue in your project.

Searching for Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20. suggests for the following solution: https://stackoverflow.com/a/57025919

You can also paste here your gradle files maybe someone can spot an issue in them.