后添加图像选择器
包在pubspec.yaml文件。
我试图运行我的flutter应用程序,但运行失败。
错误,我有当我试图运行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
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
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-尝试安装Flatter SDK开发人员版本,而不是稳定版本
3-在终端中执行此命令
flutter clean
清理旧建筑。
第二次推荐flatter发布缓存修复
我试图实现一个第三方的SDK捆绑包时,我运行我得到了以下错误: 任务“:app:checkDebugarMetadata”的执行失败。 无法解析配置“:app:debugRuntimeClasspath”的所有文件。 无法解析com。ts.auth-control-sdk:5.1.1。要求:项目:应用 sun.security.provider.certpath.SunCertPathBuilde
在1s内成功配置 调用mockable JAR工件转换来创建文件:C:\Users。。。gradle\caches\transforms-1\files-1.1\android。jar\637e2bccbff6bd0f7a7583f7e9d4551b\android。输入C:\Users的jar。。。\AppData\Local\Android\Sdk\platforms\Android-28\A
我正在开发的应用程序在模拟器或手机上调试良好,但当我尝试构建apk时,它出现以下错误: **无声音建筑零安全。有关更多信息,请参阅https://dart.dev/null-safety/unsound-null-safety 正在运行Gradle任务“AssemblerEase”。。。 失败:构建失败,但有一个异常。 < li >哪里出错:任务执行失败':app:lintVitalRelease
我遵循了这个问题中给出的答案,但没有解决我的问题
当试图同步Gradle时,我得到以下错误: 我已经找过了,我找不到答案。这里有一个类似的问题:React原生android找不到com.android.tools.build:gradle:3.6.3 看看上面,这建议关闭脱机模式,它不是打开的,所以,不幸的是,这不是答案。
我在为ZBarScannerActivityLib库项目从命令行执行gradle build时收到此错误。详细错误消息如下 *配置项目“:ZBARScannerActivityLib”时出现问题。