Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to update Target API Level to 30 Android

Discussion in 'Android' started by Only4gamers, Aug 4, 2020.

  1. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    Hello everyone,
    When i submitted my game to Google Play it shows that my game must support at least Android API 29. While my Unity version only support Up to Android API 28. So, I updated my Unity Editor to the latest LTS version and also updated NDK, SDK etc from Unity Hub. But problem not solved. So, I downloaded latest SDK from Android Studio and changed my SDK path to C:\Users\Hi\AppData\Local\Android\Sdk in External Tools
    But it still not showing 29 and 30.

    Other than that I am getting these warnings in Console:
    1)
    Observed package id 'tools' in inconsistent location 'C:\Users\Hi\AppData\Local\Android\Sdk\tempToolsDir' (Expected 'C:\Users\Hi\AppData\Local\Android\Sdk\tools')
    System.Reflection.MethodBase:Invoke(Object, Object[])

    2)
    File C:\Users\Hi\.android\repositories.cfg could not be loaded.
    System.Threading.ThreadHelper:ThreadStart()

    and in External Tools my NDK is also showing warning that "you are missing the recommended Android NDK..." while I downloaded everything from Unity Hub.
    Please help.
     
  2. livium

    livium

    Joined:
    Aug 3, 2018
    Posts:
    27
    I have the same warning "[...].android\repositories.cfg could not be loaded.
    System.Threading.ThreadHelper:ThreadStart()
     
    Only4gamers likes this.
  3. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    I solved my all other warnings and this warning also gone itself. I don't think this is something serious. If you need help on other warnings then I can explain how I solved.
     
  4. livium

    livium

    Joined:
    Aug 3, 2018
    Posts:
    27
    great! if you can tell me what you do maybe can help me also with this warning that doesn't go away. I even upgrade the Unity but no luck :(
     
  5. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    Are you having problem in anything, like build? If not then you can ignore this warning. Any other error are you seeing?
     
  6. livium

    livium

    Joined:
    Aug 3, 2018
    Posts:
    27
    no other errors. the error appears as soon as I open the project.
     
  7. Liveanimatoinscorp

    Liveanimatoinscorp

    Joined:
    Sep 29, 2016
    Posts:
    3
    Crate SDK.cmd

    Code (csharp):
    1. set UNITY_VERSION= 2019.2.15f1
    2.  
    3. set JAVA_HOME=c:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\
    4. set ANDROID_HOME=c:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Data\PlaybackEngines\AndroidPlayer\
    5. cd %ANDROID_HOME%SDK\tools\bin\
    6.  
    7. sdkmanager --update
    8. sdkmanager "platform-tools" "platforms;android-30"
    9. sdkmanager "platform-tools" "platforms;android-29"
    10.  
    Change Paths and Versions to whatever you want
     
    livium likes this.
  8. Brad3355

    Brad3355

    Joined:
    Aug 5, 2017
    Posts:
    14
    I get the same Warning

    File C:\Users\Brad\.android\repositories.cfg could not be loaded.
    System.Threading.ThreadHelper:ThreadStart()

    Project works Perfectly in Editor. Not on device. I can build and install apk, but nothing saves or loads from playerprefs. I thought it was a Playerprefs problem so I brought and installed Easy Save 3. I changed all my Key Exists, Saving and Loading Actions over to the Easy Save 3 System, but still nothing seems to save or load. Have tested Easy Save in new project, no problems there, so it must be in my project. Not sure if my problem is related to the above warning. My project used to work, not sure when problem started because I don't continually build and install on device. I probably need to do daily device build checks to identify these problems quicker. Project had problem it Unity 2018.3.4f1, just upgraded to 2019.4.15f1, managed to get rid of all the upgrade errors. Problem still exists, and this warning. Also I used Playmaker.
     
  9. Brad3355

    Brad3355

    Joined:
    Aug 5, 2017
    Posts:
    14
    Even if someone could shed some light in the file repositories.cfg What does it do?
     
  10. Brad3355

    Brad3355

    Joined:
    Aug 5, 2017
    Posts:
    14
    My problem was fixed by not splitting the apk. Don't know why yet but it was defiantly the problem. I can reproduce by ticking the box again, weird but true. The error mentioned above has now too, but I think that disappeared when I used the latest android sdk rather than the one Unity Hub downloaded.
     
  11. nextage575

    nextage575

    Joined:
    Nov 4, 2019
    Posts:
    20
    Hi i need lil help,
    my project was working fine and sudden raised warning
    File C:\Users\mypc\.android\repositories.cfg could not be loaded.
    System.Threading.ThreadHelper:ThreadStart()
    and after this when i build it takes to much time and at the end causes gradle error
    Please help me.
     
  12. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Can you show the gradle error?

    Code (CSharp):
    1. C:\Users\mypc\.android\repositories.cfg could not be loaded.
    is harmless I think
     
    nextage575 likes this.
  13. nextage575

    nextage575

    Joined:
    Nov 4, 2019
    Posts:
    20
    Yes i have tried to create build and its working fine, i just thought it might create some issue with ads but everything is working fine,
     
  14. Ellukitas_123

    Ellukitas_123

    Joined:
    Jan 20, 2021
    Posts:
    21
    I have the same warning C:\Users\mypc\.android\repositories.cfg could not be loaded.
    System.Threading.ThreadHelper:ThreadStart

    And the coroutines in device don't work fine

    Since I use unity remote 5 I have this warning and my game brokes
     
    Sammyueru1 likes this.
  15. Sammyueru1

    Sammyueru1

    Joined:
    Jul 20, 2020
    Posts:
    45

    I actually have a problem like that too when trying to run my game on The Oculus Quest my Oculus Quest crashes.
    Anybody know the answer?
    I need to be able to run within Unity I don't wanna have to build each time I want to run the game for testing!
     
  16. lgomeszanforlin

    lgomeszanforlin

    Joined:
    Jul 16, 2019
    Posts:
    5
    I was getting the same warning and was able to solve it.

    I believe I got this error because I had installed my Android SDK using Android studio and in it I had selected only a few API versions (23 - 28). In Unity under Player/Target API I had it set to "max available" and since there were options higher than 28 Unity kept complaining that it couldn't find those versions. I simply set the target API to be the max I had installed "28" and the warning stopped appearing.

    Another solution may be to actually install these later versions in your Android Studio
     
  17. soumya_alphpi

    soumya_alphpi

    Joined:
    Mar 3, 2021
    Posts:
    6
    I am getting exactly these error can you help me please.
     
  18. Danny_KUANTIKO

    Danny_KUANTIKO

    Joined:
    Apr 8, 2020
    Posts:
    1
    In my case... targeting for quest on API Level 23 the new Android studio didn´t resolve the issue.
    android\repositories.cfg could not be loaded.
    System.Threading.ThreadHelper:ThreadStart ()
    I´ll keep investigating just for the sake of it. Because my project works. But it is annoying.
     
  19. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    This warning comes from Android SDK's sdkmanager. The warning is completely harmless. To get rid of it just create an empty file named repositories.cfg in the location that is specified by the warning.
     
    hamakmak likes this.