Open brunck opened 6 days ago
This issue has been verified using Visual Studio 17.13 Preview 1(9.0.0 & 9.0.0-rc.2.24503.2). Can repro this issue on Android platform. When verifying 9.0.100, The app crashes with java.lang.ClassNotFoundException: com.microsoft.maui.PlatformMauiAppCompatActivity.
Description
Running the sample app in AdHoc config crashes with
Java.Lang.IllegalStateException: FragmentManager has not been attached to a host.
Although this is Android-specific, the stack trace is in MAUI code, so this is where the issue is entered.
There is an attempt to preserve code using ProGuard configuration. It's possible there is some code being stripped out that is needed, but it's not clear what that is.
For some reason, Release mode doesn't seem to use the shrinking(?) Could be something wrong I have set in my project.
Steps to Reproduce
AdHoc
configuration.Link to public reproduction project repository
https://github.com/brunck/reproductions/tree/master/AndroidFragmentManagerError
Version with bug
9.0.0 GA
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
No response
Affected platforms
Android
Affected platform versions
35
Did you find any workaround?
Don't use code shrinking/ProGuard configuration.
Relevant log output
Stack Trace
```shell [MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] Java.Lang.RuntimeException: Unable to start activity ComponentInfo{com.companyname.androidfragmentmanagererror/crc6401489ec77a456728.MainActivity}: java.lang.IllegalStateException: FragmentManager has not been attached to a host. [MonoDroid] ---> Java.Lang.IllegalStateException: FragmentManager has not been attached to a host. [MonoDroid] at Java.Interop.JniEnvironment.InstanceMethods.CallIntMethod(JniObjectReference instance, JniMethodInfo method, JniArgumentValue* args) [MonoDroid] at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeAbstractInt32Method(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters) [MonoDroid] at AndroidX.Fragment.App.BackStackRecord.Commit() [MonoDroid] at Microsoft.Maui.Handlers.FlyoutViewHandler.