dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.01k stars 1.72k forks source link

Missing XAML element content in release version but not debug version #17149

Open vsfeedback opened 1 year ago

vsfeedback commented 1 year ago

This issue has been moved from a ticket on Developer Community.


I have a working project (https://github.com/RodBarnes/NationalParks) where this is manifested. If I select "Debug" and select a target of either the Android SDK 31 emulator or my Samsung S10+ (Android 12) phone, the app deploys and runs correctly.

When I select "Release" and then deploy to either target, the app is successfully started but there are some XAML elements that do not display content. (See photos at bottom for comparison.) The only difference is whether selecting "Release" or "Debug" for the deployment.

Even more interesting: I killed the app on my phone and then restarted it and it then displayed all the content correctly, just like when deploying the "Debug" version. However, killing it on the emulator and restarting the app did not fix it there.

Steps to reproduce:

  1. Select "Debug" and an Android SDK 31 emulator as the target.
  2. Build and deploy the app.
  3. Tap the menu "hamburger", then tap "Parks".
  4. Note that both the title (e.g., Abraham Lincoln Birthplace) and the description (e.g., National Historic Park) are displayed.
  5. Tap the "Abraham Lincoln Birthplace" tile.
  6. Scroll down and tap "Topics" and "Activities". Both open and display the list of items.
  7. Stop the debug session.
  8. Select "Release" and the same Android SDK 31 emulator as the target.
  9. Repeat steps 2 thru 6 and note that the description (e.g., National Historic Park) is missing and the "Topics" and "Activities" open to the right size but the contents are not displayed.

I have also attached output logs: Debug-Output-Build.txt Debug-Output-Deploy.txt Rrelease-Output-Build.txt Release-Output-Deploy.txt

Debug_Park_list.png Debug_Topics_Activities_lists.png Release_Park_list.png Release_Topics_Activities_lists.png


Original Comments

Feedback Bot on 2/22/2023, 06:37 PM:

(private comment, text removed)

Rod Barnes on 2/23/2023, 10:29 AM:

(private comment, text removed)

Rod Barnes on 3/1/2023, 04:42 PM:

(private comment, text removed)

Rod Barnes on 3/2/2023, 01:27 PM:

(private comment, text removed)

Feedback Bot on 5/31/2023, 11:20 PM:

(private comment, text removed)


Original Solutions

(no solutions)

samhouts commented 1 year ago

Probably similar/same as #16861

Stedy59 commented 1 year ago

@samhouts This is what I am experiencing, maybe symptoms of the same problem...

1) Create new MauiApp 2) Clean 3) Results: `Clean started... 1>------ Clean started: Project: MauiApp1, Configuration: Debug Any CPU ------ 1>C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-rc.1.429\tools\Xamarin.Android.Common.targets(596,3): ### error XA1018: Specified AndroidManifest file does not exist: E:\Projects\Maui.Issues\MauiApp1\AndroidManifest.xml. 1>Done building project "MauiApp1.csproj" -- FAILED. 1>C:\Program Files\dotnet\sdk\8.0.100-preview.7.23376.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy ========== Clean: 0 succeeded, 1 failed, 0 skipped ========== ========== Clean started at 12:51 PM and took 00.413 seconds ==========

Clean started at 12:51 PM and took 0.302 seconds`

Interesting that it is looking for the AndroidManifest there!

Then run it without compiling, it complains about a missing SplashScreen image on Windows... On Android, it attempts to deploy, and I get an "Object Reference Error"

If I recompile again, they both work.

Now, If I change from Debug to Release, the app will run in both instances, but the app icon, slashscreen images, including any other "Maui" resources I have included, WILL NOT be there.

I must recompile again, then all my resources will be there.

ghost commented 6 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.