I am using firebase in my android project but when I run the app on real device I am getting the following exception
java.lang.IllegalStateException: FirebaseApp name project already exists! what I have tried I already tried all stackoverflow answer but it did not solve my problem I have tried even the following link as well FirebaseApp name [DEFAULT] already exists
below is my kotlin where I have initialized firebase in my MainActivity.kt kotlin code
override fun onCreate(savedInstanceState: Bundle?) {
appCommon.initKey(applicationContext)
val options = FirebaseOptions.Builder()
.setApplicationId("Application Id") // Required for Analytics.
.setProjectId("Project Id") // Required for Firebase Installations.
.setApiKey("Api key") // Required for Auth.
.build()
initializeApp(applicationContext, options, "project id")
I want to know where exactly I am making the problem