dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.63k stars 1.62k forks source link

VSCode get stuck in Xcode: verifying environment #22071

Open appfrilans opened 2 weeks ago

appfrilans commented 2 weeks ago

Description

After setting up .NET MAUI extension to VSCode I always get stuck in notification: "Xcode: verifying environment" and if I run action .NET MAUI: Configure Apple..." and then "Refresh Apple Environment" i get the error "Xcode not found".

I have Xcode installed since previous and is located at the default location. I have both tried with Xcode 15.3 and previous version 15.2

Steps to Reproduce

  1. Install VSCode
  2. Install and setup C# Dev Kit extension
  3. Install and setup .NET MAUI Extension
  4. Create a new MAUI project
  5. Wait for the status to appear at the bottom of VSCode

Link to public reproduction project repository

No response

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

I was not able test on other platforms

Affected platform versions

macOS 14.4.1 macbook pro 16" M1

Did you find any workaround?

No

Relevant log output

The only log I get in terminal is:

/Users/xxxx/.zshrc:source:4: no such file or directory: /usr/local/share/chruby/chruby.sh

Could that be related?

Output is:

User preferred Java SDK path stored on Settings: /Library/Java/JavaVirtualMachines/microsoft-17.jdk/Contents/Home
Java SDK path to be used: /Library/Java/JavaVirtualMachines/microsoft-17.jdk/Contents/Home

User preferred Android SDK path stored on Settings: /Users/xxxx/Library/Android/sdk
Android SDK path to be used: /Users/xxxx/Library/Android/sdk

Android components:
    - Java SDK: installed version '17.0.11'

    Android SDK recommended required components:
    - platforms/android-34: installed version '3'
    - build-tools/34.0.0: installed version '34.0.0'
    - platform-tools: installed version '35.0.1'
    - cmdline-tools/11.0: installed version '11.0'

    Android SDK recommended optional components:
    - emulator: installed version '34.1.20'
    x system-images/android-34/google_apis/arm64-v8a: not installed.
    - system-images/android-34/google_apis_playstore/arm64-v8a: installed version '8'
    - system-images/android-30/google_apis/arm64-v8a: installed version '11'
    - system-images/android-33/google_apis/arm64-v8a: installed version '9'
    - system-images/android-31/google_apis/arm64-v8a: installed version '11'
    - system-images/android-33/google_apis_playstore/arm64-v8a: installed version '7'
    - system-images/android-29/google_apis/arm64-v8a: installed version '12'

OPTIONAL:
    - There are optional recommended Android SDK components that can be installed/upgraded. You can install it from the command palette by choosing '.NET MAUI: Configure Android', selecting 'How to configure Android', and following the instructions.
    - Another option is to use Android Studio to install the Android Sdk components.
    - Alternatively, you can try installing the components by opening a Terminal, navigating to directory '/Users/xxxx/Library/Android/sdk/cmdline-tools/11.0/bin' and then running: 'sdkmanager "system-images;android-34;google_apis;arm64-v8a"'.
    Licenses needs to be accepted running: 'sdkmanager --licenses --verbose'. After that, please verify if the android-sdk-license file exist into the licenses directory on '/Users/xxxx/Library/Android/sdk'. If this keeps failing, please try deleting the licenses folder and accepting the licenses again.
Apple platform cannot be initialized. Please verify the Xcode installation.

ACTION REQUIRED:
    - Xcode needs to be installed. You can install it from the command palette by choosing '.NET MAUI: Configure Apple', selecting 'How to configure Apple', and following the instructions.
Apple platform cannot be initialized. Please verify the Xcode installation.

ACTION REQUIRED:
    - Xcode needs to be installed. You can install it from the command palette by choosing '.NET MAUI: Configure Apple', selecting 'How to configure Apple', and following the instructions.
dotnet-policy-service[bot] commented 2 weeks ago

Thanks for the issue report @appfrilans! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.

  1. Go to the Visual Studio for Windows feedback tool or Visual Studio for Mac feedback tool to report the issue
  2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.
drasticactions commented 2 weeks ago

Xcode 15.3 is not currently supported for .NET iOS, https://github.com/dotnet/maui/issues/21057

My guess would be that you need to run xcode-select, as it's probably referencing the CLI tools and not the Xcode install

sudo xcode-select -s /path/to/xcode.app

appfrilans commented 2 weeks ago

Xcode 15.3 is not currently supported for .NET iOS, #21057

My guess would be that you need to run xcode-select, as it's probably referencing the CLI tools and not the Xcode install

sudo xcode-select -s /path/to/xcode.app

Like I said, I have both tried with Xcode 15.3 and 15.2. I have selected the right one using xcode-select as well.

appfrilans commented 2 weeks ago

Thanks for the issue report @appfrilans! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.

  1. Go to the Visual Studio for Windows feedback tool or Visual Studio for Mac feedback tool to report the issue
  2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.

I have now uninstalled Visual Studio and Visual Studio (Preview). I also tried now to reinstall Visual Studio Code and all its extensions for MAUI. Still same issue.

krisna360 commented 1 week ago

I am having the same issue, Downgrading to MAUI version 0.7.10 fixed the issue, but it is happening for me on every newer version

appfrilans commented 4 days ago

I have now reported the issue to the Visual Studio for Mac team: https://developercommunity.visualstudio.com/t/Xcode-not-found-MAUI-NET-extension-VSCo/10648989?viewtype=all