使用Android Studio
手动整合
!!! 请确保Flutter项目 和 Android 项目是平级的
将Flutter模块作为子项目包含在宿主应用程序的中 settings.gradle
:
// Include the host app project.
include ':app' // assumed existing content
setBinding(new Binding([gradle: this])) // new
evaluate(new File( // new
settingsDir.parentFile, // new
'my_flutter/.android/include_flutter.groovy' // new
)) // new
implementation
从您的应用程序引入对Flutter模块的依赖:
dependencies {
implementation project(':flutter')
}