Xamarin.forms: [Bug] [iOS] --optimize=experimental-xforms-product-type additional mtouch argument causes app crash

Created on 3 Feb 2020  路  15Comments  路  Source: xamarin/Xamarin.Forms

Description

Template app crashes when the --optimize=experimental-xforms-product-type additional mtouch argument is used along with the Link Framework SDKS linker option.

This argument is used to avoid an Apple App Store warning about UIWebView. See:
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/webview?tabs=windows#uiwebview-deprecation-and-app-store-rejection-itms-90809
and
https://github.com/xamarin/Xamarin.Forms/issues/7323

Steps to Reproduce

  1. Open Visual Studio 2019 or Visual Studio for Mac
  2. Create a new template blank Xamarin.Forms app
  3. Select Debug configuration and an iPhone Simulator.
  4. Set the iOS project as the Startup project.
  5. Update the Xamarin.Forms to version 4.5.0.187-pre2 (which is the needed version to use the --optimize=experimental-xforms-product-type mtouch argument.
  6. Open the iOS project properties -> iOS Build page
  7. Add --optimize=experimental-xforms-product-type to the additional mtouch arguments field
  8. Select "Link Framework SdKs Only" option for the Linker Behavior.
  9. Deploy the iOS app.

Expected Behavior

App launches and displays initial screen

Actual Behavior

App crashes with following exception

2020-02-03 10:21:13.241644-1000 App1.iOS[61152:3467260] 
Unhandled Exception:
System.MissingMethodException: Default constructor not found for type Xamarin.Forms.Platform.iOS.LabelRenderer

Basic Information

  • Version with issue: 4.5.0.187-pre2
  • Last known good version: Unknown
  • IDE: VS 2019 or VS for Mac
  • Platform Target Frameworks:

    • iOS: Xamarin.iOS 13.10.0.17

  • Nuget Packages: Xamarin.Essentials, Xamarin.Forms

Workaround

The workaround is to not use this additional mtouch argument and tolerate the warning from the App Store. However in April Apple will start rejecting apps that have the UIWebView in them rather than just a warning.

  • Apple won't accept new application using UIWebView in April.
  • Apple won't accept application updates using UIWebView in December.
blocker 2 high regression high impact iOS 馃崕 bug

Most helpful comment

@PureWeen

Yes, that worked to resolve this specific issue with the missing Xamarin.Forms.Platform.iOS.LabelRenderer constructor.

All 15 comments

@jgold6 Hmm, I just tried this, and it launched just fine. Can you also confirm that this crashes when you're in release mode?

Thanks!

For me it crashed for Release as well, basically anytime I had the linker set to "Link SDK Frameworks Only" and had the --optimize=experimental-xforms-product-type additional mtouch argument set.

To remove any question marks, here is a test project that is set up according to the steps to reproduce above:
TestLinkerIssue.zip

If I open the above in Visual Studio for Mac (current stable versions) and deploy to an iPhone 11 Sim running iOS 13.3, the app crashes with the error noted in the steps to reproduce above. '

VS for Mac version info

=== Visual Studio Enterprise 2019 for Mac ===

Version 8.4.3 (build 12)
Installation UUID: f86726f2-bd5d-4610-867e-44e82f306ca2
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.25 (issue-7441-d16-3-vsmac / 881172e73)

Package version: 606000155

=== Mono Framework MDK ===

Runtime:
Mono 6.6.0.155 (2019-08/296a9afdb24) (64-bit)
Package version: 606000155

=== Roslyn (Language Service) ===

3.4.0-beta4-19562-05+ff930dec4565e2bc424ad3bf3e22ecb20542c87d

=== NuGet ===

Version: 5.3.0.6192

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.101/Sdks
SDK Versions:
3.1.101
3.1.100
3.0.101
3.0.100
3.0.100-preview8-013656
2.1.701
2.1.700
2.1.505
2.1.504
2.1.503
2.1.302
2.1.301
2.1.4
2.0.0
1.0.1
1.0.0-preview2-003121
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.1
3.1.0
3.0.1
3.0.0
3.0.0-preview8-28405-07
2.1.15
2.1.14
2.1.13
2.1.12
2.1.11
2.1.10
2.1.9
2.1.8
2.1.7
2.1.2
2.1.1
2.0.5
2.0.0
1.1.1
1.0.4
1.0.0

=== Xamarin.Profiler ===

Version: 1.6.12.29
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 11.3.1 (15715)
Build 11C504

=== Xamarin.Mac ===

Version: 6.10.0.17 (Visual Studio Enterprise)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin Designer ===

Version: 16.4.0.479
Hash: 074544417
Branch: remotes/origin/d16-4
Build date: 2020-01-22 22:50:22 UTC

=== Xamarin.Android ===

Version: 10.1.3.7 (Visual Studio Enterprise)
Commit: xamarin-android/d16-4/d66aed0
Android SDK: /Users/jongoldberger/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.4
SDK Build Tools Version: 28.0.3

Build Information:
Mono: fd9f379
Java.Interop: xamarin/java.interop/d16-4@c4e569f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.28.0@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/master@9f4ed4b

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/jongoldberger/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.4.0.9
Hash: 3f7256f
Branch: remotes/origin/d16-4
Build date: 2020-01-14 22:19:04 UTC

=== Android Device Manager ===

Version: 16.4.0.30
Hash: f9172e2
Branch: remotes/origin/d16-4
Build date: 2020-01-14 22:19:24 UTC

=== Xamarin.iOS ===

Version: 13.10.0.17 (Visual Studio Enterprise)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 804030012
Git revision: 92973d97d9db919d8cc6d422e9c0599cf9995c47
Build date: 2020-01-24 17:47:54+00
Build branch: release-8.4
Xamarin extensions: 72721c588982f09029f051a38f484feb4c804227

=== Operating System ===

Mac OS X 10.15.2
Darwin 19.2.0 Darwin Kernel Version 19.2.0
Sat Nov 9 03:47:04 PST 2019
root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64

@jgold6 can you attach the full exception. It looks like a reflection issue and, if that's the case, then it's an XF issue. Thanks!

Full stack trace:

Unhandled Exception:
System.MissingMethodException: Default constructor not found for type Xamarin.Forms.Platform.iOS.LabelRenderer
  at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00066] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/RuntimeType.cs:177 
  at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x00009] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/RuntimeType.cs:155 
  at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/rttype.cs:5770 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00039] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:206 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:190 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:134 
  at Xamarin.Forms.Internals.DependencyResolver.ResolveOrCreate (System.Type type, System.Object source, System.Type visualType, System.Object[] args) [0x000bc] in d:\a\1\s\Xamarin.Forms.Core\DependencyResolver.cs:62 
  at Xamarin.Forms.Internals.DependencyResolver.ResolveOrCreate (System.Type type) [0x00000] in d:\a\1\s\Xamarin.Forms.Core\DependencyResolver.cs:37 
  at Xamarin.Forms.Internals.Registrar`1[TRegistrable].GetHandler (System.Type type, System.Type visualType) [0x00025] in d:\a\1\s\Xamarin.Forms.Core\Registrar.cs:73 
  at Xamarin.Forms.Internals.Registrar`1[TRegistrable].GetHandlerForObject[TOut] (System.Object obj) [0x0002c] in d:\a\1\s\Xamarin.Forms.Core\Registrar.cs:111 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00000] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:194 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000de] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:277 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:157 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:195 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48 
  at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x0008f] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:239 
  at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr)
  at UIKit.UIViewController.get_View () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIViewController.g.cs:3171 
  at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00000] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:105 
  at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0003d] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:121 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:195 
  at Xamarin.Forms.Platform.iOS.Platform.AddChild (Xamarin.Forms.VisualElement view) [0x00027] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:307 
  at Xamarin.Forms.Platform.iOS.Platform.WillAppear () [0x0003c] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:293 
  at Xamarin.Forms.Platform.iOS.PlatformRenderer.ViewWillAppear (System.Boolean animated) [0x00018] in d:\a\1\s\Xamarin.Forms.Platform.iOS\PlatformRenderer.cs:94 
  at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend(intptr,intptr)
  at UIKit.UIWindow.MakeKeyAndVisible () [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIWindow.g.cs:281 
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.SetMainPage () [0x00006] in d:\a\1\s\Xamarin.Forms.Platform.iOS\FormsApplicationDelegate.cs:181 
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.FinishedLaunching (UIKit.UIApplication uiApplication, Foundation.NSDictionary launchOptions) [0x00030] in d:\a\1\s\Xamarin.Forms.Platform.iOS\FormsApplicationDelegate.cs:57 
  at TestLinkerIssue.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00013] in /Users/jongoldberger/Downloads/TestLinkerIssue/TestLinkerIssue.iOS/AppDelegate.cs:28 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at TestLinkerIssue.iOS.Application.Main (System.String[] args) [0x00001] in /Users/jongoldberger/Downloads/TestLinkerIssue/TestLinkerIssue.iOS/Main.cs:17
2020-02-04 14:36:40.433034-1000 TestLinkerIssue.iOS[77125:4059894] Unhandled managed exception: Default constructor not found for type Xamarin.Forms.Platform.iOS.LabelRenderer (System.MissingMethodException)
  at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00066] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/RuntimeType.cs:177 
  at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x00009] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/RuntimeType.cs:155 
  at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/rttype.cs:5770 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00039] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:206 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:190 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:134 
  at Xamarin.Forms.Internals.DependencyResolver.ResolveOrCreate (System.Type type, System.Object source, System.Type visualType, System.Object[] args) [0x000bc] in d:\a\1\s\Xamarin.Forms.Core\DependencyResolver.cs:62 
  at Xamarin.Forms.Internals.DependencyResolver.ResolveOrCreate (System.Type type) [0x00000] in d:\a\1\s\Xamarin.Forms.Core\DependencyResolver.cs:37 
  at Xamarin.Forms.Internals.Registrar`1[TRegistrable].GetHandler (System.Type type, System.Type visualType) [0x00025] in d:\a\1\s\Xamarin.Forms.Core\Registrar.cs:73 
  at Xamarin.Forms.Internals.Registrar`1[TRegistrable].GetHandlerForObject[TOut] (System.Object obj) [0x0002c] in d:\a\1\s\Xamarin.Forms.Core\Registrar.cs:111 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00000] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:194 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000de] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:277 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:157 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:195 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in d:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48 
  at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x0008f] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:239 
  at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr)
  at UIKit.UIViewController.get_View () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIViewController.g.cs:3171 
  at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00000] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:105 
  at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0003d] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:121 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:195 
  at Xamarin.Forms.Platform.iOS.Platform.AddChild (Xamarin.Forms.VisualElement view) [0x00027] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:307 
  at Xamarin.Forms.Platform.iOS.Platform.WillAppear () [0x0003c] in d:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:293 
  at Xamarin.Forms.Platform.iOS.PlatformRenderer.ViewWillAppear (System.Boolean animated) [0x00018] in d:\a\1\s\Xamarin.Forms.Platform.iOS\PlatformRenderer.cs:94 
  at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend(intptr,intptr)
  at UIKit.UIWindow.MakeKeyAndVisible () [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIWindow.g.cs:281 
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.SetMainPage () [0x00006] in d:\a\1\s\Xamarin.Forms.Platform.iOS\FormsApplicationDelegate.cs:181 
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.FinishedLaunching (UIKit.UIApplication uiApplication, Foundation.NSDictionary launchOptions) [0x00030] in d:\a\1\s\Xamarin.Forms.Platform.iOS\FormsApplicationDelegate.cs:57 
  at TestLinkerIssue.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00013] in /Users/jongoldberger/Downloads/TestLinkerIssue/TestLinkerIssue.iOS/AppDelegate.cs:28 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.10.0.17/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at TestLinkerIssue.iOS.Application.Main (System.String[] args) [0x00001] in /Users/jongoldberger/Downloads/TestLinkerIssue/TestLinkerIssue.iOS/Main.cs:17

=================================================================
    Native Crash Reporting
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
    Native stacktrace:
=================================================================
    0x10f7d35d5 - /Users/jongoldberger/Library/Developer/CoreSimulator/Devices/FCD91BCC-B2E5-45EF-B7AA-D4D8679173CC/data/Containers/Bundle/Application/C8BAA680-39B9-46BB-987D-624FAA86911A/TestLinkerIssue.iOS.app/TestLinkerIssue.iOS : mono_dump_native_crash_info
    0x10f7c7da5 - /Users/jongoldberger/Library/Developer/CoreSimulator/Devices/FCD91BCC-B2E5-45EF-B7AA-D4D8679173CC/data/Containers/Bundle/Application/C8BAA680-39B9-46BB-987D-624FAA86911A/TestLinkerIssue.iOS.app/TestLinkerIssue.iOS : mono_handle_native_crash
    0x10f7d2b5b - /Users/jongoldberger/Library/Developer/CoreSimulator/Devices/FCD91BCC-B2E5-45EF-B7AA-D4D8679173CC/data/Containers/Bundle/Application/C8BAA680-39B9-46BB-987D-624FAA86911A/TestLinkerIssue.iOS.app/TestLinkerIssue.iOS : sigabrt_signal_handler
    0x7fff5245b42d - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_platform.dylib : _sigtramp
    0x10fc1fe62 - Unknown
    0x7fff5234ba5c - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib : abort
    0x10f9e296f - /Users/jongoldberger/Library/Developer/CoreSimulator/Devices/FCD91BCC-B2E5-45EF-B7AA-D4D8679173CC/data/Containers/Bundle/Application/C8BAA680-39B9-46BB-987D-624FAA86911A/TestLinkerIssue.iOS.app/TestLinkerIssue.iOS : xamarin_unhandled_exception_handler
    0x10f8892d7 - /Users/jongoldberger/Library/Developer/CoreSimulator/Devices/FCD91BCC-B2E5-45EF-B7AA-D4D8679173CC/data/Containers/Bundle/Application/C8BAA680-39B9-46BB-987D-624FAA86911A/TestLinkerIssue.iOS.app/TestLinkerIssue.iOS : mono_invoke_unhandled_exception_hook
    0x10f7c7959 - /Users/jongoldberger/Library/Developer/CoreSimulator/Devices/FCD91BCC-B2E5-45EF-B7AA-D4D8679173CC/data/Containers/Bundle/Application/C8BAA680-39B9-46BB-987D-624FAA86911A/TestLinkerIssue.iOS.app/TestLinkerIssue.iOS : mono_handle_exception_internal
    0x10f7c5de9 - /Users/jongoldberger/Library/Developer/CoreSimulator/Devices/FCD91BCC-B2E5-45EF-B7AA-D4D8679173CC/data/Containers/Bundle/Application/C8BAA680-39B9-46BB-987D-624FAA86911A/TestLinkerIssue.iOS.app/TestLinkerIssue.iOS : mono_handle_exception
    0x10f749fb9 - /Users/jongoldberger/Library/Developer/CoreSimulator/Devices/FCD91BCC-B2E5-45EF-B7AA-D4D8679173CC/data/Containers/Bundle/Application/C8BAA680-39B9-46BB-987D-624FAA86911A/TestLinkerIssue.iOS.app/TestLinkerIssue.iOS : mono_amd64_throw_exception
    0x11191a5b0 - Unknown

=================================================================
    Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x7fff523bc7fa):0x7fff523bc7ea  ff ff c3 90 90 90 b8 48 01 00 02 49 89 ca 0f 05  .......H...I....
0x7fff523bc7fa  73 08 48 89 c7 e9 85 a2 ff ff c3 90 90 90 b8 53  s.H............S
0x7fff523bc80a  00 00 02 49 89 ca 0f 05 73 08 48 89 c7 e9 6d a2  ...I....s.H...m.
0x7fff523bc81a  ff ff c3 90 90 90 b8 83 01 00 02 49 89 ca 0f 05  ...........I....

=================================================================
    Managed Stacktrace:
=================================================================
=================================================================


@jgold6 thanks! that confirms what I though.

@samhouts the use of --optimize=experimental-xforms-product-type only opt-in XF into the "normal" platform linking process (which gets rid of UIWebView in XF in unreferenced by user code).

As seen above XF is using reflection to access its own type - and the called member are not preserved. That's not linkable as a "product type" assembly and the option to _trust_ XF to be turns out unusable.

This was tested before (ask Shane). Either something changed in XF after those tests (and not tested again) or the tests were incomplete.

Without adding In the Additional mtouch arguments

--optimize=experimental-xforms-product-type

in release mode, We can publish on apple store?

@jgold6 if you get a chance can you test the artifacts here?

https://dev.azure.com/xamarin/public/_build/results?buildId=13952&view=results

Let me know if those work for you?

@PureWeen

Yes, that worked to resolve this specific issue with the missing Xamarin.Forms.Platform.iOS.LabelRenderer constructor.

@Sumit2668 it's a little hard to know how Apple's algorithm will official work but as far as we know

  • Apple won't accept new application using UIWebView in April.
  • Apple won't accept application updates using UIWebView in December.

Is what we know from what they've indicated.

Once we know everything with the flag is working successfully then the flag will just remain enabled by default.

closed by #9505

it is not working for me. I get "Default constructor not found for type Xamarin.Forms.Platform.iOS.ActivityIndicatorRenderer" and app crashes

I have the same problem as pavanalluri007.

I have same problem in my appcenter build.

@softsan create a separate issue with a repro please

We have a lot of active projects running with this setting and haven't seen any issues yet so I'm wondering if all your projects are on the latest and greatest of Xamarin.Forms?

Or maybe you've hit a case we haven't seen?

I'm closing the comments on this issue.

If you're seen this issue and you've confirmed
1) you are on the latest version of Xamarin.Forms 4.5
2) you've tried clearing out your bin/obj

Then please log a new issue with a repro

Was this page helpful?
0 / 5 - 0 ratings