Open jbtdevgit opened 5 months ago
It seems like the cmdline tools version of https://developer.android.com/studio is v12.0
. Do anyone knows where can I download the v11.0
? So I can try if that would work.
Assigning to @tondat to take a first look
Any news for this? Since it has been 2 weeks and we are using mac and vs mac is not an option for us anymore. Thank you.
We can now close this one, the extensions were updated and can finally see my cmdline tools shown below
Re opening this issue, unfortunately Android
cannot run with cmdline-tools
of 12.0
shown on image below
Android Studio can detect JDK/SDK properly. Launching has no issue as well.
Meh, I guess shutting down VS Mac is not a good idea if prioritisation of updates for tooling is this bad. Looks awful considering VS code is a recommended tool to develop a MAUI project for mac.
@tondat @mauroa Can this be looked at again please?
I just out of despair renamed the Android/sdk/cmdline-tools/latest folder to Android/sdk/cmdline-tools/11.0 and maui found it and it works. I have 12.0 version of cmdline tools
I replicated the work item internally and we will work on the fix. Good to know that the workaround of renaming the folders worked, at least to unblock the scenario. Thanks
I just out of despair renamed the Android/sdk/cmdline-tools/latest folder to Android/sdk/cmdline-tools/11.0 and maui found it and it works. I have 12.0 version of cmdline tools
Can Confirm. " - cmdline-tools/11.0 (version: '12.0'): installed."
This issue has been fixed, please install the latest VS Code MAUI pre-release in order to get the fix. Feel free to reopen this ticket in case you still experience any related issue. Thanks for your help.
The work-around of renaming the folder to 11.0 does not work for me. Nor does it work with the latest pre-release.
Reopening this because a customer has reached out having this issue, details to follow
Thanks @maddymontaquila, adding some details. Got a fairly newly setup machine with Rider, VS Code, Android SDK installed, and latest bits and pieces from .NET 8. Rider works just fine, pointing all settings for VS Code and the plugin to the same SDK and it still fails.
I tried issuing this from the command line: dotnet build -t:InstallAndroidDependencies -f:net8.0-android -p:AndroidSdkDirectory="<AndroidSdkPath>" -p:JavaSdkDirectory="<JavaSdkPath>" -p:AcceptAndroidSDKLicenses=True
(with the correct paths) and that yields the following:
dotnet build -t:InstallAndroidDependencies -f:net8.0-android -p:AndroidSdkDirectory="/Users/fekberg/Library/Android/sdk" -p:JavaSdkDirectory="/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home" -p:AcceptAndroidSDKLicenses=True
MSBuild version 17.8.3+195e7f5a3 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.52/tools/Xamarin.Installer.Common.targets(12,3): warning : Dependency `platforms;android-34` should have been installed but could not be resolved. You can attempt to install it with: `/Users/fekberg/Library/Android/sdk/cmdline-tools/11.0/bin/sdkmanager --install "platforms;android-34"` [/Users/fekberg/Code/my-app/MyApp/MyApp.csproj::TargetFramework=net8.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.52/tools/Xamarin.Installer.Common.targets(12,3): warning : Dependency `build-tools;34.0.0` should have been installed but could not be resolved. You can attempt to install it with: `/Users/fekberg/Library/Android/sdk/cmdline-tools/11.0/bin/sdkmanager --install "build-tools;34.0.0"` [/Users/fekberg/Code/my-app/MyApp/MyApp.csproj::TargetFramework=net8.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.52/tools/Xamarin.Installer.Common.targets(12,3): warning : Dependency `platform-tools` should have been installed but could not be resolved. You can attempt to install it with: `/Users/fekberg/Library/Android/sdk/cmdline-tools/11.0/bin/sdkmanager --install "platform-tools"` [/Users/fekberg/Code/my-app/MyApp/MyApp.csproj::TargetFramework=net8.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.52/tools/Xamarin.Installer.Common.targets(12,3): warning : Dependency `cmdline-tools;11.0` should have been installed but could not be resolved. You can attempt to install it with: `/Users/fekberg/Library/Android/sdk/cmdline-tools/11.0/bin/sdkmanager --install "cmdline-tools;11.0"` [/Users/fekberg/Code/my-app/MyApp/MyApp.csproj::TargetFramework=net8.0-android]
Build succeeded.
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.52/tools/Xamarin.Installer.Common.targets(12,3): warning : Dependency `platforms;android-34` should have been installed but could not be resolved. You can attempt to install it with: `/Users/fekberg/Library/Android/sdk/cmdline-tools/11.0/bin/sdkmanager --install "platforms;android-34"` [/Users/fekberg/Code/my-app/MyApp/MyApp.csproj::TargetFramework=net8.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.52/tools/Xamarin.Installer.Common.targets(12,3): warning : Dependency `build-tools;34.0.0` should have been installed but could not be resolved. You can attempt to install it with: `/Users/fekberg/Library/Android/sdk/cmdline-tools/11.0/bin/sdkmanager --install "build-tools;34.0.0"` [/Users/fekberg/Code/my-app/MyApp/MyApp.csproj::TargetFramework=net8.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.52/tools/Xamarin.Installer.Common.targets(12,3): warning : Dependency `platform-tools` should have been installed but could not be resolved. You can attempt to install it with: `/Users/fekberg/Library/Android/sdk/cmdline-tools/11.0/bin/sdkmanager --install "platform-tools"` [/Users/fekberg/Code/my-app/MyApp/MyApp.csproj::TargetFramework=net8.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.52/tools/Xamarin.Installer.Common.targets(12,3): warning : Dependency `cmdline-tools;11.0` should have been installed but could not be resolved. You can attempt to install it with: `/Users/fekberg/Library/Android/sdk/cmdline-tools/11.0/bin/sdkmanager --install "cmdline-tools;11.0"` [/Users/fekberg/Code/my-app/MyApp/MyApp.csproj::TargetFramework=net8.0-android]
4 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.77
It's complaining about cmdline-tools not being installed, but it definitely is and I also tried the "hack" of copying/renaming the folder:
See here:
@fekberg Thank you for your feedback!
Could you try to install a new cmdline-tools with the following instructions:
1- open a terminal
2- move to folder <android-sdk>/cmdline-tools/11.0/bin
./sdkmanager "cmdline-tools;12.0"
<android-sdk>/cmdline-tools/12.0/bin
./sdkmanager --licenses --verbose
<android-sdk>/cmdline-tools/11.0
If that does not work, as a workaround could you try to install a new android-sdk using the following instructions: Install android-sdk using the InstallAndroidDependencies target
After that, we need to configure the Android SDK to be used on MAUI by adding the MSBuild property AndroidSdkDirectory on the csproj file, or by specifying the Android SDK Preferred Path from the Settings page to determine the path at the user/workspace level. You can also set the ANDROID_HOME environment variable to define the path at machine level (recommended).
Please let me know if that works for you.
We look forward to hearing from you!
@tondat Running ./sdkmanager
gives me a LinkageError telling me the SdkManagerCli has been compiled with a more recent version of the Java Runtime.
The second part, about using InstallAndroidDependencies
, that is exactly what I posted above isn't it? I've pointed it to the correct SDK path, I've set all environment variables but that still doesn't help.
My workaround is to remove the cmdline-tools/latest folder (I am not sure when it got installed, but it's there.. it's not a symbolic link, but a real directory.)
drwxr-xr-x 7 billylo staff 224 26 May 09:21 11.0
drwxr-xr-x 7 billylo staff 224 26 May 09:35 12.0
drwxr-xr-x 7 billylo staff 224 26 May 08:34 13.0
drwxr-xr-x 7 billylo staff 224 25 May 21:42 7.0
drwxr-xr-x 7 billylo staff 224 25 May 21:11 latest
Describe the Issue
My cmdline-tools is not being detected by the .NET MAUI extension
Steps To Reproduce
No response
Expected Behavior
No response
Environment Information