Android Question Facebook 1.03 Compiling error

Angel Garcia

Member
Licensed User
Hello all,
I tried to update the Facebook authentication library from 1.02 to 1.03, but i'm having this compiling error:

facebook.Initialize2(\
src\com\stylist\ieapplications\main.java:1093: error: cannot find symbol
_facebook.Initialize2(processBA,"fb");
^
symbol: method Initialize2(BA,String)
location: variable _facebook of type FacebookSdkWrapper

I used the Initialize2 method with the name event. like facebook.Initialize2("fb")

I'm updating this library because i had a notification from facebook with the following:

Deprecating FB Login Support on Android Embedded Browsers
Urgent
We’ve been monitoring an increase in phishing attempts on Android embedded browsers, also known as WebViews. Because of this, we will no longer support this method of Facebook Login and your users will not be able to log in using Android embedded browsers beginning October 5, 2021. Until then, we will continue to prevent access to Facebook Login on embedded browsers for certain users we deem high-risk in an effort to prevent malicious activity.
To avoid a disrupted user experience, please use the following checklist:
  1. Ensure that you have upgraded to version 8.2.0 (or later) of the Facebook SDK for Android. If your app is built to target Android 11 (API level 30) and your users are on Android 11, alternative non-webview login mechanisms provided by the SDK will not work unless you upgrade to or past 8.2.0.
  2. Ensure that your app has configured support for Custom Tabs properly. (Not sure what Custom Tabs are? Check here.) To test this, ensure that you have a browser compatible with Custom Tabs (example browsers that support Custom Tabs include Chrome, Samsung Browser, etc). Next, delete the Facebook app from your device if you have it installed. Finally, login from your app. You should see a window open in the external browser rather than in a native WebDialog.
    If you do not see an external browser launch, follow these instructions:
    Option 1:
    Ensure your app is using version 8.2.0 or later of the Facebook SDK for Android. If so, you should not need to make any modifications to your Android manifest. If you have any items referencing “CustomTabMainActivity” or “CustomTabActivity”, remove them.
    Option 2:
    Configure your Custom Tabs intent filter exactly following the instructions here.
    Try Option 1 first and then use Option 2 if Option 1 does not work after testing. There may be cases where we cannot automatically configure your intent filter because of mismatches between the defined ${applicationId} constant and your package name.
  3. If you have already completed steps 1-3 and have released your app to users, users who are on older versions of your application will see an error message when they attempt to login from a webview, prompting them to upgrade to the newest version of your application. If you have mechanisms to force auto-upgrades for existing installations of your application or to prompt your users to upgrade, we encourage you to use them to limit affected users.
  4. If your app is used primarily on devices which are unable to host the login experience in an external browser, we encourage you to integrate Device Login as an alternative login mechanism.

Should i care about this?, i could still use 1.02?
Many thanks all fo your advice.
Regards!!
 

Angel Garcia

Member
Licensed User
Thanks Erel,
I just tried the library and I still have this compiling error:
1629654356695.png


The variable are declared and initialized in the starter service just like the old 1.02 integration:

fb1:
Sub Process_Globals
Public facebook As FacebookSdk
...
End Sub

And on Service_Create:
fb:
facebook.Initialize2("fb")

I tried also after jetify the libraries.

it works fine with 1.02.
Am i missing something??

Pleas help!!
Many thanks to all in advance!!
Ángel
 
Upvote 0

agraham

Expert
Licensed User
From this path
\src\com\stylist\ieapplications\main.java:1093
It looks like the error in in your Main module, not Starter. Do you have a leftover call to Initialize2 in there without a declared facebook variable?

EDIT: I took this line from post #1 but I see from the image in post#3 it is now in Starter 😟
 
Upvote 0

Angel Garcia

Member
Licensed User
Hello Agraham,
Thanks for the advice, i just double check and I have no additional calls to Initialize2, i have a single facebooksdk variable on the starter service, and just one call to Initialize2 in the service_create method. The previous log error of the first post was related because i put before the facebooksdk variable in the main module because i was tryin different ways to make it work. But i put it back as it was before, the facebooksdk variable on the starter service. The error is the same.

In the main module (Login section) i perform the calls to Sign In like this:
fb1:
Starter.facebook.SignIn

I use this calls for starter.facebook.SignIn, SignOut methods without any problem so far with 1.02

With this library is different? if so maybe i need a fresh example. But i'm not sure if this is related.

Thank you all
 
Upvote 0

Angel Garcia

Member
Licensed User
Hi All,
Sorry for the late response, I just adapted the original example from this post:
to my project and still got the same error.
I just changed the google-services.json replacing it with my project file from firebase console, and changed the build configurations name. I tried 1.03 and 1.04 provided by Erel, same results. Am i missing something?, i just paste and replaced the new libraries on the Android additional libraries folder.
And still working fine with 1.02.
The weird thing is that i started to receive this error also when sign in for certain users:
error: com.google.firebase.auth.FirebaseAuthUserCollisionException: An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.

Is someone facing same issue?
Many thanks in advance!
 
Upvote 0
Top