How to update Target API Level to 30 Android

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[ ])

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.

I have the same warning "[ā€¦].android\repositories.cfg could not be loaded.
System.Threading.ThreadHelper:ThreadStart()

1 Like

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.

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 :frowning:

Are you having problem in anything, like build? If not then you can ignore this warning. Any other error are you seeing?

no other errors. the error appears as soon as I open the project.

Crate SDK.cmd

set UNITY_VERSION= 2019.2.15f1

set JAVA_HOME=c:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\
set ANDROID_HOME=c:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Data\PlaybackEngines\AndroidPlayer\
cd %ANDROID_HOME%SDK\tools\bin\

sdkmanager --update
sdkmanager "platform-tools" "platforms;android-30"
sdkmanager "platform-tools" "platforms;android-29"

Change Paths and Versions to whatever you want

1 Like

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.

Even if someone could shed some light in the file repositories.cfg What does it do?

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.

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.

Can you show the gradle error?

C:\Users\mypc\.android\repositories.cfg could not be loaded. is harmless I think

1 Like

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,

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

1 Like

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!

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

I am getting exactly these error can you help me please.

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.

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.

1 Like