f-miyu / Plugin.FirebaseAuth

MIT License
61 stars 26 forks source link

Can't resolve the reference 'Firebase.Auth.AuthCredential #11

Open RobertoOFonseca opened 4 years ago

RobertoOFonseca commented 4 years ago

When compiling for release for IOS

Can't resolve the reference 'Firebase.Auth.AuthCredential Firebase.Auth.OAuthProvider::GetCredential(System.String,System.String,System.String)', referenced from the method 'Plugin.FirebaseAuth.IAuthCredential Plugin.FirebaseAuth.OAuthProviderWrapper::GetCredential(System.String,System.String,System.String)' in 'Firebase.Auth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

KennyDizi commented 4 years ago

got the same issue MTOUCH: Error MT2101: Can't resolve the reference 'Firebase.Auth.AuthCredential Firebase.Auth.OAuthProvider::GetCredential(System.String,System.String,System.String)', referenced from the method 'Plugin.FirebaseAuth.IAuthCredential Plugin.FirebaseAuth.OAuthProviderWrapper::GetCredential(System.String,System.String,System.String)' in 'Firebase.Auth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. (MT2101) (connect.me.mobile.iOS)

KennyDizi commented 4 years ago

Release Mode Only Mono 6.6 VS 8.4 Preview Lastest XF 4.4

RichardSV15 commented 4 years ago

I get the same error, it goes away when i set the linker behavior to: Don't Link (Link Framework SDKs ONLY) makes it come back.

My only issue is that when i do that and try to archive to release i get "xamarin archive error There was an error unzipping the file zip The specified path, file name, or both are too long." error and cannot archive. Tried many troubleshooting methods and can't resolve it. Not sure if this is related but that's my 2 cents.

RichardSV15 commented 4 years ago

After investigation I realized that Plugin.FirebaseAuth (2.0.0) references xamarin.firebase.ios.core (>=5.1.3). This is an issue when you have a plugin like (Xamarin.Firebase.iOS.DynamicLinks 4.0.1.1) that depends on xamarin.firebase.ios.core (>= 6.1.0.1). You get a Native linking failed error which can only be resolved by manually installing Xamarin.Firebase.iOS.Auth (6.2.1.2) which doesn't appear to have the reference 'Firebase.Auth.AuthCredential Firebase.Auth.OAuthProvider::GetCredential(System.String,System.String,System.String)'

@f-miyu Is there a way that Plugin.FirebaseAuth can be updated to depend on xamarin.firebase.ios.core (>= 6.1.0.1)? The same is true for others like Plugin.FirebaseStorage & Plugin.CloudFirestore

[downgrading in not an option because previous version of dynamic links don't work on ios. Specifically resolving shortlinks's long url]

vhugogarcia commented 4 years ago

I'm facing the same issue for release mode. @RichardSV15 any workaround in the meantime?

I manually installed the Xamarin.Firebase.iOS.Auth (6.2.1.2) but that error is still present if I set Include SDKs only when compiling.

RichardSV15 commented 4 years ago

@vhugogarcia yes, the work around is to stick with Plugin.FirebaseAuth (2.0.0) that references xamarin.firebase.ios.core (>=5.1.3)... If you have anything (dynamiclinks, firestore, analytics) that referencea anything higher than (5.1.3) it will not build. If you absolutely need a higher version I recommend downgrading to that lowest point get it compile and build correctly and troubleshoot after that

vhugogarcia commented 4 years ago

@RichardSV15 Thanks for the quick answer. I was running a test and I was able to compile, archive and upload to TestFlight on Apple Store Connect. Using the following configuration:

if you want to set the linker to "SDK only" then, download the fork from https://github.com/xamarindevelopervietnam/Plugin.FirebaseAuth and just remove the references to GetCredentials, if you don't need them. In my case, since I only require Email Auth, I had no issues with the removal.