Skip to content

Commit

Permalink
chore:引入url_launcher
Browse files Browse the repository at this point in the history
Plugin project :url_launcher_web not found. Please update settings.gradle. fix: flutter/flutter#55077
  • Loading branch information
hackycy committed Jun 21, 2020
1 parent 007f911 commit 7f59556
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,19 @@ 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"

// https://github.com/flutter/flutter/issues/55077#issuecomment-628366487
// fix : Plugin project :url_launcher_web not found. Please update settings.gradle.
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
}
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies:
image_picker: ^0.6.7+2
json_serializable: ^3.3.0
cached_network_image: ^2.2.0+1
url_launcher: ^5.4.11


# The following adds the Cupertino Icons font to your application.
Expand Down

1 comment on commit 7f59556

@AliRn76
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well played man 👍

Please sign in to comment.