【问题标题】:MvvmCross 4.1 upgrade issue IsFragmentCacheable not foundMvvmCross 4.1 升级问题 IsFragmentCacheable not found
【发布时间】:2016-04-22 08:52:26
【问题描述】:

在链接器任务中升级到 mvvmcross 4.1 后出现编译错误:

The "LinkAssemblies" task failed unexpectedly. Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Boolean MvvmCross.Droid.Shared.Attributes.MvxFragmentAttributeExtensionMethods::IsFragmentCacheable(System.Type)' (defined in 'MvvmCross.Droid.Support.V7.Fragging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') from 'MvvmCross.Droid.Support.V7.Fragging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Boolean MvvmCross.Droid.Shared.Attributes.MvxFragmentAttributeExtensionMethods::IsFragmentCacheable(System.Type) at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference) at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction) at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) at Mono.Linker.Steps.MarkStep.ProcessQueue() at Mono.Linker.Steps.MarkStep.Process() at Mono.Linker.Steps.MarkStep.Process(LinkContext context) at Mono.Linker.Pipeline.Process(LinkContext context) at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context) at Xamarin.Android.Tasks.LinkAssemblies.Execute() --- End of inner exception stack trace --- at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args) at Xamarin.Android.Tasks.LinkAssemblies.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

这可能是什么原因?所有引用的程序集都更新到 4.1。

【问题讨论】:

    标签: android xamarin mono mvvmcross


    【解决方案1】:

    您应该删除 MvvmCross.Droid.Support.V7.Fragging 包,因为它现在包含在 MvvmCross.Droid.Support.V4 中。

    之后更新您的命名空间,应用程序将再次运行!

    【讨论】:

    • Martijn00,我有点进退两难。我收到与原始海报完全相同的错误消息。我尝试删除 Mvvmcross.Droid.Support.V7.Fragging 包,但 IDE 说我不能,因为 Xamarin.Android.Support.v7.AppCompat 依赖它。我正在使用 AppCompat 库,因此无法将其删除。有任何想法吗?谢谢!
    • 从头开始,刚刚将我的 MvvmCross.Droid.Support.v7.AppCompat nuget 包更新到 4.1.5,它解决了我的问题。谢谢!
    猜你喜欢
    • 2014-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-22
    • 1970-01-01
    • 2020-05-09
    • 1970-01-01
    相关资源
    最近更新 更多