I'm working on a Xamarin.Forms app with Firebase Auth integration. I've set up Dependency Service for Android and iOS to create a new user when prompted. The Android dependency works fine, but whenever I call any 'Auth' method in my iOS dependency, the app crashes on startup with the following error thrown from my "Firebase.Core.App.Configure()" line in my delegate file:
Foundation.MonoTouchException has been thrown
Objective-C exception thrown. Name: NSInvalidArgumentException Reason:
-[FIRApp setGetTokenImplementation:]:unrecognized selector sent to instance 0x282d3d1a0
...followed by a mile-long stack trace
My current iOS Dependency code is below:
using System;
using Xamarin.Forms;
using ActNearMe; //name of my app
using Firebase.Auth;
using Firebase.InstanceID;
using Firebase.Core;
using System.Collections.Specialized;
using System.Net;
using System.Threading.Tasks;
[assembly: Dependency(typeof(IFirebaseInterface))]
namespace ActNearMe.iOS
{
public class FirebaseInterface : IFirebaseInterface
{
WebClient client = new WebClient();
NameValueCollection sendingData;
public void CreateNewUser(string email, string password, NameValueCollection userData)
{
//sendingData = userData;
//Anytime I call anything with Auth here, the app won't even load.
Console.WriteLine(Auth.CurrentVersion);
//Auth.DefaultInstance.CreateUser(email, password,(authResult, error) => {
/*client.UploadValuesCompleted += (sender, e) =>
{
Console.WriteLine("it's done!");
};
*/
//});
}
}
}
Here is my error log:
2019-04-15 10:18:53.724 ActNearMe.iOS[6964:1670900] +[FIRApp registerAsConfigurable:]: unrecognized selector sent to class 0x1060d1bb8
2019-04-15 10:18:53.724 ActNearMe.iOS[6964:1670900] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[FIRApp registerAsConfigurable:]: unrecognized selector sent to class 0x1060d1bb8'
*** First throw call stack:
(0x22401c518 0x2231f79f8 0x223f3e2c4 0x224021d60 0x2240239fc 0x2231f9ffc 0x2231fbe54 0x106626390 0x106638314 0x106637370 0x10663742c 0x1066266d8 0x10662b2a0 0x106625044)
libc++abi.dylib: terminating with uncaught exception of type NSException
Application 'com.russjowell.actnearme' terminated.
Launched application 'com.russjowell.actnearme' on 'iPhone (2)' with pid 6964