繁体   English   中英

Xamarin.iOS 应用程序无法在 Visual Studio for Mac 8.10.14 中编译

[英]Xamarin.iOS app fails to compile in Visual Studio for Mac 8.10.14

在 Visual Studio for Mac 8.10.14 中将 Xamarin iOS 应用程序在发布模式下编译到通用设备时出现以下错误:

MTOUCH : error : System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
      at System.Collections.CollectionBase.System.Collections.IList.get_Item (System.Int32 index) [0x0000d] in <92218043474744ea9d64d27064c35dcb>:0 
      at Mono.Cecil.GenericParameterCollection.get_Item (System.Int32 index) [0x00006] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.ReflectionReader.GetTypeRefFromSig (Mono.Cecil.Signatures.SigType t, Mono.Cecil.GenericContext context) [0x002ee] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.ReflectionReader.GetGenericArg (Mono.Cecil.Signatures.GenericArg arg, Mono.Cecil.GenericContext context) [0x00000] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.ReflectionReader.GetTypeRefFromSig (Mono.Cecil.Signatures.SigType t, Mono.Cecil.GenericContext context) [0x003aa] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.ReflectionReader.CreateTypeSpecFromSig (Mono.Cecil.Signatures.TypeSpec ts, System.Int32 index, Mono.Cecil.GenericContext context) [0x00000] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.ReflectionReader.GetTypeSpecAt (System.UInt32 rid, Mono.Cecil.GenericContext context) [0x00049] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.ReflectionReader.GetTypeDefOrRef (Mono.Cecil.Metadata.MetadataToken token, Mono.Cecil.GenericContext context) [0x00051] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.ReflectionReader.GetMemberRefAt (System.UInt32 rid, Mono.Cecil.GenericContext context) [0x000a1] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.Cil.CodeReader.ReadCilBody (Mono.Cecil.Cil.MethodBody body, System.IO.BinaryReader br) [0x00430] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.Cil.CodeReader.VisitMethodBody (Mono.Cecil.Cil.MethodBody body) [0x000c0] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.MethodDefinition.LoadBody () [0x00058] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.Cecil.ModuleDefinition.FullLoad () [0x00047] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.CilStripper.AssemblyStripper.FullLoad () [0x0000b] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.CilStripper.AssemblyStripper.Strip () [0x00000] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.CilStripper.AssemblyStripper.StripAssembly (Mono.Cecil.AssemblyDefinition assembly, System.String file) [0x00016] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.CilStripper.Program.StripAssembly (Mono.Cecil.AssemblyDefinition assembly, System.String output) [0x00000] in <af3d3de500394ed18df77e27b5623689>:0 
      at Mono.CilStripper.Program.Main (System.String[] arguments) [0x00064] in <af3d3de500394ed18df77e27b5623689>:0 
    
    MTOUCH : error MT1009: Could not copy the assembly '/Users/.../Documents/repo/test/test/test.iOS/obj/iPhone/Release/mtouch-cache/3-Build/test.dll' to '/Users/.../Documents/repo/test/test/test.iOS/bin/iPhone/Release/test.iOS.app/test.dll': Could not strip assembly `/Users/.../Documents/repo/test/test/test.iOS/obj/iPhone/Release/mtouch-cache/3-Build/test.dll`.
            
        Could not strip assembly `/Users/.../Documents/repo/test/test/test.iOS/obj/iPhone/Release/mtouch-cache/3-Build/test.dll`.
        Could not strip assembly `/Users/.../Documents/repo/test/test/test.iOS/obj/iPhone/Release/mtouch-cache/3-Build/test.dll`.

mono sdk 似乎有问题,但我不知道如何解决这个问题......

我当前的 Visual Studio for Mac 安装是:

Visual Studio Community 2019 for Mac
Version 8.10.14 (build 17)
Installation UUID: 18219619-f9f8-414d-9e88-cd653673a349
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
    Package version: 612000140

Mono Framework MDK
Runtime:
    Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit)
    Package version: 612000140

Apple Developer Tools
Xcode 13.1 (19466)
Build 13A1030d

Xamarin.iOS
Version: 15.2.0.17 (Visual Studio Community)
Hash: 738fde344
Branch: xcode13.1
Build date: 2021-11-09 02:45:16-0500

Operating System
Mac OS X 12.0.1
Darwin 21.1.0 Darwin Kernel Version 21.1.0
    Wed Oct 13 17:33:24 PDT 2021
    root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 x86_64

提前致谢。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM