Open WilliamWatterson86 opened 3 years ago
Just passing by to confirm that latest XF works fine ☑️ in production without version tricks on AndroidX libraries (check https://github.com/xamarin/Xamarin.Forms/issues/14193#issuecomment-906808249) IMO this issue should be closed.
@xleon you might not be seeing any crashes but i wouldn't say this issue is fixed.
See my previous comment -
The best we got was to update XF to the latest version. This prevents it from crashing, by restarting the app, so it is better than before. But ideal they should be returned to the original view.
My app in google play crashes with android.runtime.JavaProxyThrowable
crc643f46942d9dd1fff9.FormsAppCompatActivity.n_onStart
This is a serious error in production, according to Google/ARN it has occurred in Xiaomi and OnePlus with Android 10 and 11
My project did not have AndroidX.Fragment or AndroidX.Activity explicitly referenced but I've got the latest version of Xamarin.AndroidX.Biometrics and that seems to be pulling in the latest Activity / Fragment components.
I had to manually add lower versions of these 2 nugets to resolve this issue. I've described this in more detail here: https://stackoverflow.com/a/71490715/170169
I fixed this issue by adding the AndroidX.Fragment package with version 1.5.1 manually to my project, I also updated a couple of other AndroidX packages to make them compatible with AndroidX.Fragment 1.5.1.
Running on Xamarin.Forms 5.0.0.2515
This will give some warning of packages outside of constrains. But at least my app are not crashing anymore.
BTW it seems to happen when the activity gets killed so to debug locally you can tell Android to not keep activities in the developer settings and navigate away from the your app and then back again as described https://github.com/xamarin/Xamarin.Forms/issues/13895#issuecomment-813110989
is the latest fragment version works without issue with the latest XF version now? If not that's annoying because we are tied to a very old version while Google deprecated several apis which relies on Fragment library
Description
Email.ComposeAsync crashes app with Java.Lang.IllegalStateException: FragmentContainer does not have a view
In my code I have a button that will open the email client with a preselected "To" address.
This is the code I am using. var message = new EmailMessage { To = recipients, }; await Email.ComposeAsync(message);
The call to Email.ComposeAsync looks like it working fine, I get the dialog to choose which email app I want to use, then when I select one, my app in the background crashes with this error. This does not happen with other Xamarin Essentials things like "Share" options when email is selected.
Steps to Reproduce
Expected Behavior
App should remain where it was until the user has finished sending their email
Actual Behavior
App crashes when email app is selected
Basic Information
Version with issue:
Last known good version: Not sure
IDE: VS2019
Platform Target Frameworks:
Android Support Library Version: AndroidX
Nuget Packages: Xamarin.Forms 5.0.0.2012 Xamarin.Essentials: 1.6.1
Affected Devices:
Screenshots
JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue args) JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue parameters) Activity.OnStart () FormsAppCompatActivity.OnStart () D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:417 Activity.n_OnStart (System.IntPtr jnienv, System.IntPtr native__this) (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.23(intptr,intptr) java.lang.IllegalStateException: Fragment FragmentContainer{2ab20f} (753ad94b-2740-4b04-8c2b-8b68181c275e) id=0x7} does not have a view androidx.fragment.app.Fragment$4.onFindViewById Fragment.java:2888 androidx.fragment.app.FragmentStateManager.createView FragmentStateManager.java:501 androidx.fragment.app.FragmentStateManager.moveToExpectedState FragmentStateManager.java:282 androidx.fragment.app.FragmentStore.moveToExpectedState FragmentStore.java:112 androidx.fragment.app.FragmentManager.moveToState FragmentManager.java:1636 androidx.fragment.app.FragmentManager.dispatchStateChange FragmentManager.java:3112 androidx.fragment.app.FragmentManager.dispatchActivityCreated FragmentManager.java:3056 androidx.fragment.app.Fragment.performActivityCreated Fragment.java:2989 androidx.fragment.app.FragmentStateManager.activityCreated FragmentStateManager.java:577 androidx.fragment.app.FragmentStateManager.moveToExpectedState FragmentStateManager.java:285 androidx.fragment.app.FragmentStore.moveToExpectedState FragmentStore.java:112 androidx.fragment.app.FragmentManager.moveToState FragmentManager.java:1636 androidx.fragment.app.FragmentManager.dispatchStateChange FragmentManager.java:3112 androidx.fragment.app.FragmentManager.dispatchActivityCreated FragmentManager.java:3056 androidx.fragment.app.FragmentController.dispatchActivityCreated FragmentController.java:251 androidx.fragment.app.FragmentActivity.onStart FragmentActivity.java:473 androidx.appcompat.app.AppCompatActivity.onStart AppCompatActivity.java:210 crc643f46942d9dd1fff9.FormsAppCompatActivity.n_onStart(Native Method) crc643f46942d9dd1fff9.FormsAppCompatActivity.onStart FormsAppCompatActivity.java:128 android.app.Instrumentation.callActivityOnStart Instrumentation.java:1433 android.app.Activity.performStart Activity.java:7980 android.app.ActivityThread.handleStartActivity ActivityThread.java:3578 android.app.servertransaction.TransactionExecutor.performLifecycleSequence TransactionExecutor.java:221 android.app.servertransaction.TransactionExecutor.cycleToPath TransactionExecutor.java:201 android.app.servertransaction.TransactionExecutor.executeLifecycleState TransactionExecutor.java:173 android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:97 android.app.ActivityThread$H.handleMessage ActivityThread.java:2220 android.os.Handler.dispatchMessage Handler.java:107 android.os.Looper.loop Looper.java:237 android.app.ActivityThread.main ActivityThread.java:8016 java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:493 com.android.internal.os.ZygoteInit.main ZygoteInit.java:1076
Reproduction Link