Maui icon indicating copy to clipboard operation
Maui copied to clipboard

[BUG] TouchEffect does not work on iOS when app is built in Release

Open velocitysystems opened this issue 1 year ago • 6 comments
trafficstars

Is there an existing issue for this?

  • [X] I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

  • [X] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

Current Behavior

TouchEffect does not work on iOS when app is built in Release. This is a regression in 9.1.0 and possibly due to AOT improvements.

Expected Behavior

TouchEffect should work and fire events/execute commands when attached to a view.

Steps To Reproduce

  1. Create a new blank MAUI project
  2. Add a TouchEffect to any control
  3. Build the app in Release configuration

Link to public reproduction project repository

AotSample.zip

Environment

- .NET MAUI CommunityToolkit: 9.1.0
- OS: iOS 17.5
- .NET MAUI: 8.0.91 SR9.1 (latest)

Anything else?

Works in 9.0.3. Android works in both Debug and Release.

velocitysystems avatar Sep 27 '24 19:09 velocitysystems

Hi @velocitysystems. We have added the "needs reproduction" label to this issue, which indicates that we cannot take further action. This issue will be closed automatically in 5 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.

@brminnick Added reproduction project. I also get a persistent startup crash when debugging on iOS (Android is unaffected):

System.TypeLoadException: Could not set up parent class, due to: Invalid generic instantiation assembly:/Users/dev/Library/Developer/CoreSimulator/Devices/F766998B-9560-4192-90C8-DEC128E8E6D9/data/Containers/Bundle/Application/C4DE1219-9F4A-4D31-9354-A887F27BD4BF/AotSample.app/Microsoft.Maui.dll type:ViewHandler`2 member:(null)
   at CommunityToolkit.Maui.AppBuilderExtensions.<>c.<UseMauiCommunityToolkit>b__0_0(IMauiHandlersCollection h)
   at Microsoft.Maui.Hosting.HandlerMauiAppBuilderExtensions.HandlerRegistration.AddRegistration(IMauiHandlersCollection builder)
   at Microsoft.Maui.Hosting.Internal.MauiHandlersFactory.CreateHandlerCollection(IEnumerable`1 registrationActions)
   at Microsoft.Maui.Hosting.Internal.MauiHandlersFactory..ctor(IEnumerable`1 registrationActions)
   at Microsoft.Maui.Hosting.HandlerMauiAppBuilderExtensions.<>c.<ConfigureMauiHandlers>b__1_0(IServiceProvider sp)

I've tried the following steps mentioned here with no luck:

  • Update .NET 8 SDK to latest
  • Update MAUI workloads via dotnet workload update
  • Drop bin and obj
  • Clear local NuGet package cache

Rolling back to 9.0.3 everything works fine.

velocitysystems avatar Sep 28 '24 13:09 velocitysystems

We don't accept a zip file as a reproduction sample due to potential security reasons. That said I believe this issue might be solved in PR #2243

bijington avatar Oct 01 '24 19:10 bijington

same issue here. haven't tried downgrading yet, but this really needs fixing... edit: it does indeed work again when downgrading to 9.0.3

MitchBomcanhao avatar Oct 23 '24 08:10 MitchBomcanhao

does anyone know if version 10 has a fix for this issue? I haven't been able to try it yet

MitchBomcanhao avatar Dec 18 '24 15:12 MitchBomcanhao

It's still dos not been fixed yet i courrenty have this problem with version 12 on core 9 with all updates. Is thear any workaround existing?

neji94 avatar Jun 17 '25 07:06 neji94