[英]My Flutter Application is showing error when i tried to run in android mobile or an emulator
This is Error这是错误
Every flutter project show this kind of error when i tried to launch in emulator but it gets run in chrome.当我尝试在模拟器中启动但它在 chrome 中运行时,每个 flutter 项目都会显示这种错误。 I tried to change different dependencies but do not work it only shows this error again and again
我尝试更改不同的依赖项但不起作用它只会一次又一次地显示此错误
Launching lib\main.dart on RMX3511 in debug mode...
[Fatal Error] guava-28.1-jre.pom:2:1: Content is not allowed in prolog.
[Fatal Error] gson-2.8.5.pom:2:1: Content is not allowed in prolog.
[Fatal Error] jsr305-1.3.9.pom:2:1: Content is not allowed in prolog.
FAILURE: Build failed with an exception.
* Where:
Build file 'E:\flutter\flutter\final project\downwork\android\app\build.gradle' line: 26
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
> Could not resolve com.google.guava:guava:28.1-jre.
This is my build.grade file这是我的 build.grade 文件
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Try replace all:尝试全部替换:
repositories {
google()
mavenCentral()
}
to:到:
repositories {
mavenCentral()
google()
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.