flutter 打包android报错

1.错误

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
> Could not resolve io.flutter:armeabi_v7a_debug:1.0.0-241c87ad800beeab545ab867354d4683d5bfb6ce.
Required by:
project :app
> Could not resolve io.flutter:armeabi_v7a_debug:1.0.0-241c87ad800beeab545ab867354d4683d5bfb6ce.
> Could not get resource 'https://dl.google.com/dl/android/maven2/io/flutter/armeabi_v7a_debug/1.0.0-241c87ad800beeab545ab867354d4683d5bfb6ce/armeabi_v7a_debug-1.0.0-241c87ad800beeab545ab867354d4683d5bfb6ce.pom'.

 

2. 解决

在 myapp\android\build.gradle 这个文件中,修改仓库地址

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
    }
}

 

posted @ 2021-08-16 14:28  随意的马蒂洛克  阅读(537)  评论(0编辑  收藏  举报