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.48k stars 514 forks source link

Build is failed with iOS and VS2022 / Error MSB4057: The target "_CollectFrameworks" does not exist in the project #15178

Closed ghost closed 2 years ago

ghost commented 2 years ago

Steps to Reproduce

  1. Create a new project from VS 2022.
  2. Add some nuget packages to ios project.
    (ex) Karte.iOS.Core(0.2.0) / AppsFlyerXamarnBinding(6.4.0.3)
  3. Start a debug build on actual iPhone ( not simulator. )

Expected Behavior

Debug is started.

Actual Behavior

The bellow error is occurred.

(When using VS2019, error is not occurred.)

Environment

Version info ``` Visual Studio Enterprise 2022 for Mac Version 17.0.1 (build 72) Installation UUID: 75b9843e-fc42-425a-9415-1c8ae6585b8f Runtime .NET 6.0.3 (64-bit) Architecture: X64 Roslyn (Language Service) 4.1.0-3.22075.3+592501cbb9c9394072a245c15b3458ff88155d85 NuGet バージョン: 6.0.0.262 .NET SDK (x64) SDK: /usr/local/share/dotnet/sdk/6.0.300/Sdks SDK バージョン: 6.0.300 3.1.419 MSBuild SDK: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks .NET ランタイム (x64) ランタイム: /usr/local/share/dotnet/dotnet ランタイム バージョン: 6.0.5 3.1.25 Xamarin.Profiler バージョン: 1.8.0.19 場所: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler Updater バージョン: 11 Xamarin Designer Version: 17.1.5.90 Hash: 53f47efde Branch: remotes/origin/d17-0-vsmac Build date: 2022-05-27 13:34:26 UTC Apple Developer Tools Xcode 13.4 (20503) Build 13F17a Xamarin.Mac Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version. Xamarin.iOS Version: 15.10.0.4 (Visual Studio Enterprise) Hash: 874bc6428 Branch: d17-2 Build date: 2022-05-11 16:14:32-0400 Xamarin.Android バージョン: 12.3.0.3 (Visual Studio Enterprise) コミット:xamarin-android/d17-2/bbba5a2 Android SDK: /Users/PC20193752/Library/Developer/Xamarin/android-sdk-macosx サポートされている Android バージョン: 12.0 (API レベル 31) SDK コマンドライン ツールのバージョン: 5.0 SDK プラットフォーム ツールのバージョン: 31.0.3 SDK ビルド ツールのバージョン: 30.0.3 ビルド情報: Mono: adf1bc4 Java.Interop: https://github.com/xamarin/java.interop/commit/9760f0a9 ProGuard: https://github.com/Guardsquare/proguard/commit/912d149 SQLite: https://github.com/xamarin/sqlite/commit/7b1e016 Xamarin.Android Tools: https://github.com/xamarin/xamarin-android-tools/commit/fc3c2ac Microsoft Build of OpenJDK Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk 11.0.12 Android Designer EPL コードは、ここで入手できます。 https://github.com/xamarin/AndroidDesigner.EPL Eclipse Temurin JDK Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk 1.8.0.302 Android Designer EPL コードは、ここで入手できます。 https://github.com/xamarin/AndroidDesigner.EPL Android SDK Manager Version: 17.2.0.37 Hash: 7f5a6ef Branch: remotes/origin/d17-2 Build date: 2022-05-27 13:34:31 UTC Android Device Manager Version: 0.0.0.1116 Hash: e47e6c8 Branch: remotes/origin/d17-2 Build date: 2022-05-27 13:34:31 UTC Build Information Release ID: 1700010072 Git revision: 2021f8e0ca881ea4c49e875efa90718e6206880c Build date: 2022-05-27 13:32:16+00 Build branch: release-17.0 Build lane: release-17.0 Operating System Mac OS X 12.4.0 Darwin 21.5.0 Darwin Kernel Version 21.5.0 Tue Apr 26 21:08:22 PDT 2022 root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64 ```

Build Logs

Error MSB4057: The target "_CollectFrameworks" does not exist in the project

Example Project (If Possible)

rolfbjarne commented 2 years ago

Thank you for your feedback!

For us to investigate this further, could you please provide your full build log, as explained here: https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#build-logs

We look forward to hearing from you!

ghost commented 2 years ago

Hi @bc-ksato. 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

@rolfbjarne

Thank you for your confirming!! This is binlog with error, please confirm it.

Thank you.

msbuild.binlog.zip

rolfbjarne commented 2 years ago

This is the full error:

/Users/yuka/.nuget/packages/xamarin.swift/1.0.4/build/xamarinios/Xamarin.Swift.targets(29,135): error MSB4057: ターゲット "_CollectFrameworks" はプロジェクト内に存在しません。 [/Users/yuka/Projects/test/test/test.iOS/test.iOS.csproj]

That comes from the Xamarin.Swift Nuget, and you'll have to raise an issue with them.

Macjon commented 2 years ago

I've created a ticket at https://github.com/Flash3001/Xamarin.Swift/issues/54

Macjon commented 2 years ago

@bc-ksato when you update xamarin.swift (1.0.11) to the latest version, the bug should be fixed.