Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install dart-sdk
C:\tools\flutter\bin
即可C:\tools\flutter\flutter_console.bat
即可在flutter命令列運行flutter命令
flutter upgrade
flutter doctor
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Finished with error: Please review your Gradle project setup in the android/ folder.
* Error running Gradle:
Exit code 1 from: D:\tad\app1\android\gradlew.bat app:properties:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\tad\app1\android\app\build.gradle' line: 25
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
> Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
* 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 2s
請修改C:\tools\flutter\packages\flutter_tools\gradle\flutter.gradle,把jcenter()位置調整一下及即可:
buildscript {
repositories {
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
改為
buildscript {
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()
}
dependencies {`enter code here`
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
cd "C:\Program Files\Oracle\VirtualBox\"
VBoxManage modifyvm "High Sierra" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1