UnityPlayerActivity.java uses or overrides a deprecated API.

It’s my hello world Unity and AR project. It’s so hard to build amr64 for Google Play submission using IL2CPP. Are there any chances that we can compile a 64bit bundle using Mono?

First, it’s saying that I was compiling an iOS library which I never called and removed from the package manager. I followed what the post told and use #if Unity_IOS to skip those code.

And then, it pops the following. I tried to google it but I don’t see any similar posts.
I am new to Unity and I started the project in 2019.3.1f1, and I am using 2019.3.9f1. I having no problem compiling and submitting the iOS version but because I don’t know what to do on Android.

Temp/gradleOut/unityLibrary/src/main/java/com/unity3d/player/UnityPlayerActivity.java uses or overrides a deprecated API.

UnityEditor.EditorApplication:Internal_CallGlobalEventHandler() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:442)

5760199–606409–new.txt (81.4 KB)

Update: I searched for another error and someone suggested that removing the Ads plugin. And finally it’s working now.

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

hey - this did not work for me :frowning:
using unity 2019.4.5f1

if your game has unity ads go to ads service in advance just uncheck the built in ads extensions.

1 Like

unity Ads unchecked and thats works, Thanks

Had the same error message on building recently and it appeared to be caused by not having enough disk space on my windows partition. So if these fixes don’t work you might want to check your available disk capacity.

1 Like

I don’t have unity ads

1 Like

DungDajHjep, post: 5975267, member: 804466"]Failing to build in Unity 2019.3.0f6 - Conflict with Firebase SDK - Duplicate dependencies · Issue #386 · facebook/facebook-sdk-for-unity · GitHub
Can't build with multidex enabled

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

[QUOTE="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[/QUOTE]

This worked for me…Thank you

1 Like

hm, on latest 20.1 builds ok, but AR starts to work slow as hell and all jittery and on 2019.4.16 getting this error and I don’t have ads. I had firebase in the project, but I removed everything and reimported the project, nothing helps. iOS also builds fine

Any luck solving it?

I had the same problem anyway, is there anyone who solved it?

Same.

instead of ar core i install ar foundation for my case

The same. Please help!

unity 2020 brings me too many problems, crashing, packing failure

This problem I had in version 2020.2, after 3 days of numerous attempts, I solved him because I changed too many things, I do not know how I solved it
Now this problem is back in 2020.3

I create a new project, add admob and googleplay, it’s packable, but not in my project, I don’t know where the conflict is

It works but,
If I uncheck that option, I get an orange popup: To continue using Unity Ads in your project, please import the latest Unity Ads Plugin from the Asset Store, or re-enable the internal Ads extension under the Advanced settings below.

Will this stop showing live ads in the game?

1 Like

GODSENT! Thank you, sir! After 3 days of banging my head against a wall, I finally managed to get a build working! Thank you!

1 Like

Same!