gpt4 book ai didi

flutter - 找不到插件项目:location_web。请更新settings.gradle

转载 作者:行者123 更新时间:2023-12-03 04:33:23 25 4
gpt4 key购买 nike

我在运行我的应用程序时遇到问题,它说:
插件项目:location_web找不到。请更新settings.gradle。
我看了一些视频,但关于此的任何内容:/
Settings.gradle

include ':app'

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
Pubspec.yalm
name: teccar_project
description: A new Flutter project.

publish_to: 'none'

version: 1.0.0+1

environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
flutter:
sdk: flutter

cupertino_icons: ^0.1.3
google_fonts: ^1.1.1
google_maps_flutter: ^1.0.3
location: ^3.0.2
flutter_svg: ^0.19.1
url_launcher: ^5.7.8
webview_flutter: ^1.0.5
assets_audio_player: ^2.0.12

dev_dependencies:
flutter_test:
sdk: flutter

flutter:
uses-material-design: true

assets:
- assets/map_style.json
- assets/driver.jpeg
- assets/passenger.png
- assets/square.svg
- assets/uber_new_ride_alert.mp3

最佳答案

您需要加载Flutter插件。因此,您的settings.gradle文件应如下所示:


include ':app'

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}

并且您的build.gradle文件应如下所示:

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

// Some more code...

关于flutter - 找不到插件项目:location_web。请更新settings.gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64544630/

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