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.24k stars 1.76k forks source link

I'm encountering issues while using databases like MySQL and MSSQL when running my project on a mobile device. #16934

Closed cosocc closed 1 year ago

cosocc commented 1 year ago

Description

Debugging works fine on Windows, but when I switch to running it on a mobile device, I encounter numerous errors.

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/cosocc/MauiMsql.git

Version with bug

7.0.92

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

开始调试 Android 应用程序...
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.mauiplayer/crc64b2d60986a1635b6d.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.mauiplayer/crc64b2d60986a1635b6d.MainActivity }
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/MauiPlayer.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Mono.Android.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Runtime.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Java.Interop.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Runtime.InteropServices.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Collections.dll [External]
Resolved pending breakpoint for 'Android.Runtime.JNIEnv.RegisterJniNatives(System.IntPtr, System.Int32, System.IntPtr, System.IntPtr, System.Int32)' to /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNIEnv.cs:127 [0x00000].
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Threading.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Threading.Thread.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Diagnostics.StackTrace.dll [External]
Loaded assembly: data-0x71a165d78060 [External]
Loaded assembly: data-0x71a165d88070 [External]
Loaded assembly: data-0x71a2198b2e70 [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/netstandard.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Linq.dll [External]
[name.mauiplayer] Late-enabling -Xcheck:jni
[name.mauiplayer] Unexpected CPU variant for x86: x86_64.
[name.mauiplayer] Known variants: atom, sandybridge, silvermont, kabylake, default
[CompatibilityChangeReporter] Compat change id reported: 171979766; UID 10183; state: ENABLED
[nativeloader] Configuring classloader-namespace for other apk /system_ext/framework/androidx.window.extensions.jar. target_sdk_version=33, uses_libraries=ALL, library_path=/data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/lib/x86_64:/data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.companyname.mauiplayer
[nativeloader] Configuring classloader-namespace for other apk /system_ext/framework/androidx.window.sidecar.jar. target_sdk_version=33, uses_libraries=ALL, library_path=/data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/lib/x86_64:/data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.companyname.mauiplayer
[ziparchive] Unable to open '/data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/base.dm': No such file or directory
[ziparchive] Unable to open '/data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/base.dm': No such file or directory
[nativeloader] Configuring classloader-namespace for other apk /data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/base.apk. target_sdk_version=33, uses_libraries=, library_path=/data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/lib/x86_64:/data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.companyname.mauiplayer
[GraphicsEnvironment] ANGLE Developer option for 'com.companyname.mauiplayer' set to: 'default'
[GraphicsEnvironment] ANGLE GameManagerService for com.companyname.mauiplayer: false
[GraphicsEnvironment] Neither updatable production driver nor prerelease driver is supported.
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[debug-app-helper] Checking if libmonodroid was unpacked to /data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/lib/x86_64/libmonodroid.so
[debug-app-helper] Native libs extracted to /data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/lib/x86_64, assuming application/android:extractNativeLibs == true
[debug-app-helper] Setting up for DSO lookup in app data directories
[debug-app-helper] Added filesystem DSO lookup location: /data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/lib/x86_64
[debug-app-helper] Using runtime path: /data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/lib/x86_64
[debug-app-helper] checking directory: `/data/user/0/com.companyname.mauiplayer/files/.__override__/lib`
[debug-app-helper] directory does not exist: `/data/user/0/com.companyname.mauiplayer/files/.__override__/lib`
[debug-app-helper] Checking whether Mono runtime exists at: /data/user/0/com.companyname.mauiplayer/files/.__override__/libmonosgen-2.0.so
[debug-app-helper] Checking whether Mono runtime exists at: /data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/lib/x86_64/libmonosgen-2.0.so
[debug-app-helper] Mono runtime found at: /data/app/~~7ntCT0JQ9Gq9p0-b1NKgIg==/com.companyname.mauiplayer-4nxjQmZg4gCcCKb4vJhtyg==/lib/x86_64/libmonosgen-2.0.so
[name.mauiplayer] Attempt to remove non-JNI local reference, dumping thread
[DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c
[DOTNET] GetOptionalClassGRef: optional class com/android/org/conscrypt/OpenSSLEngineImpl was not found
[monodroid] Creating public update directory: `/data/user/0/com.companyname.mauiplayer/files/.__override__`
[name.mauiplayer] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:27627,embedding=1
[monodroid-assembly] open_from_bundles: failed to load assembly MauiPlayer.dll
[monodroid-gc] GREF GC Threshold: 46080
[monodroid-assembly] open_from_bundles: failed to load assembly Mono.Android.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Java.Interop.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.InteropServices.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.Thread.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.StackTrace.dll
[name.mauiplayer] Attempt to remove non-JNI local reference, dumping thread
[monodroid-assembly] open_from_bundles: failed to load assembly netstandard.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.Concurrent.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Collections.Concurrent.dll [External]
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:423 [0x00000].
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Json.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Text.Json.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encodings.Web.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Text.Encodings.Web.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.ComponentModel.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Maui.Controls.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.ObjectModel.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.ObjectModel.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Maui.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Graphics.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Essentials.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Logging.Abstractions.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Maui.Graphics.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Maui.Essentials.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.Logging.Abstractions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.TypeConverter.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.ComponentModel.TypeConverter.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Uri.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Private.Uri.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Loader.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Runtime.Loader.dll [External]
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:418 [0x00000].
[monodroid-assembly] open_from_bundles: failed to load assembly System.Memory.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Memory.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Emit.Lightweight.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Emit.ILGeneration.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Primitives.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Reflection.Emit.Lightweight.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Reflection.Emit.ILGeneration.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Reflection.Primitives.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Core.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Core.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.Abstractions.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.DependencyInjection.Abstractions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Console.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Console.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Xaml.dll
[monodroid-assembly] open_from_bundles: failed to load assembly CommunityToolkit.Maui.dll
[monodroid-assembly] open_from_bundles: failed to load assembly CommunityToolkit.Maui.Core.dll
[monodroid-assembly] open_from_bundles: failed to load assembly CommunityToolkit.Maui.MediaElement.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Configuration.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Configuration.Abstractions.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Logging.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Logging.Debug.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Maui.Controls.Xaml.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/CommunityToolkit.Maui.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/CommunityToolkit.Maui.Core.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/CommunityToolkit.Maui.MediaElement.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.Configuration.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.Configuration.Abstractions.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.Logging.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.Logging.Debug.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.AppCompat.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Google.Android.Material.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SwipeRefreshLayout.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.AppCompat.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.Google.Android.Material.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.SwipeRefreshLayout.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Fragment.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Activity.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.ViewModel.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.Common.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SavedState.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Fragment.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Activity.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Lifecycle.ViewModel.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Lifecycle.Common.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.SavedState.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.DrawerLayout.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CustomView.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Navigation.Runtime.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.DrawerLayout.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.CustomView.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Navigation.Runtime.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Net.Primitives.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Net.Primitives.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Options.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.Options.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.DependencyInjection.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.Tracing.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Diagnostics.Tracing.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Xml.ReaderWriter.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Xml.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Xml.ReaderWriter.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Private.Xml.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encoding.Extensions.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Text.Encoding.Extensions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Numerics.Vectors.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Numerics.Vectors.dll [External]
[name.mauiplayer] Explicit concurrent copying GC freed 3959(501KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 2074KB/4148KB, paused 329us,57us total 3.890ms
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.RegularExpressions.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Text.RegularExpressions.dll [External]
Thread started:  #2
Thread started:  #3
Thread started:  #4
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Json.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.DataContractSerialization.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Xml.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Primitives.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Runtime.Serialization.Json.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Private.DataContractSerialization.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Runtime.Serialization.Xml.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Runtime.Serialization.Primitives.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.RecyclerView.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CardView.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.RecyclerView.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.CardView.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CoordinatorLayout.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.CoordinatorLayout.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly ExoPlayer.Common.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/ExoPlayer.Common.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Loader.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Loader.dll [External]
[libEGL] loaded /vendor/lib64/egl/libEGL_emulation.so
[libEGL] loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
[libEGL] loaded /vendor/lib64/egl/libGLESv2_emulation.so
[monodroid-assembly] open_from_bundles: failed to load assembly ExoPlayer.Core.dll
[monodroid-assembly] open_from_bundles: failed to load assembly ExoPlayer.Dash.dll
[monodroid-assembly] open_from_bundles: failed to load assembly ExoPlayer.dll
[monodroid-assembly] open_from_bundles: failed to load assembly ExoPlayer.Hls.dll
[monodroid-assembly] open_from_bundles: failed to load assembly ExoPlayer.Rtsp.dll
[monodroid-assembly] open_from_bundles: failed to load assembly ExoPlayer.SmoothStreaming.dll
[monodroid-assembly] open_from_bundles: failed to load assembly ExoPlayer.Transformer.dll
[monodroid-assembly] open_from_bundles: failed to load assembly ExoPlayer.UI.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Compatibility.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/ExoPlayer.Core.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/ExoPlayer.Dash.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/ExoPlayer.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/ExoPlayer.Hls.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/ExoPlayer.Rtsp.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/ExoPlayer.SmoothStreaming.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/ExoPlayer.Transformer.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/ExoPlayer.UI.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Maui.Controls.Compatibility.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Window.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Window.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.LiveData.Core.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Lifecycle.LiveData.Core.dll [External]
[name.mauiplayer] Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
[name.mauiplayer] Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.ViewPager2.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.ViewPager2.dll [External]
[CompatibilityChangeReporter] Compat change id reported: 171228096; UID 10183; state: ENABLED
[TabLayout] MODE_SCROLLABLE + GRAVITY_FILL is not supported, GRAVITY_START will be used instead
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.Runtime.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.Lifecycle.Runtime.dll [External]
[CompatibilityChangeReporter] Compat change id reported: 210923482; UID 10183; state: ENABLED
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.ViewPager.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Xamarin.AndroidX.ViewPager.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.EntityFrameworkCore.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.EntityFrameworkCore.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.Expressions.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Linq.Expressions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.Immutable.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Collections.Immutable.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Caching.Abstractions.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.Caching.Abstractions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.DiagnosticSource.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Diagnostics.DiagnosticSource.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.EntityFrameworkCore.Abstractions.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.EntityFrameworkCore.Abstractions.dll [External]
Loaded assembly: Anonymously Hosted DynamicMethods Assembly [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Pomelo.EntityFrameworkCore.MySql.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.EntityFrameworkCore.Relational.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Pomelo.EntityFrameworkCore.MySql.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.EntityFrameworkCore.Relational.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly MySqlConnector.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Data.Common.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.Primitives.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/MySqlConnector.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Data.Common.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.ComponentModel.Primitives.dll [External]
[name.mauiplayer] Explicit concurrent copying GC freed 568(74KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 3072KB/6144KB, paused 342us,64us total 5.438ms
[monodroid-assembly] open_from_bundles: failed to load assembly System.Transactions.Local.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Transactions.Local.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Caching.Memory.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.Caching.Memory.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Primitives.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Extensions.Primitives.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.Annotations.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.ComponentModel.Annotations.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.Queryable.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Linq.Queryable.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Security.Cryptography.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.NonGeneric.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Net.Security.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Security.Cryptography.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Collections.NonGeneric.dll [External]
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Net.Security.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Net.Sockets.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Net.Sockets.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Win32.Primitives.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/Microsoft.Win32.Primitives.dll [External]
Thread started: .NET Timer #5
[monodroid-assembly] open_from_bundles: failed to load assembly System.Net.NameResolution.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Net.NameResolution.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.ThreadPool.dll
Loaded assembly: /data/data/com.companyname.mauiplayer/files/.__override__/System.Threading.ThreadPool.dll [External]
Thread started: .NET Sockets #6
[System.err] javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
[System.err]    at com.android.org.conscrypt.SSLUtils.toSSLHandshakeException(SSLUtils.java:363)
[System.err]    at com.android.org.conscrypt.ConscryptEngine.convertException(ConscryptEngine.java:1134)
[System.err]    at com.android.org.conscrypt.ConscryptEngine.readPlaintextData(ConscryptEngine.java:1089)
[System.err]    at com.android.org.conscrypt.ConscryptEngine.unwrap(ConscryptEngine.java:876)
[System.err]    at com.android.org.conscrypt.ConscryptEngine.unwrap(ConscryptEngine.java:747)
[System.err]    at com.android.org.conscrypt.ConscryptEngine.unwrap(ConscryptEngine.java:712)
[System.err]    at com.android.org.conscrypt.Java8EngineWrapper.unwrap(Java8EngineWrapper.java:237)
[System.err]    at crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(Native Method)
[System.err]    at crc640ec207abc449b2ca.ShellSectionRenderer.onCreateView(ShellSectionRenderer.java:44)
[System.err]    at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3104)
[System.err]    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:524)
[System.err]    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
[System.err]    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899)
[System.err]    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1823)
[System.err]    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
[System.err]    at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2985)
[System.err]    at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:2888)
[System.err]    at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3129)
[System.err]    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:552)
[System.err]    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
[System.err]    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899)
[System.err]    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1823)
[System.err]    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
[System.err]    at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2985)
[System.err]    at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2895)
[System.err]    at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
[System.err]    at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:351)
[System.err]    at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:248)
[System.err]    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1543)
[System.err]    at android.app.Activity.performStart(Activity.java:8330)
[System.err]    at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3670)
[System.err]    at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
[System.err]    at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
[System.err]    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
[System.err]    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
[System.err]    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
[System.err]    at android.os.Handler.dispatchMessage(Handler.java:106)
[System.err]    at android.os.Looper.loopOnce(Looper.java:201)
[System.err]    at android.os.Looper.loop(Looper.java:288)
[System.err]    at android.app.ActivityThread.main(ActivityThread.java:7872)
[System.err]    at java.lang.reflect.Method.invoke(Native Method)
[System.err]    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
[System.err]    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
[System.err] Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
[System.err]    at com.android.org.conscrypt.TrustManagerImpl.verifyChain(TrustManagerImpl.java:670)
[System.err]    at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:547)
[System.err]    at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:613)
[System.err]    at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:503)
[System.err]    at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:423)
[System.err]    at com.android.org.conscrypt.TrustManagerImpl.getTrustedChainForServer(TrustManagerImpl.java:366)
[System.err]    at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:102)
[System.err]    at android.security.net.config.RootTrustManager.checkServerTrusted(RootTrustManager.java:106)
[System.err]    at com.android.org.conscrypt.Platform.checkServerTrusted(Platform.java:255)
[System.err]    at com.android.org.conscrypt.ConscryptEngine.verifyCertificateChain(ConscryptEngine.java:1638)
[System.err]    at com.android.org.conscrypt.NativeCrypto.ENGINE_SSL_read_direct(Native Method)
[System.err]    at com.android.org.conscrypt.NativeSsl.readDirectByteBuffer(NativeSsl.java:569)
[System.err]    at com.android.org.conscrypt.ConscryptEngine.readPlaintextDataDirect(ConscryptEngine.java:1095)
[System.err]    at com.android.org.conscrypt.ConscryptEngine.readPlaintextDataHeap(ConscryptEngine.java:1115)
[System.err]    at com.android.org.conscrypt.ConscryptEngine.readPlaintextData(ConscryptEngine.java:1087)
[System.err]    ... 40 more
[System.err] Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
[System.err]    ... 55 more
[monodroid-assembly] open_from_bundles: failed to load assembly en-US/Pomelo.EntityFrameworkCore.MySql.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en-US/Pomelo.EntityFrameworkCore.MySql.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en/Pomelo.EntityFrameworkCore.MySql.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en/Pomelo.EntityFrameworkCore.MySql.resources.dll
**System.Reflection.TargetInvocationException:** 'Exception has been thrown by the target of an invocation.'
ghost commented 1 year ago

Hi @cosocc. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

cosocc commented 1 year ago

Hi @cosocc. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

thanks for your reply! https://github.com/cosocc/MauiMsql.git

PureWeen commented 1 year ago

@jonathanpeppers @steveisok thoughts?

steveisok commented 1 year ago

@simonrozsival would likely know more.

simonrozsival commented 1 year ago

@cosocc what TLS certificate does the MySQL server use? I would expect this failure in the case of self-signed certificates. Unfortunately, working with self-signed certificates is a bit cumbersome on Android. You will likely need to install the TLS certificate on the Android device or use network security config to tell Android to trust your certificate.

cosocc commented 1 year ago

关于linux服务器配置问题: step 1:

暂时这里是我存放的位置

cd /etc/mysql/mysql.conf.d#
step 2 :

/etc/mysql/mysql.conf.d#

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 step 3:

等待片刻会让你输入认证密码: Enter Pem pass phrase: ****

step4: Country Name (2 letter code) [AU] : CH

step5: State or Province Name (full name) [Some-State] :Zhe Jiang

step6: Locality Name (eg,city) []: Wen Zhou

step7:

Oraganizational Unit Name (eg, section) []:Development Team

step8: common Name (e.g. server FQDN or your name) []:cosocc

step9: Email Address [] :121907007@qq.com

到这里已经生成了 cert.pem key.pem

vim mysqld.cnf

[mysqld] ssl-cert=/etc/mysql/mysql.conf.d/cert.pem ssl-key=/etc/mysql/mysql.conf.d/key.pem

保存退出:

wq

然后在项目中进行相关的配置 D:\MauiMsql\Platforms\Android\AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    < application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"   android:networkSecurityConfig="@xml/network_security_config"></application>
    < uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

复制代码

D:\MauiMsql\Platforms\Android\Resources\xml\network_security_config.xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="false">
        <trust-anchors>
            <!--<certificates src="@raw/cert.pem"/>-->
            <!-- Replace with your certificate file name -->
        </trust-anchors>
    </base-config>
</network-security-config>

复制代码

D:\MauiMsql\Platforms\Android\Resources\raw\cert.pem D:\MauiPlayer\MauiMsql\Platforms\Android\Resources\raw\key.pem

cosocc commented 1 year ago

@cosocc what TLS certificate does the MySQL server use? I would expect this failure in the case of self-signed certificates. Unfortunately, working with self-signed certificates is a bit cumbersome on Android. You will likely need to install the TLS certificate on the Android device or use network security config to tell Android to trust your certificate. @simonrozsival thank you very so much ! I edited and resolved the issue as mentioned above, although there are still some lingering questions. However, it has helped resolve the debugging problem. I'm grateful for everyone's attention!

Sorry, my English is not good, so some places directly use Chinese!