flutter报错:Could not find com.meituan.android.walle:plugin

发布于:2025-03-21 ⋅ 阅读:(15) ⋅ 点赞:(0)

整体报错情况(解决美团渠道包源拉不下来的问题):

A problem occurred configuring root project 'android'.

> Could not resolve all files for configuration ':classpath'.

> Could not find com.meituan.android.walle:plugin:1.1.7.

Searched in the following locations:

- https://maven.aliyun.com/repository/google/com/meituan/android/walle/plugin/1.1.7/plugin-1.1.7.pom

- https://dl.google.com/dl/android/maven2/com/meituan/android/walle/plugin/1.1.7/plugin-1.1.7.pom

- https://jcenter.bintray.com/com/meituan/android/walle/plugin/1.1.7/plugin-1.1.7.pom

- https://repo.maven.apache.org/maven2/com/meituan/android/walle/plugin/1.1.7/plugin-1.1.7.pom

- https://developer.huawei.com/repo/com/meituan/android/walle/plugin/1.1.7/plugin-1.1.7.pom

Required by:

project :

* 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 4s

Error: Gradle task assembleDebug failed with exit code 1

解决:

1. 找到Android/build.gradle 路径下,调整maven,google,jcenter 等先后顺序,直到适合项目的资源加载文件能够成功

2. 参考事例:

原本:

buildscript {

ext.kotlin_version = '1.8.0'

repositories {

maven {

url 'https://maven.aliyun.com/repository/google'

}

google()

jcenter()

mavenCentral()

maven {url 'https://developer.huawei.com/repo/'}

}

dependencies {

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

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

classpath 'com.meituan.android.walle:plugin:1.1.7'

classpath 'com.huawei.agconnect:agcp:1.6.0.300'

}

}

allprojects {

repositories {

maven {

url 'https://maven.aliyun.com/repository/google'

}

google()

jcenter()

mavenCentral()

maven { url 'https://jitpack.io' }

maven {url 'https://developer.huawei.com/repo/'}

}

}

修改后:

buildscript {

    ext.kotlin_version = '1.8.0'

    repositories {

        mavenCentral()

        google()

       maven {

           url 'https://maven.aliyun.com/repository/jcenter'

       }

       maven {

           url 'https://maven.google.com/'

       }

        maven {

            url 'https://maven.aliyun.com/repository/google'

        }

        maven {url 'https://developer.huawei.com/repo/'}

    }

    dependencies {

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

        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        classpath 'com.meituan.android.walle:plugin:1.1.7'

        classpath 'com.huawei.agconnect:agcp:1.6.0.300'

    }

}

allprojects {

    repositories {

        google()

        mavenCentral()

       maven {

           url 'https://maven.aliyun.com/repository/jcenter'

       }

       maven {

           url 'https://maven.google.com/'

       }

        maven {

            url 'https://maven.aliyun.com/repository/google'

        }

        maven { url 'https://jitpack.io' }

        maven {url 'https://developer.huawei.com/repo/'}

    }

}

至此,祝您成功!