【问题标题】:Xamarin-IOS build error - Could not link assemblies. Error while processing reference of the projectXamarin-IOS 生成错误 - 无法链接程序集。处理项目引用时出错
【发布时间】:2018-10-04 17:47:58
【问题描述】:

我在我们的项目中发现了非常奇怪的问题。 我们在办公室使用不同的 MAC 计算机,在同一个项目上工作。

我的项目有构建错误,但我的同事没有。

这是我的错误

完整的构建输出就是这个

 Module: EuroProduct.SharedPCL.dll

    No compiled resources. Skipping writing assembly.
Target _CopyFilesMarkedCopyLocal:
    Touching "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/obj/Debug/netstandard2.0/EuroProduct.SharedPCL.csproj.CopyComplete".
Target GetCopyToOutputDirectoryItems:
    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.TransferModels/EuroProduct.TransferModels.csproj" (GetCopyToOutputDirectoryItems target(s)):

    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/SharedAbstractions/SharedAbstractions.csproj" (GetCopyToOutputDirectoryItems target(s)):

Target GenerateBuildDependencyFile:
  Skipping target "GenerateBuildDependencyFile" because all output files are up-to-date with respect to the input files.
Target CopyFilesToOutputDirectory:
    EuroProduct.SharedPCL -> /Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/bin/Debug/netstandard2.0/EuroProduct.SharedPCL.dll

Done building project "EuroProduct.SharedPCL.csproj".
__________________________________________________
Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/EuroProduct.IOS.csproj" (Build target(s)):

Target _BeforeCoreCompileInterfaceDefinitions:
  Skipping target "_BeforeCoreCompileInterfaceDefinitions" because all output files are up-to-date with respect to the input files.
Target _CoreCompileInterfaceDefinitions:
  Skipping target "_CoreCompileInterfaceDefinitions" because all output files are up-to-date with respect to the input files.
Target _BeforeCoreCompileImageAssets:
  Skipping target "_BeforeCoreCompileImageAssets" because all output files are up-to-date with respect to the input files.
Target _CoreCompileImageAssets:
  Skipping target "_CoreCompileImageAssets" because all output files are up-to-date with respect to the input files.
Target _CoreCompileColladaAssets:
  Skipping target "_CoreCompileColladaAssets" because it has no inputs.
Target _BeforeCoreCompileSceneKitAssets:
  Skipping target "_BeforeCoreCompileSceneKitAssets" because it has no inputs.
Target _BeforeCoreCompileSceneKitAssets:
  Skipping target "_BeforeCoreCompileSceneKitAssets" because it has no inputs.
Target _BeforeCoreCompileSceneKitAssets:
  Skipping target "_BeforeCoreCompileSceneKitAssets" because it has no inputs.
Target _CoreCompileSceneKitAssets:
  Skipping target "_CoreCompileSceneKitAssets" because it has no inputs.
Target _BeforeCompileTextureAtlases:
  Skipping target "_BeforeCompileTextureAtlases" because it has no inputs.
Target _BeforeCompileTextureAtlases:
  Skipping target "_BeforeCompileTextureAtlases" because it has no inputs.
Target _BeforeCompileTextureAtlases:
  Skipping target "_BeforeCompileTextureAtlases" because it has no inputs.
Target _CoreCompileTextureAtlases:
  Skipping target "_CoreCompileTextureAtlases" because it has no inputs.
Target _BeforeCompileCoreMLModels:
  Skipping target "_BeforeCompileCoreMLModels" because all output files are up-to-date with respect to the input files.
Target _CoreCompileCoreMLModels:
  Skipping target "_CoreCompileCoreMLModels" because all output files are up-to-date with respect to the input files.
Target _CoreOptimizePngImages:
  Skipping target "_CoreOptimizePngImages" because all output files are up-to-date with respect to the input files.
Target _CoreOptimizePropertyLists:
  Skipping target "_CoreOptimizePropertyLists" because it has no inputs.
Target _CoreOptimizeLocalizationFiles:
  Skipping target "_CoreOptimizeLocalizationFiles" because it has no inputs.
Target _GetProjectReferenceTargetFrameworkProperties:
    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/EuroProduct.IOS.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj" (GetTargetFrameworks target(s)):

    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/EuroProduct.IOS.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/SharedAbstractions/SharedAbstractions.csproj" (GetTargetFrameworks target(s)):

Target ResolveProjectReferences:
    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/EuroProduct.IOS.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj" (GetTargetPath target(s)):

    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/EuroProduct.IOS.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/SharedAbstractions/SharedAbstractions.csproj" (GetTargetPath target(s)):

    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/EuroProduct.IOS.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj" (GetNativeManifest target(s)):

    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/EuroProduct.IOS.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/SharedAbstractions/SharedAbstractions.csproj" (GetNativeManifest target(s)):

Target GenerateTargetFrameworkMonikerAttribute:
  Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
Target CoreCompile:
  Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
Target _CopyFilesMarkedCopyLocal:
    Touching "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/obj/iPhoneSimulator/Debug/EuroProduct.IOS.csproj.CopyComplete".
Target GetCopyToOutputDirectoryItems:
    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/EuroProduct.IOS.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj" (GetCopyToOutputDirectoryItems target(s)):

    __________________________________________________
    Project "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/EuroProduct.IOS.csproj" is building "/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/SharedAbstractions/SharedAbstractions.csproj" (GetCopyToOutputDirectoryItems target(s)):

Target CopyFilesToOutputDirectory:
    EuroProduct.IOS -> /Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/bin/iPhoneSimulator/Debug/EuroProduct.IOS.exe
Target _DetectSigningIdentity:
    Detected signing identity:
      Bundle Id: com.mpdc.europroduct
      App Id: com.mpdc.europroduct
Target _CopyResourcesToBundle:
  Skipping target "_CopyResourcesToBundle" because all output files are up-to-date with respect to the input files.
Target _DetectDebugNetworkConfiguration:
      DebugIPAddresses: 127.0.0.1
Target _CompileAppManifest:
  Skipping target "_CompileAppManifest" because all output files are up-to-date with respect to the input files.
Target _ParseExtraMtouchArgs:
      NoSymbolStrip Output: true
      NoDSymUtil Output: false
Target _CompileToNative:
    /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.IOS/obj/iPhoneSimulator/Debug/response-file.rsp 
    MTOUCH : error MT2001: Could not link assemblies. Reason: Error while processing references of 'EuroProduct.IOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
Done building target "_CompileToNative" in project "EuroProduct.IOS.csproj" -- FAILED.

Done building project "EuroProduct.IOS.csproj" -- FAILED.

Build FAILED.

/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj : warning NU1701: Package 'Ideine.ModernHttpClient 3.2.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj : warning NU1701: Package 'Microsoft.Bcl 1.1.10' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj : warning NU1701: Package 'Microsoft.Net.Http 2.2.29' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
/Users/tornikegomareli/Desktop/MPDCEuroProduct/EuroProduct-master/EuroProduct.SharedPCL/EuroProduct.SharedPCL.csproj : warning NU1701: Package 'MPDC.Container 1.0.6' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
MTOUCH : error MT2001: Could not link assemblies. Reason: Error while processing references of 'EuroProduct.IOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    4 Warning(s)
    1 Error(s)

Time Elapsed 00:00:03.58

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:03.58

---------------------- Done ----------------------

Build: 1 error, 4 warnings

我在 stack-overflow 上搜索了很多类似的问题,但找不到任何解决方案来解决我的问题。

我还删除了一些包,但没有任何帮助。 但是当我删除 Xamarin-FFImageLoading 包时 它正在建设中没有任何问题。 FFMImageLoader 版本是 2.3.6,也在上一个版本更新,但没有任何帮助。

请给我建议,在这种情况下该怎么做。

【问题讨论】:

    标签: c# xamarin xamarin.ios


    【解决方案1】:

    将 -v -v -v -v 添加到项目 iOS 构建设置中的“其他 mtouch 参数”将有助于诊断问题。之后,您可以搜索 MT2001 的构建输出并查看内部异常。显然,每个项目对于导致链接器失败的程序集可能有所不同。您可能需要根据输出添加、删除或修复您的引用。 例如,也许您在(.Net Standard 2.0,但可能不相关)核心库中包含了一个 nuget 包,但忘记将其包含在您的平台特定项目中。

    这里是a similar case,您可以参考。

    另外,你的VS是什么版本?更新VS时有时会出现这个问题。

    【讨论】:

    • 我的VS版本是7.6.8,是在VS更新后发生的
    • 尝试删除文件夹bin和obj。然后重建项目
    猜你喜欢
    • 1970-01-01
    • 2012-09-03
    • 1970-01-01
    • 2010-09-09
    • 2020-07-17
    • 2014-06-29
    • 1970-01-01
    • 2015-10-03
    • 2019-07-01
    相关资源
    最近更新 更多