1

flutter build fails Could not create task ':flutter_plugin_android_lifecycle:generateDebugUnitTestConfig'. this and base files have different roots: D:\untitled\build\flutter_plugin_android_lifecycle and C:\Users\RK\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_plugin_android_lifecycle-2.0.15\android.

Could not create task ':flutter_plugin_android_lifecycle:generateDebugUnitTestConfig'. this and base files have different roots: D:\untitled\build\flutter_plugin_android_lifecycle and C:\Users\RK\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_plugin_android_lifecycle-2.0.15\android.

my pc
  • 11
  • 1

2 Answers2

0
  1. You need to run: flutter clean
  2. Check and sync gradle files with project
  3. Sometimes helps to update the gradle version to 7.0.3 (from 7.0.0)
BalgabayevD
  • 44
  • 1
  • 4
  • actually I already have latest version of gradle, I tried flutter clean as well, the AP runs in chrome edge etc, but when on emulator or real devce , the sync of gradle gives this error flutter_plugin_android_lifecycle:generateDebugUnitTestConfig'. this and base files have different roots: D:\untitled\build\flutter_plugin_android_lifecycle and C:\Users\RK\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_plugin_android_lifecycle-2.0.15\android. – my pc May 25 '23 at 02:42
0

inside the android not the root directory I did: run flutter clean flutter upgrade flutter pub get flutter pub update

my pc
  • 11
  • 1