Flutter Image_picker无法解析所有工件以进行配置 [英] Flutter Image_picker could not resolve all artifacts for configuration

查看:218
本文介绍了Flutter Image_picker无法解析所有工件以进行配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在pubspec.yaml文件中添加 image picker 包后.

after add image picker package in pubspec.yaml file.

我尝试运行Flutter应用程序,但运行失败.

I am try to run my flutter app but the run failed.

尝试运行flutter项目时遇到的错误:



    FAILURE: Build failed with an exception.
    * What went wrong:
    A problem occurred configuring project ':image_picker'.
    > Could not resolve all artifacts for configuration ':image_picker:classpath'.
       > Could not find crash.jar (com.android.tools.analytics-library:crash:26.3.0).
         Searched in the following locations:
             https://dl.google.com/dl/android/maven2/com/android/tools/analytics-library/crash/26.3.0/crash-26.3.0.jar
       > Could not find apkzlib.jar (com.android.tools.build:apkzlib:3.3.0).
         Searched in the following locations:
             https://dl.google.com/dl/android/maven2/com/android/tools/build/apkzlib/3.3.0/apkzlib-3.3.0.jar
       > Could not find apksig.jar (com.android.tools.build:apksig:3.3.0).
         Searched in the following locations:
             https://dl.google.com/dl/android/maven2/com/android/tools/build/apksig/3.3.0/apksig-3.3.0.jar
       > Could not find annotations.jar (com.android.tools:annotations:26.3.0).
         Searched in the following locations:
             https://dl.google.com/dl/android/maven2/com/android/tools/annotations/26.3.0/annotations-26.3.0.jar
       > Could not find databinding-common.jar (androidx.databinding:databinding-common:3.3.0).
         Searched in the following locations:
             https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-common/3.3.0/databinding-common-3.3.0.jar
       > Could not find baseLibrary.jar (com.android.databinding:baseLibrary:3.3.0).
         Searched in the following locations:
             https://dl.google.com/dl/android/maven2/com/android/databinding/baseLibrary/3.3.0/baseLibrary-3.3.0.jar
    > Failed to notify project evaluation listener.
       > Could not get unknown property 'android' for project ':image_picker' of type org.gradle.api.Project.
       > Could not find method implementation() for arguments [project ':flutter_plugin_android_lifecycle'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
    
    * 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 9s
    


pubspce.yaml依赖项:

    dependencies:
      flutter:
        sdk: flutter
      # adobe_xd: ^0.1.4
      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      cupertino_icons: ^0.1.2
      google_fonts_arabic: ^1.1.7
      scoped_model: ^1.0.1
      http: ^0.12.2
      shared_preferences: ^0.5.8
      flutter_svg: ^0.18.0
      image_picker: ^0.6.7+4


build.gradle内容:

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
     google()
    mavenCentral()
    jcenter()
    }

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

allprojects {
 repositories {
     google()
    mavenCentral()
    jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

推荐答案

1-检查是否已正确安装依赖项如果可以的话2-尝试重新启动应用程序如果不2-尝试安装Flutter SDK开发人员版本,而不是稳定版本

1-Check that dependencies installed well If ok 2-Try to redebuge the app If not 2-Try to install Flutter SDK developer version instead of stable

在终端3中执行此命令

flutter clean

清理旧版本.

第二次赞扬 flutter pub缓存修复

这篇关于Flutter Image_picker无法解析所有工件以进行配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆