Search code examples
flutterdartmobile-application

getting an error while run flutter application (project :app > project :flutter_logs)


i'm getting the following error when trying to run a flutter app

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.github.umair13adil:RxLogs:1.0.20.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/github/umair13adil/RxLogs/1.0.20/RxLogs-1.0.20.pom
       - https://jcenter.bintray.com/com/github/umair13adil/RxLogs/1.0.20/RxLogs-1.0.20.pom
       - https://repo.maven.apache.org/maven2/com/github/umair13adil/RxLogs/1.0.20/RxLogs-1.0.20.pom
       - https://storage.googleapis.com/download.flutter.io/com/github/umair13adil/RxLogs/1.0.20/RxLogs-1.0.20.pom
       - https://jitpack.io/com/github/umair13adil/RxLogs/1.0.20/RxLogs-1.0.20.pom
     Required by:
         project :app > project :flutter_logs

I have tried

  1. delete pubspec.lock file,

  2. run flutter clean,

  3. run flutter pub get.

  4. Changed the version to classpath 'com.google.gms:google-services:4.3.8' in android/buildgradle


Solution

  • Some things you can do:

    • Double-check pubspec.yaml file for RxLogs. It might be a typo or incorrect.

    • Update Dependency Version

    • Manual Installation:

    If the RxLogs package is not available on pub.dev, you might need to manually install it. This involves adding the repository URL and dependency information to your build.gradle file:

    repositories {
      mavenCentral()
      // Add the repository URL for RxLogs here if it's not on pub.dev
    }
    
    dependencies {
      implementation 'com.github.umair13adil:RxLogs://The_version'
    }
    

    • Update JitPack Repository:

    If you’re using JitPack to resolve the dependency, ensure that the jitpack.io repository is added to your build.gradle file under the repositories section. In your android/build.gradle (project-level):

    allprojects {
        repositories {
            google()
            mavenCentral()
            maven { url 'https://jitpack.io' }
        }
    }
    

    Hope that helps