wuba / Fair

A Flutter package used to update widget tree dynamically. Fair提供一整套Flutter动态化解决方案
https://fair.58.com
BSD 3-Clause "New" or "Revised" License
2.64k stars 314 forks source link

@FairBinding失效,命令无法生成AppGeneratedModule文件 #391

Open jackli12 opened 7 months ago

jackli12 commented 7 months ago

问题描述:

image

按照文档使用@FairBinding标签在 main 文件中,然后执行pub run build_runner build --delete-conflicting-outputs命令,无法在 src 目录下生成AppGeneratedModule文件。 但是直接在类文件上打注解,执行命令可以生成AppGeneratedModule文件,如下图

image

如果是第三方 sdk 无法在类文件上打注解,麻烦看看这个是什么问题

flutter 环境如下 [!]Flutter (Channel [user-branch], 3.13.0, on macOS 14.3.1 23D60 darwin-x64, locale zh-Hans-CN) ! Flutter version 3.13.0 on channel [user-branch] at /Users/zyb/flutterDev/flutter Currently on an unknown channel. Run flutter channel to switch to an official channel. If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install. ! Upstream repository unknown source is not a standard remote. Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error. • Framework revision efbf63d9c6 (8 months ago), 2023-08-15 21:05:06 -0500 • Engine revision 1ac611c64e • Dart version 3.1.0 • DevTools version 2.25.0 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/zyb/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/zyb/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C500b • CocoaPods version 1.11.0

Fair版本号:

image