简体   繁体   English

当我尝试在 Android 移动设备或模拟器中运行时,我的 Flutter 应用程序显示错误

[英]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.

相关问题 当我尝试运行旧的android项目时,在android studio中显示安装生成工具25.0.3错误 - Install build tools 25.0.3 error showing in android studio when i tried to run my old android project 为什么在模拟器中运行我的Android应用程序时会停止? - Why my android application stopped when I run it in Emulator? Android应用程序可在模拟器上完美运行,但在我自己的手机上崩溃 - Android Application run perfectly on emulator but crash on my own mobile 我无法在真实设备以及 android studio 中的模拟器中运行我的颤振应用程序 - i am unable to run my flutter application in real device as well as emulator in android studio 当我尝试在 vs 代码中运行我的 flutter 时,它在调试控制台中给出了这个错误 - when I've tried to run my flutter in vs code it gave this error in debug console PHP URL在浏览器上正常工作,但是当我尝试从我的android应用程序运行它时InputStream为null - PHP URL is working on broswer but when i tried to run it from my android application InputStream is null 当我尝试在AVD上运行时,我的Android工作灯测试应用程序意外停止了吗? - my test application of worklight for android stopped unexpectedly when i tried to run that on AVD? 我安装了最新的Android Studio 3.4.2,并在尝试运行基本应用程序时显示了这些错误 - I installed Android studio 3.4.2 latest available and when I tried to run basic application it shows these error 我的应用程序没有出现在模拟器中(尝试了stackoverflow上的所有解决方案) - my application is not showing up in the emulator (tried all the solutions on stackoverflow) 当我尝试运行时,我的 Flutter 应用程序没有出现在模拟器中 - My Flutter app doesnt appear in the emulator when I try to run it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM