简记一个错误

简介: 简记一个错误

简记一个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/MediaBrowserB 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/MediaSessionCompatBuilderExampleofsupportlibraryreference: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.

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.

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

目录
相关文章
|
2月前
|
Java 开发者
【编程基础知识】2的n次幂与二进制位全为1之间的联系,为啥只差一个1
本文深入探讨了2的n次幂与二进制位全为1之间的数学联系,解释了2的n次幂减一的二进制表示为何全为1,并探讨了这一特性在HashMap中的应用。通过基础数学原理和实际代码示例,文章揭示了这一特性的实用价值,适合各水平的编程爱好者学习。
26 3
|
7月前
|
C语言
【汇编语言实战】求两组给定数组最大值
【汇编语言实战】求两组给定数组最大值
21 0
|
7月前
|
算法 测试技术 C#
【二进制求公约数】【数学】【数论】2543. 判断一个点是否可以到达
【二进制求公约数】【数学】【数论】2543. 判断一个点是否可以到达
|
7月前
|
算法 测试技术 C++
【数论】【分类讨论】【C++算法】1611使整数变为 0 的最少操作次数
【数论】【分类讨论】【C++算法】1611使整数变为 0 的最少操作次数
C++——第6节 代码世界中的传送阵:goto语句
C++——第6节 代码世界中的传送阵:goto语句
UPC-趾压板矩阵(强行找规律)
UPC-趾压板矩阵(强行找规律)
106 0
UPC-趾压板矩阵(强行找规律)
PAT1008数组元素循环右移问题(2,3测试点不过的解决办法)
PAT1008数组元素循环右移问题(2,3测试点不过的解决办法)
115 0
|
PHP 开发者
错误抑制运算| 学习笔记
快速学习错误抑制运算。
728. 自除数 :「模拟」&「打表 + 二分」&「打表 + 哈希表」
728. 自除数 :「模拟」&「打表 + 二分」&「打表 + 哈希表」