[英]Unable to "flutter run" due to failure to install SDK but flutter doctor runs fine
flutter doctor
output on windows is Windows 上的
flutter doctor
输出是
C:\\WINDOWS\\system32> flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, v1.0.0,> on Microsoft Windows [Version 10.0.17134.523], locale en-US) [√]Android toolchain - develop for Android devices (Android SDK 27.0.3) [√] Android Studio (version 3.2) [√] VS Code, 64-bit edition (version 1.31.1) [√] Connected device (1 available)
C:\\WINDOWS\\system32> flutter doctor Doctor summary(查看所有详细信息,运行 flutter doctor -v):[√] Flutter(Channel stable,v1.0.0,> on Microsoft Windows [Version 10.0.17134.523],locale en- US) [√]Android 工具链 - 为 Android 设备开发(Android SDK 27.0.3) [√] Android Studio(3.2 版) [√] VS Code,64 位版本(1.31.1 版) [√] 已连接设备( 1 个可用)
• No issues found!
• 未发现问题!
as you can see no issues found BUT flutter is detecting latest sdk installed as 27 when i have installed 28 already.正如您所看到的,没有发现任何问题,但是当我已经安装了 28 时,flutter 正在检测安装为 27 的最新 sdk。
when i try to flutter run
from vs code an app(first sample app from docs) i get this error当我尝试从 vs 代码
flutter run
应用程序(来自文档的第一个示例应用程序)时,我收到此错误
FAILURE: Build failed with an exception.
FAILURE:构建失败,出现异常。
Where: Build file 'D:\\VSProjects\\Flutter\\myapp\\android\\build.gradle' line: 24
其中:构建文件 'D:\\VSProjects\\Flutter\\myapp\\android\\build.gradle' 行:24
What went wrong: A problem occurred evaluating root project 'android'.
出了什么问题:评估根项目“android”时出现问题。
A problem occurred configuring project ':app'.
配置项目“:app”时出现问题。 Failed to install the following SDK components: build-tools;28.0.3 Android SDK Build-Tools 28.0.3 The SDK directory is not writable (C:\\Program Files (x86)\\Android\\android-sdk)
无法安装以下 SDK 组件: build-tools;28.0.3 Android SDK Build-Tools 28.0.3 SDK 目录不可写 (C:\\Program Files (x86)\\Android\\android-sdk)
i tried changing the permission of the file to remove read-only access and still get the same error, i use the same sdk to build android apps with android studio(native) and visual studio(xamarin) just fine...i have the latest sdk version installed already so why is flutter giving me this error?我尝试更改文件的权限以删除只读访问权限,但仍然出现相同的错误,我使用相同的 sdk 使用 android studio(native) 和 Visual Studio(xamarin) 构建 android 应用程序就好了……我有已经安装了最新的 sdk 版本,为什么 flutter 给我这个错误?
Can i downgrade my sdk requirement somehow?我可以以某种方式降级我的 sdk 要求吗?
You shoudn't install the Android SDK into C:\\Program Files (x86)
which requires elevated privileges to write.您不应将 Android SDK 安装到需要提升写入权限的
C:\\Program Files (x86)
中。 Android Studio seems to install it into C:\\Users\\someUser\\AppData\\Local\\Android\\Sdk
where the current user has sufficient privileges. Android Studio 似乎将其安装到
C:\\Users\\someUser\\AppData\\Local\\Android\\Sdk
中,当前用户具有足够的权限。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.