無法在物理設備上部署任何 Xamarin iOS 應用。也許你們中的某些人已經遇到過同樣的問題并且知道解決方法?
Xcode:版本 14.0 (14A309) Visual Studio for Mac:17.3.4(內部版本 4)
嘗試除錯時出現以下錯誤。我已經多次嘗試清理專案并洗掉 bin 和 obj 檔案夾:
Target _CopyAppConfigFile:
Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
Target CopyFilesToOutputDirectory:
Xamarin.iOS -> .../Xamarin/Xamarin.iOS/bin/iPhone/Debug/Xamarin.iOS.exe
Target _CopyResourcesToBundle:
Skipping target "_CopyResourcesToBundle" because all output files are up-to-date with respect to the input files.
Target _WriteAppManifest:
Skipping target "_WriteAppManifest" because all output files are up-to-date with respect to the input files.
Target _CompileToNative:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Xamarin/Xamarin.iOS/obj/iPhone/Debug/device-builds/iphone14.2-16.0/response-file.rsp
Xamarin.iOS 15.12.0.2 (d17-3: 87f98a75e) using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk
Compilation failed with code 1, command:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Wno-receiver-forward-class -Wno-objc-missing-super-calls -Wno-unguarded-availability-new -stdlib=libc -gdwarf-2 -std=c 14 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/SDKs/MonoTouch.iphoneos.sdk/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk -Qunused-arguments -miphoneos-version-min=9.0 -arch arm64 -c -o /Xamarin/Xamarin.iOS/obj/iPhone/Debug/device-builds/iphone14.2-16.0/mtouch-cache/arm64/registrar.o -x objective-c -D DEBUG /Xamarin/Xamarin.iOS/obj/iPhone/Debug/device-builds/iphone14.2-16.0/mtouch-cache/registrar.m
In file included from /Xamarin/Xamarin.iOS/obj/iPhone/Debug/device-builds/iphone14.2-16.0/mtouch-cache/registrar.m:3:
/Xamarin/Xamarin.iOS/obj/iPhone/Debug/device-builds/iphone14.2-16.0/mtouch-cache/registrar.h:112:9: fatal error: 'CHIP/CHIP.h' file not found
#import <CHIP/CHIP.h>
^~~~~~~~~~~~~
1 error generated.
MTOUCH : error MT4109: Failed to compile the generated registrar code. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
Done building target "_CompileToNative" in project "Xamarin.iOS.csproj" -- FAILED.
嘗試部署發布版本時,我得到:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch -sdkroot "/Applications/Xcode.app/Contents/Developer" --installdev ".../Xamarin.iOS/bin/iPhone/Release/Xamarin.iOS.app" --device ios "--devname=iPhone 13 Pro" --install-progress
error HE0004: Could not load the framework 'DVTITunesSoftwareServiceFoundation' (path: /Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation):
dlopen(/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation, 0x0001): Library not loaded: '@rpath/ContentDelivery.framework/Versions/A/ContentDelivery'
Referenced from: '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/DVTITunesSoftwareServiceFoundation'
Reason: tried: '/usr/lib/swift/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/lib/mlaunch/mlaunch.app/Contents/MacOS/../Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/usr/lib/swift/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/lib/mlaunch/mlaunch.app/Contents/MacOS/../Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/System/Library/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file)
Application could not be uploaded to the device.
uj5u.com熱心網友回復:
我有一個類似的問題。我已將 xcode 更新為 14,并且 Visual Studio(來自 Windows)停止使用 xamarin.ios 除錯/構建。我需要將 xcode 降級到以前的版本以使其恢復正常。
uj5u.com熱心網友回復:
Apple 在一夜之間發布了 Xcode 14,它在我的機器上自動更新,所以它現在是正式使用的版本,但仍然不支持使用 VS Mac Preview 構建 Xamarin 應用程式。:(
uj5u.com熱心網友回復:
我建議降級到以前版本的 XCode(例如https://download.developer.apple.com/Developer_Tools/Xcode_13.4.1/Xcode_13.4.1.xip如果以開發人員身份登錄)
在這里你可以選擇你想要的 XCode 版本:https ://developer.apple.com/download/all
您可以并排安裝多個 XCode 版本。用于sudo xcode-select -s /path/to/XCode.app
在它們之間切換。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/507667.html
下一篇:在Xamarin表單中將x:DataType設定為ViewModel時,CollectionView專案不會更新