[BUG] Setting Main page crashes when using MediaElement
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Empieza ejecutando la reproducción vinculada de MediaPlayerSampleCrash y cambiando MainPage después de mostrar MediaElement en Android. Rastrea la ruta de liberación mostrada en el stack trace, especialmente WindowOverlay.DeinitializePlatformDependencies y MauiMediaElement, y verifica que la misma transición se complete sin un Android.Runtime.JavaProxyThrowable ni una ObjectDisposedException.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- 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
Adding MediaElemenet to a page, and then changing the MainPage results in a crash on Android.
I have this on my login page as a background image. Once a user logins i change the MainPage to my actual app. at this point the app crashes.
<toolkit:MediaElement
x:Name="BackgroundVideo"
Aspect="AspectFill"
ShouldAutoPlay="True"
ShouldLoopPlayback="True"
ShouldMute="True"
ShouldShowPlaybackControls="False" />
Something like this is called on successful login:
Application.Current.MainPage = new Page2();
on android, this results in a crash.
<HTML>
<head>
| Name | Value | Type
-- | -- | -- | --
◢ | $exception | {"Exception of type 'Android.Runtime.JavaProxyThrowable' was thrown."} | Android.Runtime.JavaProxyThrowable
| ▶ Cause | null | Java.Lang.Throwable
| ▶ Class | {class android.runtime.JavaProxyThrowable} | Java.Lang.Class
| ▶ Data | Count = 0 | System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
| HResult | -2146233088 | int
| Handle | 0x0000731cfe7d1388 | System.IntPtr
| HelpLink | null | string
| ▶ InnerException (System.Exception) | null | System.Exception
| ▶ InnerException | {"Cannot access disposed object with JniIdentityHashCode=252555712."} | System.Exception {System.ObjectDisposedException}
| JavaStackTrace | "android.runtime.JavaProxyThrowable\n" | string
| JniIdentityHashCode (Java.Interop.JavaException) | 211393919 | int
| JniIdentityHashCode | 211393919 | int
| JniManagedPeerState | None | Java.Interop.JniManagedPeerStates
| LocalizedMessage | "[System.ObjectDisposedException]: Cannot access disposed object with JniIdentityHashCode=252555712.\nObject name: 'CommunityToolkit.Maui.Core.Views.MauiMediaElement'." | string
| Message (System.Exception) | "Exception of type 'Android.Runtime.JavaProxyThrowable' was thrown." | string
| Message | "[System.ObjectDisposedException]: Cannot access disposed object with JniIdentityHashCode=252555712.\nObject name: 'CommunityToolkit.Maui.Core.Views.MauiMediaElement'." | string
| ▶ PeerReference (Java.Interop.JavaException) | {Java.Interop.JniObjectReference} | Java.Interop.JniObjectReference
| Source | "Mono.Android.Runtime" | string
| StackTrace | "\n --- End of managed Android.Runtime.JavaProxyThrowable stack trace ---\nandroid.runtime.JavaProxyThrowable\n" | string
| TargetSite | null | System.Reflection.MethodBase
| is_generated | false | bool
| ▶ Static members | |
| ▶ Non-Public members | |
Android.Runtime.JavaProxyThrowable
HResult=0x80131500
Source=
StackTrace:
An unhandled exception of type 'Android.Runtime.JavaProxyThrowable' occurred in Mono.Android.Runtime.dll
07-11 17:46:33.945 D/AndroidRuntime(17216): Shutting down VM
07-11 17:46:33.946 E/AndroidRuntime(17216): FATAL EXCEPTION: main
07-11 17:46:33.946 E/AndroidRuntime(17216): Process: com.companyname.mediaplayersample, PID: 17216
07-11 17:46:33.946 E/AndroidRuntime(17216): android.runtime.JavaProxyThrowable: [System.ObjectDisposedException]: Cannot access disposed object with JniIdentityHashCode=252555712.
07-11 17:46:33.946 E/AndroidRuntime(17216): Object name: 'CommunityToolkit.Maui.Core.Views.MauiMediaElement'.
07-11 17:46:33.946 E/AndroidRuntime(17216): at Java.Interop.JniPeerMembers.AssertSelf + 0x1e(Unknown Source)
07-11 17:46:33.946 E/AndroidRuntime(17216): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod + 0x0(Unknown Source)
07-11 17:46:33.946 E/AndroidRuntime(17216): at Android.Views.ViewGroup.RemoveView + 0x27(Unknown Source)
07-11 17:46:33.946 E/AndroidRuntime(17216): at Microsoft.Maui.WindowOverlay.DeinitializePlatformDependencies(/_/src/Core/src/WindowOverlay/WindowOverlay.Android.cs:86)
07-11 17:46:33.946 E/AndroidRuntime(17216): at Microsoft.Maui.WindowOverlay.Deinitialize(/_/src/Core/src/WindowOverlay/WindowOverlay.cs:90)
07-11 17:46:33.946 E/AndroidRuntime(17216): at Microsoft.Maui.VisualDiagnosticsOverlay.Deinitialize(/_/src/Core/src/VisualDiagnostics/VisualDiagnosticsOverlay.cs:186)
07-11 17:46:33.946 E/AndroidRuntime(17216): at Microsoft.Maui.Handlers.WindowHandler.OnRootViewChanged(/_/src/Core/src/Handlers/Window/WindowHandler.Android.cs:92)
07-11 17:46:33.946 E/AndroidRuntime(17216): at Microsoft.Maui.Platform.NavigationRootManager.OnWindowContentPlatformViewCreated(/_/src/Core/src/Platform/Android/Navigation/NavigationRootManager.cs:129)
07-11 17:46:33.946 E/AndroidRuntime(17216): at Microsoft.Maui.Platform.NavigationRootManager+ElementBasedFragment.OnViewCreated(/_/src/Core/src/Platform/Android/Navigation/NavigationRootManager.cs:234)
07-11 17:46:33.946 E/AndroidRuntime(17216): at AndroidX.Fragment.App.Fragment.n_OnViewCreated_Landroid_view_View_Landroid_os_Bundle_(C:\a\_work\1\s\generated\androidx.fragment.fragment\obj\Release
et10.0-android\generated\src\AndroidX.Fragment.App.Fragment.cs:3300)
07-11 17:46:33.946 E/AndroidRuntime(17216): at crc6452ffdc5b34af3a0f.NavigationRootManager_ElementBasedFragment.n_onViewCreated(Native Method)
07-11 17:46:33.946 E/AndroidRuntime(17216): at crc6452ffdc5b34af3a0f.NavigationRootManager_ElementBasedFragment.onViewCreated(NavigationRootManager_ElementBasedFragment.java:36)
07-11 17:46:33.946 E/AndroidRuntime(17216): at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3152)
07-11 17:46:33.946 E/AndroidRuntime(17216): at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:608)
07-11 17:46:33.946 E/AndroidRuntime(17216): at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
07-11 17:46:33.946 E/AndroidRuntime(17216): at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2214)
07-11 17:46:33.946 E/AndroidRuntime(17216): at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2115)
07-11 17:46:33.946 E/AndroidRuntime(17216): at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2052)
07-11 17:46:33.946 E/AndroidRuntime(17216): at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:703)
07-11 17:46:33.946 E/AndroidRuntime(17216): at android.os.Handler.handleCallback(Handler.java:942)
07-11 17:46:33.946 E/AndroidRuntime(17216): at android.os.Handler.dispatchMessage(Handler.java:99)
07-11 17:46:33.946 E/AndroidRuntime(17216): at android.os.Looper.loopOnce(Looper.java:201)
07-11 17:46:33.946 E/AndroidRuntime(17216): at android.os.Looper.loop(Looper.java:288)
07-11 17:46:33.946 E/AndroidRuntime(17216): at android.app.ActivityThread.main(ActivityThread.java:7892)
07-11 17:46:33.946 E/AndroidRuntime(17216): at java.lang.reflect.Method.invoke(Native Method)
07-11 17:46:33.946 E/AndroidRuntime(17216): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
07-11 17:46:33.946 E/AndroidRuntime(17216): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Expected Behavior
app should not crash
Steps To Reproduce
- Open and run solution
- Click button
Link to public reproduction project repository
https://github.com/ssbssb-cmd/MediaPlayerSampleCrash
Environment
- .NET MAUI CommunityToolkit:10.0.0
- OS: Windows 11
- .NET MAUI: 10
- .NET MAUI Controls: 10.0.80
Anything else?
No response
- Lenguaje dominante
- C#
- Estrellas
- 2.7k
- Forks
- 503
- Merge medio
- 11 h 10 min
- PR fusionados (30 d)
- 50
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CommunityToolkit/Maui
-
new proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
CommunityToolkit/Maui#3449 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug unverified
Dificultad 3/5 1-2 días Aptitud para principiantes 63/100
CommunityToolkit/Maui#3443 ·
Los mantenedores suelen responder en 1 día
-
[Proposal] Keep the device tests on the newest OS releases automaticallyPosiblemente ocupada @TheCodeTraveler la tomó hace 4 días. Abiertoapproved champion proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
CommunityToolkit/Maui#3438 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
new proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 8/100
CommunityToolkit/Maui#3436 ·
Los mantenedores suelen responder en 1 día
-
[BUG] The popup positioning changing if SetShouldUseStatusBarBehaviorOnAndroidModalPage is trueAbiertobug unverified
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
CommunityToolkit/Maui#3425 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de CommunityToolkit/Maui
Issues similares
-
Unit converter reads out of bounds when the saved UnitConverterPreferences setting is malformedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/calculator#2532 ·
-
Scaffold marks an association as required when its composite foreign key has a nullable columnAbiertoarea: scaffold status: needs-tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
provider:flagd type:fix
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
open-feature/dotnet-sdk-contrib#789 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
NimblePros/Metronome#23 ·
-
ci(runners): le workflow Mirror state advisory rougit a tort quand jq manque sur le slot (exit 127), alors que l'organe conclut "etat non lisible"Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
jsboige/CoursIA#28504 · 3 comentarios ·
Los mantenedores suelen responder en 1 día