gpt4 book ai didi

flutter - 如何解决抖动错误(操作系统错误:访问被拒绝,errno = 5)?

转载 作者:行者123 更新时间:2023-12-03 03:57:30 26 4
gpt4 key购买 nike

我正在尝试学习 flutter 。我的问题是,当我第一次运行flutter项目时,它会运行并成功安装在设备上,但是如果我断开设备并重新运行项目,则会出现错误。

我打算不支付我应用程序中的图片。

当我运行flutter cleanflutter clean buildflutter clean cache并重新运行项目时,它没有给出错误,然后在断开设备连接后,探针会再次出现。
我在Google上搜索了几个小时,但没有帮助我。
这个错误:

Target debug_android_application failed: FileSystemException: Cannot copy file to 'G:\Flutter 
Projects\my_practice_7\build\app\intermediates\flutter\debug\flutter_assets\images\image.png',
path = 'G:\Flutter Projects\my_practice_7\images\image.png'
(OS Error: Access is denied.
, errno = 5)
build failed.

FAILURE: Build failed with an exception.

* Where:
Script 'G:\Android\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 780

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.

flutter 医生-v
[√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18362.476], locale en-GB)
• Flutter version 1.12.13+hotfix.5 at G:\Android\flutter
• Framework revision 27321ebbad (7 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at G:\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = G:\Android\Sdk\
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.

[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.41.1)
• VS Code at C:\Users\HP\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.7.1

[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

• No issues found!

最佳答案

似乎是与文件权限有关的问题。尝试使用命令行复制文件。您将收到类似的错误。

copy "G:\Flutter Projects\my_practice_7\images\image.png" "G:\Flutter Projects\my_practice_7\build\app\intermediates\flutter\debug\flutter_assets\images\image.png"



现在,检查您是否对目标目录/文件具有必要的权限,或者目标文件/目录不是只读的。

Blockquote



引用: https://github.com/flutter/flutter/issues/49874

关于flutter - 如何解决抖动错误(操作系统错误:访问被拒绝,errno = 5)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59910853/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com