Forum Cross Platform with Xamarin

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Xamarin.Forms.Platform.iOS.IndicatorViewRenderer fails to resolve

I'm using Xamarin 2019 for mac and in trying to eliminate UIWebView from the iOS version of my cross platform app, I moved to Xamarin.Forms latest stable build (as of this second, it's 4.5.0.617) so that I could be sure that the suggested fixes for UIWebView elimination continue to fail for me. In moving off of 4.5.0.356 (starting with build 4.5.0.396 and still happening with 4.5.0.617) I get the error:

MT2002: Failed to resolve "Xamarin.Forms.Platform.iOS.IndicatorViewRenderer" reference from "Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"

Is anyone else seeing this?

I have these "eliminate UIWebView mtouch arguments" in my ios build:

--optimize=experimental-xforms-product-type --optimize=+force-rejected-types-removal

Is one of these removing the IndicatorViewRenderer?
puzzled.

Best Answers

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    --optimize=+force-rejected-types-removal will remove traces of UIWebView from the application. However any code that refers to the type will not work properly (expect exceptions or crashes). This should be used only if you're sure that the code is not reachable at runtime (even if it was reachable through static analysis) , this is not a good choice ,refer https://docs.microsoft.com/en-us/xamarin/ios/release-notes/13/13.16#special-cases .

    The correct way

    • Direct usage

      Start by removing your use of UIWebView, for example, replace it with the newer WKWebView (iOS 8) or SFSafariViewController (iOS 9) types.

      Once this is completed the managed linker should not see any reference to UIWebView and the final app binary will have not trace of it. You're back to the previous section, that is, everything is fine.

    • Indirect usage

      UIWebView can be present in some third party libraries, either managed or native that is used by your application.

      Start by updating your external dependencies to their latest versions since this situation might already be solved in a newer release. If not, contact the maintainer(s) of the libraries and ask about their update plans.

  • tearlistertearlister Member ✭✭

    I get that and I've updated everything including Xamarin.Forms which has the missing IndicatorViewRenderer for me. I don't use UIWebView directly at all. I have been searching through the symbols of the 3rd party libraries and can find nothing using UIWebView. However, the question is, why does IndicatorViewRenderer disappear, is that part of UIWebView?

  • ColeXColeX Member, Xamarin Team Xamurai

    Try to remove --optimize=+force-rejected-types-removal in mtouch arguments to see if problem persists.

  • tearlistertearlister Member ✭✭

    Thanks for the idea. I removed it and it still is saying indicatorviewrenderer isn't available.

Sign In or Register to comment.