Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Exception: OBSOLETE - Providing Android resources in Assets/Plugins/Android/assets was removed

Discussion in '2021.2 Beta' started by EyeDev44, Sep 19, 2021.

  1. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    I use 2021.2.0b12.3482. Right after update it became unavailable to build an android version because of error. Notice that Assets/Plugins/Android/assets contains the same 2 files sa before. AAR files are also here.

    Code (CSharp):
    1. Exception: OBSOLETE - Providing Android resources in Assets/Plugins/Android/assets was removed, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of the Manual for more details.
    2. UnityEditor.Android.PostProcessor.Tasks.CheckUserResources.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f11f51e404a14fc28663376d5ae6cde8>:0)
    3. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f11f51e404a14fc28663376d5ae6cde8>:0)
    4. UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at <f11f51e404a14fc28663376d5ae6cde8>:0)
    5. UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at <f11f51e404a14fc28663376d5ae6cde8>:0)
    6. UnityEditor.PostprocessBuildPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target) (at <8a8bf68eb0e443b196386a376561c6a1>:0)
    7. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    8.  
    9.  
    10. Error building Player: Exception: OBSOLETE - Providing Android resources in Assets/Plugins/Android/assets was removed, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of the Manual for more details.
    11.  
     
  2. aubreypuan

    aubreypuan

    Joined:
    Mar 30, 2017
    Posts:
    9
    Please help, I am having this issue too.
     
  3. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    Haven't fixed. 2021.2.01 stable. still not able to build for android.
     
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    https://docs.unity3d.com/2021.2/Documentation/Manual/UpgradeGuide20212.html
     
  5. bagieta

    bagieta

    Joined:
    Mar 24, 2017
    Posts:
    5
    What is the problem is that this error is caused by Unity itself. In my case, it is by UDP.
    I got 2021.2.3f1 and UDP 2.2.3
    UDP is creating this folder where GameSettings.prop is located.
    I hope they will fix it soon.
     
    ShaggyShiva likes this.
  6. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    2021.2.3f1 doesn't fixed.
     
  7. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
  8. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
  9. alexisdavidson

    alexisdavidson

    Joined:
    Apr 28, 2015
    Posts:
    29
    Found any solution? Having the same issue
     
  10. J871578924

    J871578924

    Joined:
    Nov 15, 2019
    Posts:
    6
    Found any solution? Having the same issue
     
  11. galactt

    galactt

    Joined:
    Jan 27, 2022
    Posts:
    1
    what if just change the version of the unity? could smth change?
     
  12. phuong_unity

    phuong_unity

    Joined:
    Apr 25, 2018
    Posts:
    52
    For anyone facing this issue with UDP, updating to UDP 2.2.4 will resolve the issue.
     
  13. Chethan007

    Chethan007

    Joined:
    Dec 3, 2020
    Posts:
    56
    Hi , I tried to integrate Chartboost ads in my Unity Project.I got this error, Then I went to Services->UDP. In the package manager I used the latest UDP 2.2.5. But still getting the same error.
     
    tolosaoldfan likes this.
  14. gabrielesimula

    gabrielesimula

    Joined:
    May 21, 2020
    Posts:
    12
  15. Zeeppo-Games

    Zeeppo-Games

    Joined:
    May 13, 2015
    Posts:
    102
    Any solution? I don't use UDP and I'm having this bug when I try to build to Android. Unity 2021.3.2f1
     
    Mishganches likes this.
  16. fahad1594

    fahad1594

    Joined:
    May 24, 2017
    Posts:
    2
    plz resolve this issue
     
  17. youminewecraft26

    youminewecraft26

    Joined:
    Jun 10, 2020
    Posts:
    1
    Deleting the "Assets" folder in "\Assets\Plugins\Android\" seemed to fix it for me
     
  18. Zeeppo-Games

    Zeeppo-Games

    Joined:
    May 13, 2015
    Posts:
    102
    You can't just delete android's plugin folder. It contains as dependency files and resources you need to build an Android version.
     
  19. Mishganches

    Mishganches

    Joined:
    Mar 23, 2014
    Posts:
    31
  20. Leeocosta

    Leeocosta

    Joined:
    May 19, 2022
    Posts:
    1
    A exclusão da massa "Ativos" em "Ativos/Plugins/Android" funcionou perfeitamente
     
  21. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    140
    The real solution of course is to change from Unity to Unreal Engine. Everything in Unity is always broken. It's their business model.
     
  22. jd_powell

    jd_powell

    Joined:
    Jul 3, 2015
    Posts:
    5
    This same fix worked for us as well - don't delete the entire Android folder, just the Assets folder under Android in Plugins. Keep the libs folder in Android as is. Then you can do the build.
     
    TheCircadian and khadkahakku like this.
  23. BillyHansen

    BillyHansen

    Joined:
    Apr 18, 2019
    Posts:
    1
    The easiest solution for me was creating a folder named 'myLibrary.androidlib'. I copied the resources to their respective subfolders 'myLibrary.androidlib/res/values' and 'myLibrary.androidlib/res/xml' (my issue was with a network_security_config.xml resource) I also made a simple AndroidManifest at the root of the new android library folder.
     
    UnityKristy, do2, ThinhHB and 4 others like this.
  24. dtootill

    dtootill

    Joined:
    Oct 9, 2020
    Posts:
    29
    While deleting this folder does allow the build to complete, the resultant APK file is corrupt. Attempting to load it gets the error "There was a problem parsing the package".

    I'm seeing this issue on Unity 2021.3.8f1 after upgrading from Unity 2020.2.38f1. Android builds went fine on 2020; they fail with the "Providing Android resources in Assets/Plugins/Android/assets was removed" message in 2021. The Assets/Plugins/Android/assets directory contains a single file, GameSettings.prop, with a single line containing a string of apparently random characters, surrounded by comments (in all caps) saying "*** DO NOT DELETE OR MODIFY THIS FILE !! **". This warning seems accurate, given that removing the file results in an unusable APK.

    I'm on UDP 2.2.5, which is apparently what has created this file. Has anyone successfully moved it to an aar? If so, what is the process?
     
    Last edited: Aug 21, 2022
  25. Roberto_Corrales

    Roberto_Corrales

    Joined:
    Sep 25, 2018
    Posts:
    4
    Hey Dtootill, did you manages to solve it? I'm having the same issue and i've got no idea on how to solve it...
     
  26. elharasamin

    elharasamin

    Joined:
    May 2, 2021
    Posts:
    1
    Thank you this solution works for me
     
  27. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    132
    Im also seeing this error. Very odd behaviour when 2020 was fine.
    What exactly is Unity asking us to pack into this "arr"? The entire plugins folder, the "res" folder?

    Some clarity would be appreciated, or better yet, a fix.
     
    XDEmphesis likes this.
  28. ThinhHB

    ThinhHB

    Joined:
    Oct 24, 2014
    Posts:
    11
    I faced this issue while import the Chartboost SDK to unity project 2022.1.3. This solution is simple and work for me !! Thanks so much !!
     
    MAshok likes this.
  29. khadkahakku

    khadkahakku

    Joined:
    Dec 6, 2021
    Posts:
    1
    This worked for me
     
  30. drorriov

    drorriov

    Joined:
    Jun 7, 2014
    Posts:
    43
    Thank you for updating it works for you.
    I just upgraded from 2019 to 2021 (the latest TLS) and encountered this error, i tried to delete the assets folder on \Assets\Plugins\Android\ but still receiving this error, can you just explain what did you exactly do to solve it? because I don't know which plugin is causing this...
     
    tongchun_line likes this.
  31. MeHigh94

    MeHigh94

    Joined:
    May 21, 2019
    Posts:
    2
    Hello,

    Any other fixes for that? I am still encountering this issue on Unity 2021.3.14f1 LTS..
    Thanks!
     
  32. skeyll

    skeyll

    Joined:
    Dec 14, 2018
    Posts:
    3
    This error's causes and solutions are here.
    https://docs.unity3d.com/2021.2/Documentation/Manual/UpgradeGuide20212.html

    The reference way for android assets has changed, and we need manually modify this folder.
    We have two solutions.
    a. res.aar
    Zip Android/res and change the extension to aar.
    b. res.androidlib
    Create the following two files, move them to Android/res, zip res, and change the extension to androidlib.

    AndroidManifest.xml
    Code (CSharp):
    1.  
    2. <?xml version="1.0" encoding="utf-8"?>
    3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    4. package="custom.android.res" android:versionCode="1" android:versionName="1.0">
    5. </manifest>
    project.properties
    Code (CSharp):
    1.  
    2.     target=android-9 android.library=true
    3.  
    I could built with b. aar did not work.
    The original AndroidManifest creates a new res folder, so move it to tmp folder during test build.
     
    Last edited: Dec 12, 2022
  33. ashish_jangir

    ashish_jangir

    Joined:
    May 1, 2021
    Posts:
    3
    Thank you. Your solution worked for me. And for the next person looking for solution for this problem atleast open the link once he provide to get more details then only this problem can be solved.
     
  34. gagasik

    gagasik

    Joined:
    Jul 29, 2019
    Posts:
    25
    Hey, could you please provide more information on this?
     
  35. halimsantoso

    halimsantoso

    Joined:
    Nov 25, 2016
    Posts:
    1
    hello, this is how i fix res folder (my res folder added because chartboost sdk)
    move your xml folder (inside plugins/android/res) to
    myproject\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\src\main\res
    don't forget to delete .meta file inside xml folder
     
  36. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    For anyone blocked, here's a semi automatic way to unblock you.
    * Place this script https://github.com/todi1856/Android...rader/Assets/Editor/AndroidPluginsUpgrader.cs into Assets/Editor folder
    * Restart Editor
    * Open project
    * If you have Assets/Plugins/Android/<res, assets> folder present, you'll see a dialog asking about upgrade
    * Basically Unity will move Assets/Plugins/Android/<res, assets> -> Assets/Plugins/Android/<res, assets>-legacy and upon export/build will manually copy Assets/Plugins/Android/<res, assets>-legacy to unityLibrary/src/main/<res, assets> folder (excluding .meta files)

    2023-02-27: Upgraded code to also upgrade assets directory, similarly like gagasik code does.
     
    Last edited: Feb 27, 2023
  37. gagasik

    gagasik

    Joined:
    Jul 29, 2019
    Posts:
    25
    Anyone
    Thanks, here is the extended version , which also works on assets folder.

    https://github.com/Frismos/UnityUtilsHelpers/blob/main/AndroidResAssetsUpgraderPostprocessor.cs
     
    Tomas1856 likes this.
  38. MaceB

    MaceB

    Joined:
    Jun 26, 2016
    Posts:
    9
    This worked for me but then lead me to a "Type com.unity3d.player.BuildConfig is defined multiple times" error in Android Studio (I already have an AndroidManifest in Plugins > Android.) I'm sure I've written something wrong in the "simple AndroidManifest" you mentioned. Could you please provide a complete example of the simple AndroidManifest you mentioned for the network_security_config.xml?
     
    Last edited: Feb 22, 2023
  39. StoneShield

    StoneShield

    Joined:
    Nov 19, 2018
    Posts:
    1
    thank you @skeyll
    solutions b work for me also

     
  40. luizgbusiness

    luizgbusiness

    Joined:
    Mar 21, 2019
    Posts:
    1
    Tried all the solutions here, and this one was the only who worked for me.
    My issue was that I've upgraded to Unity 2021.3, and I received this message while building: "Exception: OBSOLETE - Providing Android resources in Assets/Plugins/Android/assets was removed".

    Tried the res.aar and res.androidlib, but then another message: "resource 'string/fb_login_protocol_scheme' not found", as if the strings.xml was gone or not found. But the AndroidPluginsUpgrader.cs script worked and my build was successful.
     
  41. unity_Brini_Hamdi

    unity_Brini_Hamdi

    Joined:
    Aug 4, 2018
    Posts:
    2
    Deleting the "Assets" folder in "\Assets\Plugins\Android" fix it for me in unity 2021.3.21f1
     
    chenjiechao666 likes this.
  42. arkasth

    arkasth

    Joined:
    Nov 9, 2022
    Posts:
    9
    thanks, the aar worked for me but i had to delete the res folder and res.meta.
     
  43. chenjiechao666

    chenjiechao666

    Joined:
    Jun 12, 2023
    Posts:
    4
    that`s good!
     
  44. Kujji

    Kujji

    Joined:
    Oct 20, 2021
    Posts:
    109
    I got and error while using your method with script: Resource 'xml/file_paths' not found in AndroidManifest.xml:47,
    (See the Console for details). As i understand AndroidManifest doesn't see file_paths.xml that is in res-legacy/xml/
     
  45. DucaDiMonteSberna

    DucaDiMonteSberna

    Joined:
    Jan 18, 2018
    Posts:
    79
    still getting a problem like this.
    EDIT 1: using the provided "semi-automatic method" is building something!
    EDIT 2: nope, build failed.
    EDIT 3: after various test build succeeded, but I can't pinpoint out a reason.
     
    Last edited: Nov 2, 2023
  46. Sarudan

    Sarudan

    Joined:
    May 21, 2011
    Posts:
    65
    That's just sooooo helpful. Your insights are deep...
     
  47. gamer4002

    gamer4002

    Joined:
    Feb 23, 2024
    Posts:
    1
    worked for me too