Unity 2017 Android Facebook Init error AndroidJavaException: java.lang.ClassNotFoundException: com.facebook.unity.FB

Getting this error when calling FB.Init in the Facebook-provided example scenes: AndroidJavaException: java.lang.ClassNotFoundException: com.facebook.unity.FB

Using Facebook Unity SDK 7.10.0 and Unity 2017.1.0f3, building using Gradle. I’ve tried deleting and re-adding the SDK like another similar post said worked for them but I’m still getting the issue. All Facebook settings should be correct because it works great on iOS.

Facebook SDK and Firebase Authentication SDK are the only things in the project.

This is the full logcat error:

AndroidJavaException: java.lang.ClassNotFoundException: com.facebook.unity.FB
java.lang.ClassNotFoundException: com.facebook.unity.FB
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at java.lang.Class.forName(Class.java:285)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.c(Unknown Source)
at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:148)
at com.unity3d.player.UnityPlayer$c.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.facebook.unity.FB” on path: DexPathList[[zip file “/data/app/com.redacted.redacted-1/base.apk”],nativeLibraryDirectories=[/data/app/com.redacted.redacted-1/lib/arm, /data/app/com.redacted.redacted-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]

If you use gradle build, then Proguard obscure classes for making to read difficult. (and delete if classes are duplicated)

Add next line in proguard option, for excepting facebook classes in Proguard obscuring.

-keep class com.facebook.** { *; }
-keepattributes Signature

related link is
java - Android ProGuard settings for Facebook - Stack Overflow

Maybe it will work.