You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Camera View - Zoom does not work when application is built in release mode #2109
Same problem in release. We tested it in our own development, and added a DisplayAlert to the zoom in/out button to verify that the button worked. The display looks perfect but the zoom doesn't work.
im having the same problem. It seems to me that the MaxZoomFactor is always 1. Somehow i can zoom on the front camera where MaxZoomFactor is not set to 1 but on the rear camera its always 1.
Edit: i've realised that i can zoom in both cameras in debug. the problem is when i have the emulator camera set to "virtual" instead of "emulated" i cant zoom in debug. Now i can zoom in both camera in debug, but when i deploy to release i cant zoom in none of them.
"My Resolution": Not the optimal scenario but if you disable AoT compilation and code trimming for release you can zoom after the deploy.
@jaqsilva thank you for that update! It sounds like something is being trimmed out of your application when being built. We currently have IsTrimmable set to false in our projects because we aren't fully compliant with it - we hope to be when .NET 9 ships though. This makes me believe it is the AoT compilation that would be causing it as the code shouldn't be trimmed.
@jaqsilva thank you for that update! It sounds like something is being trimmed out of your application when being built. We currently have IsTrimmable set to false in our projects because we aren't fully compliant with it - we hope to be when .NET 9 ships though. This makes me believe it is the AoT compilation that would be causing it as the code shouldn't be trimmed.
I am also having this issue with no zoom in release. It works fine for me in iOS, both debug and release. In android it works in debug, but not in release.
When I add display information I can see minzoom=1 and maxzoom=1 in release mode. In debug minzoom=1, maxzoom=10.
I recently encountered this issue and found that excluding just the Xamarin.AndroidX.Camera.Core assembly from the trimming process is enough to get zoom working in a release build of our app.
Thanks for the suggestion phunkeler. Unfortunately it did not work for me. In the end I modified the ILLinker.Descriptors.xml file as follows and it worked.
Activity
soroushsarabi commentedon Aug 15, 2024
I have same issue
AmenehShadlo commentedon Aug 15, 2024
I have same issue, any solution?
nk-alex commentedon Aug 20, 2024
Same issue here
AugPav commentedon Aug 20, 2024
Same problem in release. We tested it in our own development, and added a DisplayAlert to the zoom in/out button to verify that the button worked. The display looks perfect but the zoom doesn't work.
LHunter91 commentedon Aug 27, 2024
Issue still not fixed in Nuget Version 1.0.4 MCT.Maui.Camera
jaqsilva commentedon Aug 27, 2024
im having the same problem. It seems to me that the MaxZoomFactor is always 1. Somehow i can zoom on the front camera where MaxZoomFactor is not set to 1 but on the rear camera its always 1.
Edit: i've realised that i can zoom in both cameras in debug. the problem is when i have the emulator camera set to "virtual" instead of "emulated" i cant zoom in debug. Now i can zoom in both camera in debug, but when i deploy to release i cant zoom in none of them.
"My Resolution": Not the optimal scenario but if you disable AoT compilation and code trimming for release you can zoom after the deploy.
bijington commentedon Aug 28, 2024
@jaqsilva thank you for that update! It sounds like something is being trimmed out of your application when being built. We currently have
IsTrimmableset to false in our projects because we aren't fully compliant with it - we hope to be when .NET 9 ships though. This makes me believe it is the AoT compilation that would be causing it as the code shouldn't be trimmed.AugPav commentedon Sep 16, 2024
Thanks!
cam13469 commentedon Oct 1, 2024
This is also an issue for my team. Just commenting to give the issue a bit more attention.
Xopabyteh commentedon Oct 1, 2024
This is a huge deal for our project. Not being able to publish with AOT and trimmed makes the app bloated and very unoptimized.
Workaround
Update the CSPROJ file to disable Trimming and AOT:
bijington commentedon Oct 2, 2024
I've had a brief look at this but I have only been able to test using an emulator which doesn't support zooming.
AndrewKeat commentedon Oct 7, 2024
I am also having this issue with no zoom in release. It works fine for me in iOS, both debug and release. In android it works in debug, but not in release.
When I add display information I can see minzoom=1 and maxzoom=1 in release mode. In debug minzoom=1, maxzoom=10.
phunkeler commentedon Oct 27, 2024
I recently encountered this issue and found that excluding just the
Xamarin.AndroidX.Camera.Coreassembly from the trimming process is enough to get zoom working in a release build of our app.MauiApp.csproj
MauiApp\Platforms\Android\ILLink.Descriptors.xml
AndrewKeat commentedon Oct 29, 2024
Thanks for the suggestion phunkeler. Unfortunately it did not work for me. In the end I modified the ILLinker.Descriptors.xml file as follows and it worked.
Fix #2109
Support .NET 9.0 (CommunityToolkit#2215)
Support .NET 9.0 (#2215)
Camera (Android): remove the linker configuration that never took effect