Closed sattasundar closed 3 years ago
Try to add one package explicitly in the .csproj file of your android project, e.g:
<PackageReference Include="Xamarin.Firebase.Analytics" Version="118.0.0" />
I don't know why this is necessary but it seems to help. I will update the README accordingly.
@TobiasBuchholz No still same issue is coming.
Default FirebaseApp is not initialized in this process org.satsang.diksha. Make sure to call FirebaseApp.initializeApp(Context) first.
Have you cleaned the solution (also delete bin/ and obj/ folders) and restored packages? Restart Visual Studio? The usual stuff.. ¯_(ツ)_/¯
Which PackageReference did you add? From my experience either Analytics, DynamicLinks or RemoteConfig seem to work.
@TobiasBuchholz Have added the package what you have mentioned in previous comment.
After clearing all bin/obj and temp file now I am getting this;
Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed) [System] Ignoring header X-Firebase-Locale because its value was null. [EGL_emulation] eglMakeCurrent: 0xebf7f880: ver 3 0 (tinfo 0xb70dade0) [FirebaseAuth] [GetAuthDomainTask] Error getting project config. Failed with { [FirebaseAuth] "error": { [FirebaseAuth] "code": 400, [FirebaseAuth] "message": "INVALID_CERT_HASH", [FirebaseAuth] "errors": [ [FirebaseAuth] { [FirebaseAuth] "message": "INVALID_CERT_HASH", [FirebaseAuth] "domain": "global", [FirebaseAuth] "reason": "invalid" [FirebaseAuth] } [FirebaseAuth] ] [FirebaseAuth] } [FirebaseAuth] } [FirebaseAuth] 400 [zzf] Failed to get reCAPTCHA token - calling backend without app verification [EGL_emulation] eglMakeCurrent: 0xebf7f880: ver 3 0 (tinfo 0xb70dade0) [System] Ignoring header X-Firebase-Locale because its value was null. [System] A resource failed to call end. [System] A resource failed to call end. [FirebaseAuth] [SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17042 Invalid format.
Seems like there is something wrong with your firebase config. Did you follow the steps from the basic and auth setup?
The 'Default FirebaseApp is not initialized' issue is solved, correct? If that's the case please close this issue and create a new one if necessary.
@TobiasBuchholz Sorry! Actually It's my fault and was missing the Country code.
So including country code it is working e.g. for India; +91XXXXXXXXXX
thanks a lot @TobiasBuchholz for the active reply and support.
will connect in near future if any challenges or issue appeared.
@TobiasBuchholz Countered same issue today; Default FirebaseApp is not initialized
Can find Sample Code here
The package name in your google-services.json
(com.xamarin.auth) doesn't match with the one in your AndroidManifest.xml
(org.satsang.diksha). You either have to change it back in the AndroidManifest.xml
or if you want to use the other package name you'll have to create a new app in the firebase console for that and replace the google-services.json
file.
Thanks @TobiasBuchholz . It's my bad. Now it's working.
I encountered the same issue and have been able to solve it by following this procedure :
Thanks Budyy that build error is resolved.
Now I got a Challenge;
**MainActivity
**MainPage.xaml.cs
public partial class MainPage : ContentPage { private readonly Lazy _firebaseAuth;
private IFirebaseAuth _fireAuth;
public MainPage()
{
InitializeComponent();
_firebaseAuth = new Lazy(CreateFirebaseAuth);
}
private static IFirebaseAuth CreateFirebaseAuth() =>
CrossFirebaseAuth.Current;
async void ClickMe(System.Object sender, System.EventArgs e)
{
try
{
_fireAuth = _firebaseAuth.Value;
await _fireAuth.VerifyPhoneNumberAsync(phoneEntry.Text);
}
catch(Exception ex)
{
await DisplayAlert("Error", ex.Message, "Okay");
}
}
}