Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
146 views
in Technique[技术] by (71.8m points)

android - Unable to "flutter run" due to failure to install SDK but flutter doctor runs fine

flutter doctor output on windows is

C:WINDOWSsystem32> 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)

? 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.

when i try to flutter run from vs code an app(first sample app from docs) i get this error

FAILURE: Build failed with an exception.

  • Where: Build file 'D:VSProjectsFluttermyappandroiduild.gradle' line: 24

  • What went wrong: A problem occurred evaluating root project 'android'.

    A problem occurred configuring project ':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)Androidandroid-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?

Can i downgrade my sdk requirement somehow?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You shoudn't install the Android SDK into C:Program Files (x86) which requires elevated privileges to write. Android Studio seems to install it into C:UserssomeUserAppDataLocalAndroidSdk where the current user has sufficient privileges.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...