当前位置: 首页 > news >正文

简记一个错误

简记一个Flutter错误:

Using hardware rendering with device sdk gphone64 x86 64. If you notice graphics artifacts, consider enabling software
rendering with “–enable-software-rendering”.
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode…
WARNING: [Processor] Library ‘C:\Users\jcstudio.gradle\caches\modules-2\files-2.1\androidx.media2\media2-session\1.2.1\f927563711e36371c19b2e86fb7ccf1c3f259ca4\media2-session-1.2.1.aar’ contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway.
Example of androidX reference: ‘androidx/media2/session/MediaBrowser B u i l d e r ′ E x a m p l e o f s u p p o r t l i b r a r y r e f e r e n c e : ′ a n d r o i d / s u p p o r t / v 4 / m e d i a / s e s s i o n / M e d i a S e s s i o n C o m p a t Builder' Example of support library reference: 'android/support/v4/media/session/MediaSessionCompat BuilderExampleofsupportlibraryreference:android/support/v4/media/session/MediaSessionCompatToken’

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:fluttertoast:compileDebugKotlin’.

Error while evaluating property ‘filteredArgumentsMap’ of task ‘:fluttertoast:compileDebugKotlin’
Could not resolve all files for configuration ‘:fluttertoast:debugCompileClasspath’.
Failed to transform kotlin-stdlib-1.7.0.jar (org.jetbrains.kotlin:kotlin-stdlib:1.7.0) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
Could not download kotlin-stdlib-1.7.0.jar (org.jetbrains.kotlin:kotlin-stdlib:1.7.0)
Could not get resource ‘https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.7.0/kotlin-stdlib-1.7.0.jar’.
Could not GET ‘https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.7.0/kotlin-stdlib-1.7.0.jar’.
Read timed out
Failed to transform kotlin-stdlib-common-1.7.0.jar (org.jetbrains.kotlin:kotlin-stdlib-common:1.7.0) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
Could not download kotlin-stdlib-common-1.7.0.jar (org.jetbrains.kotlin:kotlin-stdlib-common:1.7.0)
Could not get resource ‘https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.7.0/kotlin-stdlib-common-1.7.0.jar’.
Could not GET ‘https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.7.0/kotlin-stdlib-common-1.7.0.jar’.
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/146.75.112.215] failed: Read timed out

  • 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 2m 14s
Running Gradle task ‘assembleDebug’… 134.8s
[!] Gradle threw an error while downloading artifacts from the network.
Retrying Gradle Build: #1, wait time: 100ms

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:audio_session:compileDebugJavaWithJavac’.

Could not resolve all files for configuration ‘:audio_session:debugCompileClasspath’.
Failed to transform listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
Could not download listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)
Could not get resource ‘https://repo.maven.apache.org/maven2/com/google/guava/listenablefuture/1.0/listenablefuture-1.0.jar’.
Could not GET ‘https://repo.maven.apache.org/maven2/com/google/guava/listenablefuture/1.0/listenablefuture-1.0.jar’.
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/146.75.112.215] failed: Connection timed out: no further information

  • 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 1m 10s
Running Gradle task ‘assembleDebug’… 70.8s
[!] Gradle threw an error while downloading artifacts from the network.
Exception: Gradle task assembleDebug failed with exit code 1


这个错误主要问题是Gradle在构建应用程序时无法下载所需的依赖项。这可能是由于网络问题或依赖项的版本不一致引起的。可以尝试以下几种方法来解决此问题:

检查网络连接: 首先,请确保电脑具有稳定的国际互联网连接。如果使用代理,请确保Gradle可以访问所需的依赖项。

使用案例镜像源: 如果不能科学上网,可以尝试使用国内的镜像源,以加速依赖项下载。在项目根目录下的 build.gradle 文件中,可以添加类似以下内容的镜像配置:

buildscript {repositories {maven {url 'https://maven.aliyun.com/repository/jcenter'}}
}allprojects {repositories {maven {url 'https://maven.aliyun.com/repository/jcenter'}}
}

然后重新运行 flutter run 命令。

清除Gradle缓存: 有时Gradle缓存中的文件可能会损坏。可以尝试清除Gradle缓存,然后重新构建项目。在项目根目录中运行以下命令:

flutter clean

然后再运行 flutter run

OK

http://www.lryc.cn/news/199074.html

相关文章:

  • 第四次作业
  • 面试问题整理总结
  • 进阶JAVA篇- Collection 类的常用的API与 Collection 集合的遍历方式
  • CentOS | 添加普通用户并授权sudo
  • 【MyBatis】mybatis工具类迭代
  • MSQL系列(六) Mysql实战-SQL语句优化
  • kaggle新赛:UBC卵巢癌亚型分类和异常检测大赛【图像分类】
  • 基于nodejs+vue云旅青城系统
  • 《孙哥说Spring5》笔记汇总
  • 在使用了spring-cloud-starter-gateway后,为什么还会发生cors问题
  • CentOS7安装MySQL8.0.28
  • AutoSAR入门:应用背景及简介
  • C++初阶(三)
  • PHP的学习入门建议
  • 骰子涂色(Cube painting, UVa 253)rust解法
  • elasticsearch的docker安装与使用
  • ELK 单机安装
  • 优雅而高效的JavaScript——?? 运算符、?. 运算符和 ?. 运算符
  • Nginx配置负载均衡
  • Ubuntu 20.04 上安装 neo4j
  • 大规模爬虫系统面临的主要挑战及解决思路
  • 统计学习方法 感知机
  • Linux命令(103)之wc
  • 京东店铺公司名爬虫
  • 如何解决不同浏览器的样式兼容性问题?
  • C++ 中迭代器的使用
  • 如何使用BERT生成单词嵌入?
  • 第三章 内存管理 十一、虚拟内存的基本概念
  • web前端面试-- http的各个版本的区别(HTTP/0.9、HTTP/1.0、HTTP/1.1、HTTP/2.0、HTTP/3.0)
  • 统计学习方法 隐马尔可夫模型