直接编译运行Flutter项目是没问题的,但是单独打开Android项目进行编译却报错了。
Multiple build operations failed. Could not create task ':file_selector_android:generateDebugUnitTestConfig'. Could not create task ':shared_preferences_android:generateDebugUnitTestConfig'. Could not create task ':url_launcher_android:generateDebugUnitTestConfig'. Could not create task ':file_selector_android:generateDebugUnitTestConfig'. this and base files have different roots: D:\param\project\flutter\lastseentrack\build\file_selector_android and C:\Users\Administrator\AppData\Local\Pub\Cache\hosted\pub.flutter-io.cn\file_selector_android-0.5.2+1\android.
解决方法是:
- 运行
flutter clean - 在不执行
flutter pub get的前提下,立即去执行Gradle sync - 编译Flutter项目