Forum Xamarin.iOS

Getting Error "Can't Resolve the refererence" when trying to run a new solution

Mr.XMr.X CAMember ✭✭

Fresh install of VS2019 on MacOS, Mojave.
Created the "Blank Forms App" under MultiPlatform/App/Xamarin.Forms

Try to build the solution, with no edits, I get this error:
/Users/andyb/Projects/XamarinTest/XamarinTest.iOS/MTOUCH: Error MT2101: Can't resolve the reference 'System.Void UIKit.UIDatePicker::set_PreferredDatePickerStyle(UIKit.UIDatePickerStyle)', referenced from the method 'System.Void Xamarin.Forms.Platform.iOS.DatePickerRendererBase1::OnElementChanged(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1<Xamarin.Forms.DatePicker>)' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. (MT2101) (XamarinTest.iOS)

Did a search but cannot find the solution. A little help?

Answers

  • Mr.XMr.X CAMember ✭✭

    `
    Building XamarinTest.iOS (Debug)
    Build started 2020-10-17 5:10:51 PM.


    Project "/Users/andyb/Projects/XamarinTest/XamarinTest/XamarinTest.csproj" (Build target(s)):

    Target _CheckForNETCoreSdkIsPreview:
    You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
    Target GenerateTargetFrameworkMonikerAttribute:
    Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
    Target XamlG:
    Skipping target "XamlG" because all output files are up-to-date with respect to the input files.
    Target CssG:
    Skipping target "CssG" because it has no outputs.
    Target CoreGenerateAssemblyInfo:
    Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.
    Target CssG:
    Skipping target "CssG" because it has no outputs.
    Target CoreCompile:
    Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
    Target XamlC:
    Skipping target "XamlC" because all output files are up-to-date with respect to the input files.
    Target GenerateBuildDependencyFile:
    Skipping target "GenerateBuildDependencyFile" because all output files are up-to-date with respect to the input files.
    Target CopyFilesToOutputDirectory:
    XamarinTest -> /Users/andyb/Projects/XamarinTest/XamarinTest/bin/Debug/netstandard2.0/XamarinTest.dll


    Project "/Users/andyb/Projects/XamarinTest/XamarinTest.iOS/XamarinTest.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 it has no outputs.
    Target _CoreOptimizePropertyLists:
    Skipping target "_CoreOptimizePropertyLists" because it has no inputs.
    Target _CoreOptimizeLocalizationFiles:
    Skipping target "_CoreOptimizeLocalizationFiles" because it has no inputs.
    Target _GetProjectReferenceTargetFrameworkProperties:
    __________________________________________________
    Project "/Users/andyb/Projects/XamarinTest/XamarinTest.iOS/XamarinTest.iOS.csproj" is building "/Users/andyb/Projects/XamarinTest/XamarinTest/XamarinTest.csproj" (GetTargetFrameworks target(s)):

    Target ResolveProjectReferences:
    __________________________________________________
    Project "/Users/andyb/Projects/XamarinTest/XamarinTest.iOS/XamarinTest.iOS.csproj" is building "/Users/andyb/Projects/XamarinTest/XamarinTest/XamarinTest.csproj" (GetTargetPath target(s)):

    __________________________________________________
    Project "/Users/andyb/Projects/XamarinTest/XamarinTest.iOS/XamarinTest.iOS.csproj" is building "/Users/andyb/Projects/XamarinTest/XamarinTest/XamarinTest.csproj" (GetNativeManifest target(s)):
    

    Target GenerateTargetFrameworkMonikerAttribute:
    Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
    Target XamlG:
    Skipping target "XamlG" because it has no outputs.
    Target CssG:
    Skipping target "CssG" because it has no outputs.
    Target CssG:
    Skipping target "CssG" because it has no outputs.
    Target XamlG:
    Skipping target "XamlG" because it has no outputs.
    Target CoreCompile:
    Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
    Target _CopyFilesMarkedCopyLocal:
    Touching "/Users/andyb/Projects/XamarinTest/XamarinTest.iOS/obj/iPhoneSimulator/Debug/XamarinTest.iOS.csproj.CopyComplete".
    Target GetCopyToOutputDirectoryItems:
    Target _GetCopyToOutputDirectoryItemsFromTransitiveProjectReferences:
    __________________________________________________
    Project "/Users/andyb/Projects/XamarinTest/XamarinTest.iOS/XamarinTest.iOS.csproj" is building "/Users/andyb/Projects/XamarinTest/XamarinTest/XamarinTest.csproj" (GetCopyToOutputDirectoryItems target(s)):

    Target CopyFilesToOutputDirectory:
    XamarinTest.iOS -> /Users/andyb/Projects/XamarinTest/XamarinTest.iOS/bin/iPhoneSimulator/Debug/XamarinTest.iOS.exe
    Target _DetectSigningIdentity:
    Detected signing identity:
    Bundle Id: com.companyname.XamarinTest
    App Id: com.companyname.XamarinTest
    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: False
    NoDSymUtil Output: false
    Target _CompileToNative:
    /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch "@/Users/andyb/Projects/XamarinTest/XamarinTest.iOS/obj/iPhoneSimulator/Debug/device-builds/iphone 11-13.3/response-file.rsp"
    MTOUCH : error MT2101: Can't resolve the reference 'System.Void UIKit.UIDatePicker::set_PreferredDatePickerStyle(UIKit.UIDatePickerStyle)', referenced from the method 'System.Void Xamarin.Forms.Platform.iOS.DatePickerRendererBase1::OnElementChanged(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1<Xamarin.Forms.DatePicker>)' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.
    Done building target "_CompileToNative" in project "XamarinTest.iOS.csproj" -- FAILED.

    Done building project "XamarinTest.iOS.csproj" -- FAILED.

    Build FAILED.

    MTOUCH : error MT2101: Can't resolve the reference 'System.Void UIKit.UIDatePicker::set_PreferredDatePickerStyle(UIKit.UIDatePickerStyle)', referenced from the method 'System.Void Xamarin.Forms.Platform.iOS.DatePickerRendererBase1::OnElementChanged(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1<Xamarin.Forms.DatePicker>)' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.
    0 Warning(s)
    1 Error(s)

    Time Elapsed 00:00:07.95

    ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Build: 1 error, 0 warnings

    `

  • LandLuLandLu Member, Xamarin Team Xamurai

    Did you create a custom renderer for a DatePikcer to modify something on iOS?
    I also noticed there was a message:

    You are using a preview version of .NET

    May I know the version of your Xamarin Froms and the environment of the VS?

  • BoguslawBlonskiBoguslawBlonski PLMember ✭✭✭

    getting error after update to Xamarin.Forms 4.8
    Error MT2101: Can't resolve the reference 'System.Void UIKit.UIDatePicker::set_PreferredDatePickerStyle(UIKit.UIDatePickerStyle)', referenced from the method 'System.Void Xamarin.Forms.Platform.iOS.DatePickerRendererBase1::OnElementChanged(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1<Xamarin.Forms.DatePicker>)' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. (MT2101)

  • DanilKDanilK GBMember ✭✭

    Experiencing the same thing when building after update to 4.8.0.1560

    MTOUCH : error MT2101: Can't resolve the reference 'System.Void UIKit.UIDatePicker::set_PreferredDatePickerStyle(UIKit.UIDatePickerStyle)', referenced from the method 'System.Void Xamarin.Forms.Platform.iOS.DatePickerRendererBase1::OnElementChanged(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1<Xamarin.Forms.DatePicker>)' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.

  • JohnHJohnH GBMember ✭✭✭✭✭

    @LandLu any update on this? We have just attempted to update to XF 4.8 and our Azure DvOps builds failed due to this same error (although interestingly we can build locally), and yes we have a custom renderer for a UIPickerView.
    Downgraded to XF 4.7.0.1351 to resolve the build issue.

  • JohnHJohnH GBMember ✭✭✭✭✭

    @LandLu or anyone else figured out a fix for this? We have a custom renderer that uses UIPickerView for a more advanced date picker, but we can't upgrade to 4.8 due to this issue.

  • JohnHJohnH GBMember ✭✭✭✭✭

    @LandLu do you still work at Microsoft? Or should we ask someone else for assistance?

  • JohnHJohnH GBMember ✭✭✭✭✭

    @fefferoni said:
    I had the same build issue in my Azure DevOps pipeline after updating to Xamarin Forms 4.8. My solution was to use a newer mono version (6.10.0 instead of 6.8.0) when building. If you are not running a CI build but instead have this problem locally in VS you can check the current mono version from the "About Visual Studio" screen. If it is lower than 6.10.0 make sure to check for updates in VS.

    Excellent, that works for our ADO pipelines as well! Much appreciated.

  • The4DroogsThe4Droogs Member ✭✭

    Any update on this issue? I've updated my azure devops build to use Mono 6.10.0 but still getting this error

Sign In or Register to comment.