Open main menu
首页
专栏
课程
分类
归档
Chat
Sci-Hub
谷歌学术
Libgen
GitHub镜像
登录/注册
搜索
关闭
Previous
Previous
Next
Next
flutter 更新 3.9.0遇到的问题
sockstack
/
231
/
2023-11-14 11:50:49
<p><span style="color: red; font-size: 18px">ChatGPT 可用网址,仅供交流学习使用,如对您有所帮助,请收藏并推荐给需要的朋友。</span><br><a href="https://ckai.xyz/?sockstack§ion=detail" target="__blank">https://ckai.xyz</a><br><br></p> <article class="_2rhmJa"><ul> <li>问题:新建项目卡住<br> 解决:换源,并配置到环境变量</li> <li>问题:Flutter assets will be downloaded from <a href="https://links.jianshu.com/go?to=https%3A%2F%2Fstorage.flutter-io.cn" target="_blank">https://storage.flutter-io.cn</a>. Make sure you trust this source!<br> 解决:忽略不影响</li> <li>问题:Build failed due to use of deprecated Android v1 embedding.<br> 解决:使用了flutter v2的sdk编译项目,而你的项目是旧的v1时候开发的,<br> <a href="https://links.jianshu.com/go?to=https%3A%2F%2Fgithub.com%2Fflutter%2Fflutter%2Fwiki%2FUpgrading-pre-1.12-Android-projects" target="_blank">Upgrading pre 1.12 Android projects · flutter/flutter Wiki (github.com)</a> </li> <li>问题:pub get failed exit code: 69<br> 解决:查看flutter doctor,修复问题</li> <li>问题: Windows Version (Unable to confirm if installed Windows version is 10 or greater)<br> 解决:切换flutter渠道<br> [1] 在cmd输入flutter channel 查看自己的flutter channel版本<br> [2] 输入flutter channel master,将flutter版本切换为master<br> [3]输入flutter upgrade 确保flutter更新到了最新版本<br> [4]输入 flutter doctor 再次检查是否解决</li> <li>问题:flutter assemble --output directory is required for assemble.<br> 解决:</li> <li>问题:flutter Failed to download</li> </ul> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-php"><code class=" language-php">https<span class="token punctuation">:</span><span class="token comment">//storage.flutter-io.cn/flutter_infra_release/flutter/d492b8b3a56729397743957de82be7cc1c6f4c6d/windows-x64-debug/w</span> indows<span class="token operator">-</span>x64<span class="token operator">-</span>flutter<span class="token punctuation">.</span>zip<span class="token punctuation">.</span> Ensure you have network connectivity <span class="token keyword">and</span> then <span class="token keyword">try</span> again<span class="token punctuation">.</span> Exception<span class="token punctuation">:</span> <span class="token number">503</span> <span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre> </div> <p>解决:检查是否有代理,或者检查网络</p> <ul> <li>问题:flutter run andorid 报错Target file "android" not found<br> 解决:flutter -d b7ec9ed0 run</li> <li>问题:Exception in thread "main" java.net.ConnectException: Connection timed out: connect<br> 解决:连接超时,是因为distributionUrl的网址被墙了,所以连接的时候总是连接不上。添加阿里镜像可以解决问题。</li> </ul> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-rust"><code class=" language-rust">maven <span class="token punctuation">{</span> url <span class="token lifetime-annotation symbol">'https://maven.aliyun.com/repository/google</span>' <span class="token punctuation">}</span> maven <span class="token punctuation">{</span> url <span class="token lifetime-annotation symbol">'https://maven.aliyun.com/repository/central</span>' <span class="token punctuation">}</span> maven <span class="token punctuation">{</span> url <span class="token lifetime-annotation symbol">'https://maven.aliyun.com/repository/jcenter</span>' <span class="token punctuation">}</span> maven <span class="token punctuation">{</span> url <span class="token lifetime-annotation symbol">'https://maven.aliyun.com/nexus/content/groups/public</span>' <span class="token punctuation">}</span> <span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre> </div> <ul> <li>问题:flutter create 指令<br> 解决: flutter create --org com.chatgpt.client chatgpt_client</li> <li>问题:flutter run 指令<br> 解决:flutter -d b7ec9ed0 run</li> <li>问题:No file or variants found for asset: messages.json.<br> 解决:检查assets下message.json是否存在,<br> 检查pubspec.yaml 下assets: - assets/是否正确</li> <li>问题:flutter doctor 卡住<br> 解决:等待,一般不会特别久</li> <li>问题:java.lang.NoClassDefFoundError: org/jetbrains/kotlin/gradle/plugin/KotlinBasePlugin<br> 解决:kotlin插件版本错误,最新版的1.8.20移除该类<br> kotlin 插件与agp的对应关系,可以查询<br> <a href="https://links.jianshu.com/go?to=https%3A%2F%2Frepo.maven.apache.org%2Fmaven2%2Forg%2Fjetbrains%2Fkotlin%2Fkotlin-gradle-plugin%2F" target="_blank">kotlin-gradle-plugin远程仓库 </a><br> 或者官方说明<br> <a href="https://links.jianshu.com/go?to=https%3A%2F%2Fkotlinlang.org%2Fdocs%2Fgradle-configure-project.html%23apply-the-plugin" target="_blank">Configure a Gradle project | Kotlin Documentation (kotlinlang.org)</a> </li> <li>问题:The constructor being called isn't a const constructor.<br> 解决:dart新版本的语法检查导致,<a href="https://links.jianshu.com/go?to=https%3A%2F%2Fdart.dev%2Ftools%2Fdiagnostic-messages%3Futm_source%3Ddartdev%26utm_medium%3Dredir%26utm_id%3Ddiagcode%26utm_content%3Dconst_with_non_const%23const_with_non_const" target="_blank">Diagnostic messages | Dart</a>,<br> 增加构造函数const Home({super.key});或者使用StatefulWidget,</li> <li>问题:Navigator operation requested with a context that does not include a Navigator<br> 解决:检查代码,main中需要StatelessWidget,home为StatefulWidget</li> <li>问题:可点击范围太小<br> 解决:behavior: HitTestBehavior.opaque,或者用背景色填充</li> <li>问题:Unsupported operation: Platform._operatingSystem<br> 解决:web平台优先判断</li> <li>问题:cannot modify unmodifiable map<br> 解决:未定位,修改代码解决</li> <li>问题:Trying to load an image from another domain<br> 解决:flutter run -d chrome --web-renderer html</li> <li>问题:flutter Web 项目网络请求报 XMLHttpRequest error<br> 解决:</li> </ul> <ol> <li><p>找到flutter sdk目录</p></li> <li><p>然后找到flutter\packages\flutter_tools\lib\src\web\chrome.dart文件并打开</p></li> <li><p>找到'--disable-extensions'位置,然后添加'--disable-web-security'</p></li> <li><p>另外还需要到flutter\bin\cache目录下,删除flutter_tools.stamp和flutter_tools.snapshot的文件,否则改动不生效</p></li> </ol> </article>
flutter 更新 3.9.0遇到的问题
作者
sockstack
许可协议
CC BY 4.0
发布于
2023-11-14
修改于
2024-12-21
上一篇:软件:常用 Linux 软件汇总,值得收藏
下一篇:macvtap使用教程
尚未登录
登录 / 注册
文章分类
博客重构之路
5
Spring Boot简单入门
4
k8s 入门教程
0
MySQL 知识
1
NSQ 消息队列
0
ThinkPHP5 源码分析
5
使用 Docker 从零开始搭建私人代码仓库
3
日常开发汇总
4
标签列表
springboot
hyperf
swoole
webman
php
多线程
数据结构
docker
k8s
thinkphp
mysql
tailwindcss
flowbite
css
前端