UnityPlayerActivity.java uses or overrides a deprecated API.

https://github.com/facebook/facebook-sdk-for-unity/issues/386

For anyone looking for solution.
You have to move your
implementation ‘androidx.multidex:multidex:2.0.1’
and
multiDexEnabled true
from mainTemplate.gradle to launcherTemplate.gradle and it should work.

You should activate these files first here in the Project Setting->Player->Publishing Settings

I solved it in two steps for Unity 2019.3.11f1:

  • Go to Edit->Project Settings->Player->Publishing settings->Tick Custom Properties Gradle Template
  • Go to the newly generated gradleTemplate.properties and add these lines to the top:

android.useAndroidX=true
android.enableJetifier=true

16 Likes