简体   繁体   中英

Binding error while integrating flutter module in android app

setBinding(new Binding([gradle:this]))

The Binding after new shown error in android studio, am trying to import things that shown in suggestion but it cant work,

The error it show is "Cannot resolve symbol 'Binding'". Anyone can you help me out?

flutter.dev中有一个分步绑定的过程点击这个链接: https ://flutter.dev/docs/development/add-to-app/android/project-setup

rebuild gradle by run this command in terminal

$ gradlew init

After running this command, some questions will appear to you, choose the answer that matches your project "like this"

Select type of project to generate: 1: basic 2: application 3: library 4: Gradle plugin Enter selection (default: basic) [1..4] 2

Select implementation language: 1: C++ 2: Groovy 3: Java 4: Kotlin 5: Scala 6: Swift Enter selection (default: Java) [1..6] 4

Split functionality across multiple subprojects?: 1: no - only one application project 2: yes - application and library projects Enter selection (default: no - only one application project) [1..2] 2

Select build script DSL: 1: Groovy 2: Kotlin Enter selection (default: Kotlin) [1..2] 2

Generate build using new APIs and behavior (some features may change in the next minor release)? (default: no) [yes, no] yes Project name (default: PrimaMobile-master): "click enter" Source package (default: PrimaMobile.master): "click enter"

Now wait for complete the gradle rebuilding

it's work for me

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM