简记一个错误

编程入门 行业动态 更新时间:2024-10-25 12:17:48

<a href=https://www.elefans.com/category/jswz/34/1759061.html style=简记一个错误"/>

简记一个错误

简记一个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 Builder′Exampleofsupportlibraryreference:′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 ‘.7.0/kotlin-stdlib-1.7.0.jar’.
Could not GET ‘.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 ‘.7.0/kotlin-stdlib-common-1.7.0.jar’.
Could not GET ‘.7.0/kotlin-stdlib-common-1.7.0.jar’.
Connect to repo.maven.apache:443 [repo.maven.apache/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

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 ‘.0/listenablefuture-1.0.jar’.
Could not GET ‘.0/listenablefuture-1.0.jar’.
Connect to repo.maven.apache:443 [repo.maven.apache/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

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 ''}}
}allprojects {repositories {maven {url ''}}
}

然后重新运行 flutter run 命令。

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

flutter clean

然后再运行 flutter run

OK

更多推荐

简记一个错误

本文发布于:2023-12-07 08:16:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1670646.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:简记   错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!