xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.44k stars 507 forks source link

Xamarin IOS app works in debug mode but stalls on a page in release mode #18197

Closed jikpas0 closed 1 year ago

jikpas0 commented 1 year ago

Hi,

My app works fine in debug mode where the linker behaviour is set to no link but when i change it to Link frameworks SDK only to reflect a release build it fails on a certain page.

The page contains all that is required for a Signal R chat client, it works the first few times accessing the page than stalls, with no response or error other than a timeout in the application timeout.

connection] nw_read_request_report [C7] Receive failed with error "Operation timed out"

I have tried multiple possible solutions, with the latest being the addition of the following as arguments

--linkskip=Microsoft.AspNetCore.SignalR.Client.Core;Xamarin.CommunityToolkit;Microsoft.AspNetCore.SignalR.Common;Microsoft.AspNetCore.SignalR.Client;Microsoft.AspNetCore.SignalR.Protocols.Json;Microsoft.AspNetCore.Connections.Abstractions;Microsoft.AspNetCore.Http.Connections.Client;Microsoft.AspNetCore.Http.Connections.Common;Microsoft.AspNetCore.Http.Features

Please let me know if you require any information to help me find a solution?

Many thanks

James

rolfbjarne commented 1 year ago

--linkskip=Microsoft.AspNetCore.SignalR.Client.Core;Xamarin.CommunityToolkit;Microsoft.AspNetCore.SignalR.Common;Microsoft.AspNetCore.SignalR.Client;Microsoft.AspNetCore.SignalR.Protocols.Json;Microsoft.AspNetCore.Connections.Abstractions;Microsoft.AspNetCore.Http.Connections.Client;Microsoft.AspNetCore.Http.Connections.Common;Microsoft.AspNetCore.Http.Features

I believe you need one --linkskip=... argument per assembly.

So:

--linkskip=Microsoft.AspNetcore.SignalR.Client.Core --linkskip=Xamarin.CommunityToolkit --linkskip=...

If that doesn't work, please attach a binary build log (binlog), as described here: https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#binary-build-logs

ghost commented 1 year ago

Hi @jikpas0. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

jikpas0 commented 1 year ago

Hi

I am attaching the msbuild log, when using msbuild with link skip using my method and yours i got an error saying assembly could not be found so omitted it to get a successful build.

Many thanks

James msbuild.binlog.zip

rolfbjarne commented 1 year ago

I need to see the --linkskip arguments in the build log to verify that they're processed correctly, and figure out if you're missing any assemblies to skip, so a binlog without any --linkskip arguments isn't very helpful.

But what's the exact error you're getting? Can you attach a binlog for a build that shows it?

ghost commented 1 year ago

Hi @jikpas0. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

jikpas0 commented 1 year ago

managed to get --linkskip to work i have attached the binlog to this comment as a zip.

Many thanks in advance for any help you can provide msbuild.binlog.zip

jikpas0 commented 1 year ago

Sorry there was an error in the linkskip in the previous please use the following msbuild.binlog.zip

jikpas0 commented 1 year ago

Hi Rolf,

Forgot to mention the exact error, the xamarin ios app stalls (does nothing and becomes unresponsive) on a chat page

rolfbjarne commented 1 year ago

Looks like the --linkskip arguments are correct, but it could be that the right assembly isn't being skipped.

Can you try skipping every assembly, and see if that works?

Looks like this is all the assemblies:

        Bunki.AppV4.dll
        Bunki.AppV4.iOS.exe
        Firebase.CloudMessaging.dll
        Firebase.Core.dll
        Firebase.Installations.dll
        Google.MobileAds.dll
        Microsoft.AspNetCore.Connections.Abstractions.dll
        Microsoft.AspNetCore.Http.Connections.Client.dll
        Microsoft.AspNetCore.Http.Connections.Common.dll
        Microsoft.AspNetCore.Http.Features.dll
        Microsoft.AspNetCore.SignalR.Client.Core.dll
        Microsoft.AspNetCore.SignalR.Client.dll
        Microsoft.AspNetCore.SignalR.Common.dll
        Microsoft.AspNetCore.SignalR.Protocols.Json.dll
        Microsoft.Bcl.AsyncInterfaces.dll
        Microsoft.Extensions.DependencyInjection.Abstractions.dll
        Microsoft.Extensions.DependencyInjection.dll
        Microsoft.Extensions.Logging.Abstractions.dll
        Microsoft.Extensions.Logging.dll
        Microsoft.Extensions.Options.dll
        Microsoft.Extensions.Primitives.dll
        MLToolkit.Forms.SwipeCardView.dll
        Mono.Security.dll
        mscorlib.dll
        netstandard.dll
        Newtonsoft.Json.dll
        OpenTK-1.0.dll
        PlacesSearchBar.dll
        Plugin.MtAdmob.dll
        System.AppContext.dll
        System.Buffers.dll
        System.Collections.Concurrent.dll
        System.Collections.dll
        System.ComponentModel.Composition.dll
        System.Core.dll
        System.Data.DataSetExtensions.dll
        System.Data.dll
        System.Diagnostics.Debug.dll
        System.Diagnostics.DiagnosticSource.dll
        System.Diagnostics.Tracing.dll
        System.dll
        System.Drawing.Common.dll
        System.IO.Compression.dll
        System.IO.Compression.FileSystem.dll
        System.IO.Pipelines.dll
        System.Memory.dll
        System.Net.Http.dll
        System.Numerics.dll
        System.Numerics.Vectors.dll
        System.Reflection.dll
        System.Resources.ResourceManager.dll
        System.Runtime.CompilerServices.Unsafe.dll
        System.Runtime.dll
        System.Runtime.Extensions.dll
        System.Runtime.InteropServices.dll
        System.Runtime.Serialization.dll
        System.ServiceModel.Internals.dll
        System.Text.Encodings.Web.dll
        System.Text.Json.dll
        System.Threading.Channels.dll
        System.Threading.dll
        System.Threading.Tasks.Extensions.dll
        System.Transactions.dll
        System.Web.Services.dll
        System.Xml.dll
        System.Xml.Linq.dll
        Xamarin.Azure.NotificationHubs.iOS.dll
        Xamarin.CommunityToolkit.dll
        Xamarin.Essentials.dll
        Xamarin.Forms.Core.dll
        Xamarin.Forms.Maps.dll
        Xamarin.Forms.Maps.iOS.dll
        Xamarin.Forms.Platform.dll
        Xamarin.Forms.Platform.iOS.dll
        Xamarin.Forms.Xaml.dll
        Xamarin.iOS.dll

Added together with the --linkskip arguments:

--linkskip=Bunki.AppV4 --linkskip=Bunki.AppV4.iOS --linkskip=Firebase.CloudMessaging --linkskip=Firebase.Core --linkskip=Firebase.Installations --linkskip=Google.MobileAds --linkskip=Microsoft.AspNetCore.Connections.Abstractions --linkskip=Microsoft.AspNetCore.Http.Connections.Client --linkskip=Microsoft.AspNetCore.Http.Connections.Common --linkskip=Microsoft.AspNetCore.Http.Features --linkskip=Microsoft.AspNetCore.SignalR.Client.Core --linkskip=Microsoft.AspNetCore.SignalR.Client --linkskip=Microsoft.AspNetCore.SignalR.Common --linkskip=Microsoft.AspNetCore.SignalR.Protocols.Json --linkskip=Microsoft.Bcl.AsyncInterfaces --linkskip=Microsoft.Extensions.DependencyInjection.Abstractions --linkskip=Microsoft.Extensions.DependencyInjection --linkskip=Microsoft.Extensions.Logging.Abstractions --linkskip=Microsoft.Extensions.Logging --linkskip=Microsoft.Extensions.Options --linkskip=Microsoft.Extensions.Primitives --linkskip=MLToolkit.Forms.SwipeCardView --linkskip=Mono.Security --linkskip=mscorlib --linkskip=netstandard --linkskip=Newtonsoft.Json --linkskip=OpenTK-1.0 --linkskip=PlacesSearchBar --linkskip=Plugin.MtAdmob --linkskip=System.AppContext --linkskip=System.Buffers --linkskip=System.Collections.Concurrent --linkskip=System.Collections --linkskip=System.ComponentModel.Composition --linkskip=System.Core --linkskip=System.Data.DataSetExtensions --linkskip=System.Data --linkskip=System.Diagnostics.Debug --linkskip=System.Diagnostics.DiagnosticSource --linkskip=System.Diagnostics.Tracing --linkskip=System --linkskip=System.Drawing.Common --linkskip=System.IO.Compression --linkskip=System.IO.Compression.FileSystem --linkskip=System.IO.Pipelines --linkskip=System.Memory --linkskip=System.Net.Http --linkskip=System.Numerics --linkskip=System.Numerics.Vectors --linkskip=System.Reflection --linkskip=System.Resources.ResourceManager --linkskip=System.Runtime.CompilerServices.Unsafe --linkskip=System.Runtime --linkskip=System.Runtime.Extensions --linkskip=System.Runtime.InteropServices --linkskip=System.Runtime.Serialization --linkskip=System.ServiceModel.Internals --linkskip=System.Text.Encodings.Web --linkskip=System.Text.Json --linkskip=System.Threading.Channels --linkskip=System.Threading --linkskip=System.Threading.Tasks.Extensions --linkskip=System.Transactions --linkskip=System.Web.Services --linkskip=System.Xml --linkskip=System.Xml.Linq --linkskip=Xamarin.Azure.NotificationHubs.iOS --linkskip=Xamarin.CommunityToolkit --linkskip=Xamarin.Essentials --linkskip=Xamarin.Forms.Core --linkskip=Xamarin.Forms.Maps --linkskip=Xamarin.Forms.Maps.iOS --linkskip=Xamarin.Forms.Platform --linkskip=Xamarin.Forms.Platform.iOS --linkskip=Xamarin.Forms.Xaml --linkskip=Xamarin.iOS
ghost commented 1 year ago

Hi @jikpas0. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

jikpas0 commented 1 year ago

Hi,

I setup the project to link all with the linkskip arguments but the page is still stalling, i am not using the latest xamarin.ios 16.2.0.5 but 16.4.0.3 which works with the simulator.

Any ideas

jikpas0 commented 1 year ago

Hi,

I double checked the application and page in question by running it on don't link without linkskip arguments and the page doesn't stall. There is definetly something missing when i try to use link by sdk only

rolfbjarne commented 1 year ago

i am not using the latest xamarin.ios 16.2.0.5 but 16.4.0.3 which works with the simulator.

Why isn't it working with the simulator?

Maybe you can try 16.4.0.6 from here: https://github.com/xamarin/xamarin-macios/issues/17561?

ghost commented 1 year ago

Hi @jikpas0. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

jikpas0 commented 1 year ago

Hi,

16.4.0.6 works with the simulator but the page stalling is still occurring on linkall with --linkskip

I found this error in device log of my test iphone

missed SYSPROTO_EVENT event, buffer not big enough

rolfbjarne commented 1 year ago

missed SYSPROTO_EVENT event, buffer not big enough

I've never seen that before, but googling a bit it doesn't seem related.

I'm rather puzzled by the fact that asking the linker to skip every assembly doesn't work.

Would you be able to create a test project that shows the problem?

ghost commented 1 year ago

Hi @jikpas0. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

jikpas0 commented 1 year ago

Hi,

I re-wrote the page and now it's working seems to have been an issue with the XAML.

Thanks for your help, maybe the linkskip arguments will help someone though