7

I got this error on facebook SDK. I'm using androidx to my support library enter image description here

heres my gradle enter image description here

looking into the activity itself uses supportv4 libraries enter image description here whats the possible fix here?

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
Rashid
  • 1,700
  • 1
  • 23
  • 56

3 Answers3

4

I solved it by adding this two lines in gradle.properties

android.useAndroidX=true
android.enableJetifier=true
Sway
  • 56
  • 1
3

Try this use latest dependencies

implementation 'com.facebook.android:facebook-android-sdk:4.39.0'
implementation 'com.facebook.android:facebook-share:4.39.0'

Update

AFAIK the current SDK of facebook does not support with AndroidX

You can check here

Facebook SDK for Android

Facebook SDK for Android Changelog 4.x

4.39.0 - December 5, 2018

Modified

In-app purchase auto logging is turned on by default. Android auto-logged purchases can be verified with uploaded credentials. Lean More

Fixed

Various bug fixes

UPDATE 2

i have reported a bug

here is the Latest Response from Facebook Team

Hi Nilesh,

Thanks for reaching out. I'm afraid the current SDK doesn't support AndroidX. Unfortunately I don't have a timeline on when support for the library will be released, but stay tuned to our developer channels for any announcements in the future.

Regards, Marc

enter image description here

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
  • 1
    thanks for this. hopefully they will support the soonest – Rashid Dec 17 '18 at 06:58
  • 1
    The latest change on this bug "Just resetting this report's status as closed by design." is rather disappointing. – Henry Dec 22 '18 at 06:50
  • @Nilesh I didn't get the below status for the bug you file on FB. It is resolved or still pending? Hi Nilesh, Just resetting this report's status as closed by design. Thanks, Marc – Abhijit Kurane Mar 15 '19 at 05:08
  • @AbhijitKurane the bug report status is closed by design – AskNilesh Mar 15 '19 at 05:12
  • @NileshRathod thanks for the info. I was about to start my new project and I'm just confused to take the decision to follow the androidx or old support libraries (till 28 version number). Just wondering how could I follow the FB integration in case I start with androidx. Your suggestions will be helpful. – Abhijit Kurane Mar 16 '19 at 18:40
  • 1
    @AbhijitKurane, you can have both. Just enable android x and the jetifier in your build and all libraries you use based on support will be automatically changed for using androidx. – Snicolas Mar 27 '19 at 14:25
  • @Snicolas thanks for responding. Good to know that I'm following the same. – Abhijit Kurane Mar 28 '19 at 17:02
0

The issue was caused by using android button widget in layout, this can be bypassed by using the facebook login programmatically:

refer this thread for programmatically using facebook login: Facebook authentication without login button