Skip to content

Commit 1d52512

Browse files
committed
fix: gradle error in flutter 1.17
1 parent 5c5f252 commit 1d52512

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

android/settings.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// Copyright 2014 The Flutter Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style license that can be
3-
// found in the LICENSE file.
4-
51
include ':app'
62

7-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
8-
def properties = new Properties()
3+
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
94

10-
assert localPropertiesFile.exists()
11-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
5+
def plugins = new Properties()
6+
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7+
if (pluginsFile.exists()) {
8+
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9+
}
1210

13-
def flutterSdkPath = properties.getProperty("flutter.sdk")
14-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
15-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
11+
plugins.each { name, path ->
12+
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13+
include ":$name"
14+
project(":$name").projectDir = pluginDirectory
15+
}

0 commit comments

Comments
 (0)