Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

UnityPlayerActivity.java uses or overrides a deprecated API.

Discussion in 'Android' started by tangyinglin0228, Apr 24, 2020.

  1. tangyinglin0228

    tangyinglin0228

    Joined:
    Apr 23, 2018
    Posts:
    16
    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)
     

    Attached Files:

    • new.txt
      File size:
      81.4 KB
      Views:
      591
    Last edited: Apr 24, 2020
  2. tangyinglin0228

    tangyinglin0228

    Joined:
    Apr 23, 2018
    Posts:
    16
    Update: I searched for another error and someone suggested that removing the Ads plugin. And finally it's working now.
     
  3. DungDajHjep

    DungDajHjep

    Joined:
    Mar 25, 2015
    Posts:
    107
    https://github.com/facebook/facebook-sdk-for-unity/issues/386
    https://forum.unity.com/threads/cant-build-with-multidex-enabled.773348/


    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:

    1. Go to Edit->Project Settings->Player->Publishing settings->Tick Custom Properties Gradle Template
    2. Go to the newly generated gradleTemplate.properties and add these lines to the top:
    android.useAndroidX=true
    android.enableJetifier=true
     
  4. wolfomat

    wolfomat

    Joined:
    Oct 19, 2014
    Posts:
    24
    hey - this did not work for me :(
    using unity 2019.4.5f1
     
  5. abhi6163

    abhi6163

    Joined:
    May 1, 2014
    Posts:
    3
    if your game has unity ads go to ads service in advance just uncheck the built in ads extensions.
     
    Thoma1207 likes this.
  6. acartayfun1

    acartayfun1

    Joined:
    Dec 22, 2017
    Posts:
    8
    unity Ads unchecked and thats works, Thanks
     
  7. pihels

    pihels

    Joined:
    May 13, 2018
    Posts:
    8
    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.
     
  8. White_Wabbit

    White_Wabbit

    Joined:
    Aug 16, 2019
    Posts:
    10
    I don't have unity ads
     
    oxalis22 likes this.
  9. Scattered_Gaming_Studio

    Scattered_Gaming_Studio

    Joined:
    Apr 29, 2020
    Posts:
    1
    DungDajHjep, post: 5975267, member: 804466"]https://github.com/facebook/facebook-sdk-for-unity/issues/386
    https://forum.unity.com/threads/cant-build-with-multidex-enabled.773348/


    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:

    1. Go to Edit->Project Settings->Player->Publishing settings->Tick Custom Properties Gradle Template
    2. 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
     
  10. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    188
    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
     
  11. EdgarasArt

    EdgarasArt

    Joined:
    May 21, 2015
    Posts:
    11
    Any luck solving it?
     
  12. gamestrigge

    gamestrigge

    Joined:
    Jun 5, 2017
    Posts:
    1
     
  13. fathiridaa

    fathiridaa

    Joined:
    Oct 18, 2020
    Posts:
    1
    I had the same problem anyway, is there anyone who solved it?
     
  14. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    114
  15. santosh810666

    santosh810666

    Joined:
    Sep 18, 2012
    Posts:
    5
    instead of ar core i install ar foundation for my case
     
  16. adrianccee

    adrianccee

    Joined:
    May 10, 2020
    Posts:
    1
    The same. Please help!
     
  17. Personuo

    Personuo

    Joined:
    Mar 19, 2014
    Posts:
    112
    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
     
  18. ajith_sreenivasan

    ajith_sreenivasan

    Joined:
    Aug 29, 2018
    Posts:
    7
    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?
     
  19. TibiTibith

    TibiTibith

    Joined:
    Mar 8, 2015
    Posts:
    22
    GODSENT! Thank you, sir! After 3 days of banging my head against a wall, I finally managed to get a build working! Thank you!
     
    SpicyCatGames likes this.
  20. Cippman

    Cippman

    Joined:
    Sep 4, 2014
    Posts:
    12
  21. Slashik

    Slashik

    Joined:
    Jan 26, 2016
    Posts:
    6
    I am here to tell that, a simple restart fixed the issue for me. Using 2020.3.13f1
     
  22. mrchrissross

    mrchrissross

    Joined:
    Jun 20, 2019
    Posts:
    9
    My current version is: 2020.3.17f1.

    Thought I'd post my fix here for those of you who, like me, tried all of the above to no avail. Try to change Minimum API Level to Android 5.0. This resolved my issue immediately.
     
    mkssanudeep and Spirit-Invoker like this.
  23. Red_Dragon69

    Red_Dragon69

    Joined:
    Sep 7, 2015
    Posts:
    78
    Another reason for this error may be, when using a custom keystore. Unity displays this error, when no password is provided in Edit->Project Settings->Player->Publishing settings-> Project Keystore and Project Key fields.
     
  24. DeLannoy04

    DeLannoy04

    Joined:
    Jul 2, 2019
    Posts:
    42
    Ohh man I have been trying to fix this issue for 5 hours now.
    But for me what helped is changing the Min API Level from 5.0 to 7.0
    Thanks :)
     
  25. brl2002

    brl2002

    Joined:
    Jan 11, 2013
    Posts:
    1
    If anyone has this issue and none of the suggestions worked for you, try checking Android SDK installed on your machine, mine had a revision for the API version that I was targeting so it said it was partially installed which I think might have been the reason my builds were failing for Android. After updating the builds worked again.
     
  26. Xertz-Games

    Xertz-Games

    Joined:
    Aug 8, 2015
    Posts:
    1
    UnityPlayerActivity.java uses or overrides a deprecated API

    If anyone has this issue and using unity mediation with admob then go to services off ads and uinstall the advertisement from package manager because UnityAdsUnityAdapter for admob auto install the unity sdk. :cool:
     
    Last edited: Apr 22, 2022
  27. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    322
    I had to change my target API level to 33 in order to fix this issue.
     
  28. zeryabahmed67

    zeryabahmed67

    Joined:
    Jan 22, 2021
    Posts:
    3

    This Work for me ! Thanks