ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

解决Could not create task …this and base files have different roots

解决Could not create task …this and base files have different roots

直接编译运行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.

 

解决方法是:

  1. 运行flutter clean
  2. 在不执行flutter pub get的前提下,立即去执行Gradle sync
  3. 编译Flutter项目
返回列表