Android SDK -> SDK Tools -> Android SDK Command-line Tools
混合Android开发配置settings.gradle
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories{
String flutterStorageUrl = System.getenv("FLUTTER_STORAGE_BASE_URL") ?: "https://storage.googleapis.com"
maven {
url flutterStorageUrl + "/download.flutter.io"
}
}
// 这里binding,在初次编写的时候,会出现Binding爆红的现象,不用管,这里binding爆红是因为没有sync的结果,如果所有东西都配置完全就不会爆红了,
setBinding(new Binding([gradle: this]))
// 这里是当前flutter_module的位置,最好是把flutter module放在和当前android项目平级的文件夹里面
evaluate(new File(
settingsDir.parentFile,
'flutter_module/.android/include_flutter.groovy'
))
// 这两行要配置,官网上面没有,所以也会出现问题
include ':flutter_module'
project(':flutter_module').projectDir = new File('../flutter_module')