Program type already present: BuildConfig Program type already present: BuildConfig android android

Program type already present: BuildConfig


You are getting this error because you a have library module which has the same package name as the app module.

The solution would be to change package name of your library module. You can follow the accepted answer in this SO which describes how to change the package name in android studio.


In my case It was happening when I try to run older project on new installed Android studioThe problem solved by running Build->Clean Project

Note: As friends say on comments this is solution for a flutter project


I solved this error enabling multiDexEnabled in the build.gradle of my app's module:

defaultConfig {     ...    ...    ...    multiDexEnabled true}