Forum Xamarin.iOS

UIKit.UIWebView still occurs

DigitalJoDigitalJo Member ✭✭

Hello i am facing the know UIKit.UIWebView with appstore connect. My xamarin forms version is 4.5.0.617. i added the --warn-on-type-ref=UIKit.UIWebView and i can see the warnings below.

2> /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/iordaniskantharidis/Library/Caches/Xamarin/mtbs/builds/PortBook.iOS/01e5572b03e96c72b575d6b4caeea634/obj/iPhone/Debug/response-file.rsp --warn-on-type-ref=UIKit.UIWebView 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): warning MT1502: One or more reference(s) to type 'UIKit.UIWebView' already exists inside 'Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' before linking 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(844,3): warning MT1503: One or more reference(s) to type 'UIKit.UIWebView' still exists inside 'Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' after linking

What i doing wrong?

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    Did you follow this blog to change the settings?
    https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/
    We need to change the linker behavior under the release mode with iPhone platform:

  • DemiVisionDemiVision USMember ✭✭✭

    My app is still getting rejected based on UIWebView even after following the above instructions. Here is my mtouch line:

    --optimize=experimental-xforms-product-type --warn-on-type-ref=UIKit.UIWebView

    And here is the warning:

    Warning MT1503: One or more reference(s) to type 'UIKit.UIWebView' still exists inside 'Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' after linking (MT1503)

    I have tried both "Link Framework SDKs only" as well as "Link All". Everything is fully updated on the Stable channels (VS Mac 8.5.4, and Xamarin Forms 4.6.0).

    Any ideas what I might be doing wrong? Thanks!

  • LukasBusekLukasBusek Member ✭✭

    Hi, did you manage to resolve it? I am getting stuck on the same issue.

    Thanks.

  • DemiVisionDemiVision USMember ✭✭✭

    @LukasBusek Haven't solved it yet, but running the grep command suggested in this thread:
    https://forums.xamarin.com/discussion/comment/410638#Comment_410638

    may have helped me narrow it to the FirebaseAuth Nuget we are using.

  • LukasBusekLukasBusek Member ✭✭

    @LandLu - I am facing the same issue. I think this is a pretty serious situation as it puts developers that has chosen Xamarin as a dev tool for their business-critical apps. I have an app that is being rejected and there is no answer from the Xamarin team.

    Linker option does not help as I am getting the following (I tried Link All and link SDK only) :

    mtouch args: --optimize=experimental-xforms-product-type --warn-on-type-ref=UIKit.UIWebView --optimize=force-rejected-types-removal

    the result after running Archiving the app :

    MTOUCH : warning MT2003: Option '--optimize=experimental-xforms-product-type' will be ignored since linking is disabled
    MTOUCH : warning MT2003: Option '--optimize=force-rejected-types-removal' will be ignored since linking is disabled
    MTOUCH : warning MT1502: One or more reference(s) to type 'UIKit.UIWebView' already exists inside 'Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' before linking
    MTOUCH : warning MT1503: One or more reference(s) to type 'UIKit.UIWebView' still exists inside 'Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' after linking

    The way I read it as that visual studio (ver. 8.5.5, build 7) ignores mtouch arguments.

    Any suggestion that would lead to a positive result is appreciated.

    Thanks

    Lukas

  • JohnHJohnH GBMember ✭✭✭✭✭

    @LukasBusek try the grep option that @DemiVision mentioned, he has since been able to identify the NuGet package causing the problem and has resolved the issue.

  • LukasBusekLukasBusek Member ✭✭

    this is what I am getting back ... it seems nothing else but Xamarin ... any idea? Thanks

    LB-MacBook:Payload lukasbusek$ grep -r UIWebView .
    Binary file ./AvisoApp.iOS matches
    Binary file ./Xamarin.Forms.Platform.iOS.dll matches
    Binary file ./Xamarin.iOS.dll matches
    LB-MacBook:Payload lukasbusek$

  • DemiVisionDemiVision USMember ✭✭✭

    @LukasBusek A few thoughts based on my experience with this...

    • I did not end-up using '--optimize=force-rejected-types-removal'
    • The 'linking is disabled' output makes it sound like you have Linking set to 'None'.
    • Is AvisoApp.iOS your app code? I would not expect to see that in the grep results.
  • LukasBusekLukasBusek Member ✭✭

    Hi,

    "linking is disabled" is really puzzling because of my linker settings is set to "Link All" (it produces the same result if I set it to Link SDKs only". AvisoApp.iOS is my code.

    Thanks

    Lukas

  • edegraciaptyedegraciapty Member

    Any solution to this? Having same issue. Move from windows vs to vs for mac and having same behavior. Even I create a project from scratch. I added skiasharp library and no warning message, then simple audio player and no warning message. Then I Added Rg.Plugins.PopUp and start warning messages, but in Xamarin.Forms.Platform.iOS, Version=2.0.0.0. Try link all, link sdk, mtouch tags with experimental and other that says something with removal and same result. VS for mac updated, xcode updated. Some suggestion was run grep -r ''UIWebView" . on bin folder and result was on xamarin.ios and nothing about rg.plugins.popup. Weird... Its a headache...

  • Harikrishnan_NHarikrishnan_N Member ✭✭
    edited December 2020

    Did anyone find a solution to this?

  • JohnHJohnH GBMember ✭✭✭✭✭

    @Harikrishnan_N
    Yup, I followed the instructions, updated my nugets, all good.

Sign In or Register to comment.