Flutter 创建项目就报错 Gradle7.3.0网络下载问题
前提
最后这些都是建议在安装了 Flutter 的包,还有 android sdk 包的环境下
gradel 7.3.0的错误
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! Launching lib\main.dart on BAL AL80 in debug mode... * What went wrong: Plugin [id: 'com.android.application', version: '7.3.0', apply: false] was not found in any of the following sources: - Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Included Builds (None of the included builds contain this plugin) - Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:7.3.0') Searched in the following repositories: Google MavenRepo Gradle Central Plugin Repository
解决方法
3.解决后就新建的项目就没有这个问题了
错误2
这个错误是我在添加了 video_player 的flutter 插件后出现的,当时我人也是无语死了,加个插件就错误
What went wrong: A problem occurred configuring project ':video_player_android'. > Could not resolve all files for configuration ':video_player_android:classpath'. > Could not resolve com.android.tools.build:gradle:7.2.1. Required by: project :video_player_android > Could not resolve com.android.tools.build:gradle:7.2.1. > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.2.1/gradle-7.2.1.pom'. > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.2.1/gradle-7.2.1.pom'. > Connect to dl.google.com:443 [dl.google.com/127.0.1.3] failed: Connection refused: no further information > Could not resolve com.android.tools.build:gradle:7.2.1. > Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.2.1/gradle-7.2.1.pom'. > Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.2.1/gradle-7.2.1.pom'. > Connect to repo.maven.apache.org:443 [repo.maven.apache.org/127.0.1.4] failed: Connection refused: no further information > Failed to notify project evaluation listener. > Could not get unknown property 'android' for project ':video_player_android' of type org.gradle.api.Project. > Could not get unknown property 'android' for project ':video_player_android' of type org.gradle.api.Project. * 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 13s Retrying Gradle Build: #1, wait time: 100ms [!] Gradle threw an error while downloading artifacts from the network. Running Gradle task 'assembleDebug'... FAILURE: Build failed with an exception
//下载的 Java JDK环境配置,选择下载.zip包,不推荐.exe,我下了还是报错,后面改.zip就不会了,坑
JAVA JDK安装地址
教程自行去找跟配置
免责声明:我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理! 图片声明:本站部分配图来自人工智能系统AI生成,觅知网授权图片,PxHere摄影无版权图库和百度,360,搜狗等多加搜索引擎自动关键词搜索配图,如有侵权的图片,请第一时间联系我们。