xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.49k stars 515 forks source link

Can't build since I updated VS for mac and xcode #16182

Closed DamienDoumer closed 2 years ago

DamienDoumer commented 2 years ago

Steps to Reproduce

I updated my VS for mac to a stable release version (17.3.6 Build 20) Then I opened my Xamarin.Forms solution as usual, to deploy and continue working on it. I received a message from the IDE telling me that I can't build because I need Xcode version 14.

I then updated xcode to version 14.0.1 (Latest Stable version), and bam, I couldn't build the app because VS for mac constantly threw this error (https://github.com/xamarin/xamarin-macios/issues/15955) After hours of reaserch, I eventually came across the GitHub issue above, saying that a work around was to set the linket to SDK only.

I did change the linker option, the error above disappeared, but when I deploy the app to my device, I get another erro (Yay) as you can see below: Waiting for the debugger to connect to ... This goes for ever, but the app never gets deployed.

Then, I researched for hours again and found a tip that mentioned I should upgrade the test device. I upgraded to the latest iOS 15 release, but the error persisted, I then upgraded to iOS 16, and it still persists.

I downloaded Xcode 14.0 thinking it might help, and told xamarin to use it to build, but nothing has changed! this still persists.

I've spent too much time on this can someone help please ? This is very frustrating.

enter image description here

Expected Behavior

My app should build and deploy on a real device as it did just before the update.

Actual Behavior

The app builds, but I wait for the debugger to connect eternally.

Environment

Version information ``` Visual Studio Community 2022 for Mac Version 17.3.6 (build 20) Installation UUID: fa84b44c-9271-4b23-810a-6e115f262fb2 Runtime .NET 6.0.5 (64-bit) Architecture: Arm64 Roslyn (Language Service) 4.3.0-3.22312.2+52adfb8b2dc71ed4278debcf13960f2116868608 NuGet Version: 6.2.1.2 .NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/6.0.401/Sdks SDK Versions: 6.0.401 6.0.400 6.0.302 MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks .NET SDK (x64) SDK Versions: 3.1.423 3.1.422 3.1.421 .NET Runtime (Arm64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 6.0.9 6.0.8 6.0.7 .NET Runtime (x64) Runtime: /usr/local/share/dotnet/x64/dotnet Runtime Versions: 3.1.29 3.1.28 3.1.27 Xamarin.Profiler Version: 1.8.0.19 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler Updater Version: 11 Apple Developer Tools Xcode 14.0 (21335) Build 14A309 Xamarin.Mac Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version. Xamarin.Android Version: 13.0.0.0 (Visual Studio Community) Commit: xamarin-android/d17-3/030cd63 Android SDK: /Users/damien/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 12.0 (API level 31) 11.0 (API level 30) 10.0 (API level 29) SDK Command-line Tools Version: 5.0 SDK Platform Tools Version: 31.0.3 SDK Build Tools Version: 30.0.3 Build Information: Mono: dffa5ab Java.Interop: xamarin/java.interop/d17-3@7716ae53 SQLite: xamarin/sqlite/3.38.5@df4deab Xamarin.Android Tools: xamarin/xamarin-android-tools/main@14076a6 Microsoft Build of OpenJDK Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk 11.0.12 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL Eclipse Temurin JDK Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk 1.8.0.302 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL Android SDK Manager Version: 17.3.0.23 Hash: 965bf40 Branch: remotes/origin/d17-3 Build date: 2022-09-22 15:21:49 UTC Android Device Manager Version: 0.0.0.1169 Hash: fafb1d5 Branch: fafb1d5 Build date: 2022-09-22 15:21:49 UTC Xamarin Designer Version: 17.3.0.208 Hash: 0de472ea0 Branch: remotes/origin/d17-3 Build date: 2022-09-22 15:21:44 UTC Xamarin.iOS Version: 16.0.0.72 (Visual Studio Community) Hash: 6756a1146 Branch: release/6.0.4xx-xcode14 Build date: 2022-09-21 08:51:06-0400 Build Information Release ID: 1703060020 Git revision: f7a6334599543f127e737d6de1f362bbe36cebca Build date: 2022-09-22 15:19:46+00 Build branch: release-17.3 Build lane: release-17.3 Operating System Mac OS X 12.6.0 Darwin 21.6.0 Darwin Kernel Version 21.6.0 Mon Aug 22 20:19:52 PDT 2022 root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64 ```

Build Logs

tj-devel709 commented 2 years ago

Hello @DamienDoumer, thanks for the feedback. It would help us look into this issue if you could provide a binlog (instructions found here: https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#build-logs).

Could you also try running 'xcode-select -p' and letting me know what the output is?

ghost commented 2 years ago

Hi @DamienDoumer. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

dalexsoto commented 2 years ago

Hello does your device have developer mode enabled? It is now required by Apple https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device

DamienDoumer commented 2 years ago

@dalexsoto hello, I already did that. I activated the dev mode. restarted the phone several times, switched xcode versions, installed pre-release versions of VS for mac, but nothing works.

DamienDoumer commented 2 years ago

Hello @tj-devel709, I did try to get the binlog, but no matter which dotnet version I use to build, it tells me my Xamarin targets are missing. I have 4 versions including dotnet 6 and 7.

Here is the command I used:

dotnet build myproject.csproj /bl:msbuild.binlog

I get this message:

error MSB4019: The imported project "/usr/local/share/dotnet/sdk/6.0.401/Xamarin/iOS/Xamarin.iOS.CSharp.targets" was not found.

I checked the folders manually, and indeed the Xamarin folder is missing, I don't know why. Any clue on how to fix this ? I think I'll have to uninstall everything and re-install again.

DamienDoumer commented 2 years ago

Please is there a way to download previous VS 2022 for mac versions ? I'll download xcode 13, use the old vs for mac version and continue working. I have an urgent release for an app to make, and I just want to be able to build and deploy. I don't need the new features from the latest VS for mac right now, I can wait till something more stable is released.

DamienDoumer commented 2 years ago

@tj-devel709 I also tried getting the binlog using the vs for mac extension mentioned in the documentation you shared, But as you can see below, I don't know why, but VS for mac doesn't have a "Gallery"tab and for some reason, there is no input to search for extensions.

Screen Shot 2022-09-29 at 5 46 49 PM

The VS for mac recent versions is different from what is described in tutorials online. Is there another way to install this extention please ?

DamienDoumer commented 2 years ago

I deleted completely VS for mac and every dotnet version installed on my mac, then did a complete reinstallation. I searched for another iOS device with iOS 15. I then re-installed vs for mac, but since I couldn't get the old versions, It still requires me to have xcode 14. And, the issue still persists. The difference is that, I can build the app now and I can deploy to a simulator. But I can't deploy to devices.

As I mentioned above, I can't get the binlog due to errors in the tooling.

This costs me so much time, but I still have no solution. Can someone help please ?

tj-devel709 commented 2 years ago

@DamienDoumer After reinstalling everything, can you still not produce the binlog from the command line? What errors are you receiving when trying to deploy to device now?

ghost commented 2 years ago

Hi @DamienDoumer. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost commented 2 years ago

Hi @DamienDoumer. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you.