Search Issue Tracker
Fixed
Fixed in 2021.3.36f1
Votes
0
Found in
2021.3.34f1
Issue ID
UUM-62275
Regression
No
[Android] The Android Player SDK path is not found when using the CMD Line Tools 2.1
Reproduction steps:
1. Create or open a project
2. Inside the Editor, build and run the Player (File > Build And Run)
Note: If you're using Unity built from source, tweak Android SDK in Preferences->External Tools, it should point to path with a whitespace, for ex.,
{code:java}
C:\Program Files\Unity3D\2021.3.34f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK {code}
Expected result: No error is thrown and builds succeed
Actual result: Builds fail with "Could not find or load main class Files\Unity\Hub\Editor\2021.3.34f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\cmdline-tools\2.1\bin.." error
Reproducible with: 2021.3.34f1
Reproducible on: Windows 10 (user's), Windows 11 (user's)
Not reproducible on: No other environment tested
Notes:
- The issue was not reproduced locally
- The issue can also impact target API levels, preventing APIs higher than 30 from being displayed
- “Failed getting available Android API levels. Make sure your android sdk tools version is 25 or higher and you have internet connection." error can also be seen inside the Editor.log file
Known workarounds:
- Switch to a lower version of the 2021.3 LTS
- Upgrade to the 2022.3 LTS
- Install the Editor version under the "C:\Unity\Editor" location
- Alter the "Editor\Data\PlaybackEngines\AndroidPlayer\SDK\cmdline-tools\2.1\bin\sdkmanager.bat" file:
set DEFAULT_JVM_OPTS={*}-Dcom.android.sdklib.toolsdir=%~dp0\..{*}
line to
set DEFAULT_JVM_OPTS={*}"-Dcom.android.sdklib.toolsdir=%~dp0\.."{*}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Resolution Note (fix version 2021.3.36f1):
This fix introduces a warning with information on how to work around this issue