Mvvmcross: Error linking in release mode

Created on 17 Dec 2017  路  3Comments  路  Source: MvvmCross/MvvmCross

I get an error when linking a MvvmCross project with the Target Framework set to Android 8

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1696,5): error MSB4018: Mono.Linker.MarkException: Error processing method: 'System.Void MvvmCross.Droid.Shared.Presenter.MvxFragmentsPresenter::Show(MvvmCross.Core.ViewModels.MvxViewModelRequest,MvvmCross.Core.ViewModels.MvxViewModelRequest)' in assembly: 'MvvmCross.Droid.Shared.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void MvvmCross.Droid.Views.MvxAndroidViewPresenter::Show(Android.Content.Intent)

Steps to reproduce :scroll:

  1. In release mode set Linking Behaviour to "Link SDK assemblies only"

  2. Make sure that the Target Framework is set to Android 8

  3. All other settings should confirm to Xamarin recommended settings for deployment on Android

Expected behavior :thinking:

The application should link with no errors

Actual behavior :bug:

Linking fails

Configuration :wrench:

Error is reproduced with Visual Studio on a Mac.

Version: 5.6.2

Platform:

  • [ ] :iphone: iOS
  • [ X] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [ ] :monkey: Xamarin.Forms
invalid

Most helpful comment

I found an old reference to MvvmCross.Droid.Shared in my .csproj file that for some reason did not show up in Visual Studio on my Mac.

All 3 comments

This should probably go to the Xamarin team instead. We don't do anything to prevent linking.

Also make sure that all the MvvmCross references you are using are the same version.

Closing this as it isn't MvvmCross related. If you find out that it is indeed related, please feel free to reopen it.

I found an old reference to MvvmCross.Droid.Shared in my .csproj file that for some reason did not show up in Visual Studio on my Mac.

Was this page helpful?
0 / 5 - 0 ratings