Well, I pulled the latest flutter application via VSCODE flutter new project
. Without changing anything, start the mobile emulator and run.
Here comes the error:
Flutter assets will be downloaded from https://mirrors.tuna.tsinghua.edu.cn/git/flutter. Make sure you trust this source!
Launching libmain.dart on sdk gphone64 x86 64 in debug mode...
FAILURE: Build failed with an exception.
* Where:
Settings file 'C:UsersmeDesktopworkspaceflutter_application_1androidsettings.gradle' line: 20
* What went wrong:
Error resolving plugin [id: 'dev.flutter.flutter-plugin-loader', version: '1.0.0']
> Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by settings file 'settings.gradle'
* 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 11s
Error: Gradle task assembleDebug failed with exit code 1
Exited (1).
Flutter –version
Flutter 3.24.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision dec2ee5c1f (3 weeks ago) • 2024-11-13 11:13:06 -0800
Engine • revision a18df97ca5
Tools • Dart 3.5.4 • DevTools 2.37.3
and the grandle distribution for now is gradle-8.3-all.zip.
for network accelerating, I got the env configured like:
FLUTTER_STORAGE_BASE_URL:https://mirrors.tuna.tsinghua.edu.cn/git/flutter
PUB_HOSTED_URL:https://pub.flutter-io.cn
the mentioned file settings.gradle is like:
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}
include ":app"
OS info:
Edition Windows 11 Pro
Version 24H2
Installed on 12/7/2024
OS build 26100.2314
Experience Windows Feature Experience Pack 1000.26100.32.0
the same to exec flutter build apk
. As a beginner of flutter, it’s confused what’s going on with this official project.
BTW, I can smoothly run it on windows desktop and MS edge browser.
try to run it on the android devices but failed.
the emulator is provided by android studio.
the same to build as a apk, so i guess it’s nothing about the emulator.
Limmy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.