I have to implement firebase in 2 configurations Debug and Release. This is the reason I have removed json files and wrote code line this:
for configuration 1-
var env1 = new FirebaseOptions.Builder()
.SetApplicationId(myId)
.SetApiKey(myKey)
.SetStorageBucket(appspot.com)
.SetProjectId(myPID)
.SetDatabaseUrl(MYURL)
.Build();
var app1 = FirebaseApp.InitializeApp(Application.Context, env1, "Debug");
analytics= FirebaseAnalytics.GetInstance(app1.ApplicationContext);
For configuration 2-
var env2 = new FirebaseOptions.Builder()
.SetApplicationId(myId)
.SetApiKey(myKey)
.SetStorageBucket(appspot.com)
.SetProjectId(myPID)
.SetDatabaseUrl(MYURL)
.Build();
var app2 = FirebaseApp.InitializeApp(Application.Context, env2, "Release");
analytics= FirebaseAnalytics.GetInstance(app1.ApplicationContext);
Here either it is giving error like missing_google_id or firebase is not initialized.
I have tried adding string value in xml file for android,still same error. To acieve my goal I have also tried adding multiple json files in different directories as per the link below
Xamarin firebase different google-services,json for different build configurations
but it seems it still looks for json file in root folder..
So how to implement firebase without or with json file for multiple environments