Reputation: 161
I am just trying to run the first app and this is what happens:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> Several variant outputs are configured to use the same file name "resources-debug.ap_", filters : MAIN:MAIN
Upvotes: 16
Views: 7313
Reputation: 139
It seems like there are several variant outputs that are configured to use the same file name. To resolve this issue, you could try renaming the output files for each variant to avoid conflicts. You can also update the build variant filter configuration to ensure that each variant has a unique output file name.
android {
...
buildTypes {
debug {
...
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFileName = "resources-${variant.name}.ap_"
}
}
}
release {
...
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFileName = "resources-${variant.name}.ap_"
}
}
}
}
}
Upvotes: 0
Reputation: 407
this error also appear when you mistakly disable the app and try to debug same app again.So go to applications and enable it again to resolve the issue.Thanks
Upvotes: 0
Reputation: 26
If flutter clean doesn't work, then delete the Android folder, then run flutter clean and run the app... Make sure you have an android emulator or device connected as your run device, this will bring a prompt asking you to enable android for your project then just click yes.
You can also uninstall the app from your emulator or android device before you run it again, but make sure its uninstalled on all profiles of your device.
Upvotes: 0
Reputation: 151
just log out from current windows session and then do flutter clean and after run your project. that will solve the problem.
Upvotes: 0
Reputation: 146
I got the same error while trying to integrate FCM into my application.. The problem is in the older build file.. i.e as we are editing our Manifest file we need to rebuild the project so..
flutter clean
flutter run
Make sure to do gradle sync if the problem persist.. It solved the problem for me..
Upvotes: 7