Xamarin iOS app crashes on startup after updating to iOS 14.6

Hugo Gallardo 1 Reputation point
2021-06-08T20:07:01.487+00:00

Hi, my app has a login and then a home page with donwloads lists from API.

After upgrading the iOS to 14.6 version it never starts. With earlier version it does.

And also I'm getting a warning that the Xamarin.ios is not found.

We upgraded everything up to date so we can compile with the latest versions.

Error: System.NullReferenceException
Mensaje = Object reference not set to an instance of an object

Method Main.cs On IOS package

using System;
using System.Collections.Generic;
using System.Linq;

using Foundation;
using UIKit;

namespace SOS.iOS
{
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)

    {
        // if you want to use a different Application Delegate class from "AppDelegate"
        // you can specify it here.
        UIApplication.Main(args, null, "AppDelegate");
    }
}

}

My stacktrace goes as follows:

  • $exception {System.NullReferenceException: Object reference not set to an instance of an object
    at SOS.View.Landing.Home.LoadOrden () [0x00106] in <07085e5ebd574a3ebe24784d2332353a>:0
    at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
    at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSAction.cs:178
    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 /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:86
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:65
    at SOS.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\hugog\source\repos\PhilipsSOSApp_08062021\SOS\SOS.iOS\Main.cs:17 } System.NullReferenceException
  • base {System.SystemException} System.SystemException
  • base {System.Exception} System.Exception
  • Data {System.Collections.ListDictionaryInternal} System.Collections.ListDictionaryInternal
    Count 0 int
    IsFixedSize false bool
    IsReadOnly false bool
    IsSynchronized false bool
  • Keys {System.Collections.ListDictionaryInternal.NodeKeyValueCollection} System.Collections.ListDictionaryInternal.NodeKeyValueCollection
    Count 0 int
    IsSynchronized false bool
  • SyncRoot {object} object
  • Non-public members
  • IEnumerator
    SyncRoot {object} object
  • Values {System.Collections.ListDictionaryInternal.NodeKeyValueCollection} System.Collections.ListDictionaryInternal.NodeKeyValueCollection
    Count 0 int
    IsSynchronized false bool
  • SyncRoot {object} object
  • Non-public members
  • IEnumerator
  • Non-public members
  • IEnumerator
    HResult -2147467261 int
    InnerException (null) System.Exception
    Message "Object reference not set to an instance of an object" string
    Source "mscorlib" string
    StackTrace " at SOS.View.Landing.Home.LoadOrden () [0x00106] in <07085e5ebd574a3ebe24784d2332353a>:0 \n at Syst…" string
  • Static members
  • Non-public members
    _COMPlusExceptionCode -532462766 int
  • s_EDILock {object} object
  • Non-public members
    _HResult -2147467261 int
    _className "System.NullReferenceException" string
  • _data {System.Collections.ListDictionaryInternal} System.Collections.ListDictionaryInternal
    _dynamicMethods (null) object
    _helpURL (null) string
    _innerException (null) System.Exception
    _message "Object reference not set to an instance of an object" string
    _remoteStackIndex 0 int
    _remoteStackTraceString (null) string
  • _safeSerializationManager {System.Runtime.Serialization.SafeSerializationManager} System.Runtime.Serialization.SafeSerializationManager
    _source "mscorlib" string
  • _stackTrace {System.IntPtr[21]} System.IntPtr[]
    _stackTraceString (null) string
  • captured_traces {System.Diagnostics.StackTrace[1]} System.Diagnostics.StackTrace[]
    caught_in_unmanaged 0 int
    native_trace_ips (null) System.IntPtr[]

Advertencia Debugging symbol file for '/Users/MezcalTeam/Library/Caches/Xamarin/mtbs/builds/SOS.iOS/cae444b42975878605001bc50213d52b2b0d52fb4a5adc92030be99e420cbf67/obj/iPhone/Debug/device-builds/iphone10.6-14.6/mtouch-cache/1-Link/Xamarin.Forms.Core.dll' does not match the assembly and is ignored. SOS.iOS

Advertencia MSB3245 No se pudo resolver esta referencia. No se encuentra el ensamblado "Xamarin.iOS". Compruebe si el ensamblado existe en el disco. Si el código necesita esta referencia, podrían producirse errores de compilación. SOS C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2202

Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido
Advertencia Xamarin.Forms recommends TargetPlatformVersion >= 10.0.17763.0 (current project is -1) SOS C:\Users\hugog.nuget\packages\xamarin.forms\4.6.0.726\buildTransitive\Xamarin.Forms.targets 233

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,368 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Mathias Hartner 1 Reputation point
    2021-06-17T08:43:40.937+00:00

    Same problem here: Even with Xamarin.iOS 14.20.0.10 our apps DO NOT run on iOS 14.6 on a physical device!!!
    Simulator runs fine but it is stuck to iOS 14.5.

    On iOS 14.5.1 we had no problem at all...

    EDIT: A "Hello World" Xamarin.Forms Shell app is working so I guess it has to do with a third party library or maybe a custom renderer. Not sure about this.
    I try digging into it and keep you guys posted.

    EDIT2: It is a linker problem when building your Xamarin iOS app from a windows machine running VS 2019 version 16.10.x.
    I had no problems with VS 2019 version 16.8.6 in the meantime there were changes in the Xamarin.iOS packages which are causing these issues.

    EDIT 3: The solution is to disable incremental builds! Microsoft broke that since VS 16.10.x. Just disable it within iOS project settings and you can debug again.
    See xamarin-ios-app-crashing-with-error-dyld-library-not-loaded-mapped-file-has-no on stackoverflow.

    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note:  EXC_CORPSE_NOTIFY
    Termination Description: DYLD, Library not loaded: @rpath/libCompany.AppName.iOS.exe.dylib | Referenced from: /private/var/containers/Bundle/Application/906C4A47-857B-4E0E-96F8-E46791C3A037/Company.AppName.iOS.app/Company.AppName.iOS | Reason: no suitable image found.  Did find: | /private/var/containers/Bundle/Application/906C4A47-857B-4E0E-96F8-E46791C3A037/Company.AppName.iOS.app/libCompany.AppName.iOS.exe.dylib: code signature in (/private/var/containers/Bundle/Application/906C4A47-857B-4E0E-96F8-E46791C3A037/Company.AppName.iOS.app/libCompany.AppName.iOS.exe.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. | /private/var/containers/Bundle/Application/906C4A47-857B-4E0E-96F8-E46791C3A037/Company.AppName.iOS.app/libCompany.AppName.iOS.exe.dylib: stat() failed with errno=1
    

  2. İsmail Ekşi 0 Reputation points
    2024-11-18T09:22:07.0633333+00:00

    if you are using "UserDialogs.Instance.ShowLoading()" at startup page, remove them all.

    it worked for me

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.