dotnet / docs-maui

This repository contains documentation for .NET Multi-platform App UI (MAUI).
https://docs.microsoft.com/dotnet/maui
Creative Commons Attribution 4.0 International
227 stars 198 forks source link

MediaPicker.Default.CapturePhotoAsync() Crash #721

Closed 6rube closed 1 year ago

6rube commented 2 years ago

When i try to make photos the programm just crashes.

My Function:

public async void TakePhoto()
    {
        if (MediaPicker.Default.IsCaptureSupported)
        {
            FileResult photo = await MediaPicker.Default.CapturePhotoAsync();

            if (photo != null)
            {
                // save the file into local storage
                string localFilePath = Path.Combine(FileSystem.CacheDirectory, photo.FileName);

                using Stream sourceStream = await photo.OpenReadAsync();
                using FileStream localFileStream = File.OpenWrite(localFilePath);

                await sourceStream.CopyToAsync(localFileStream);
            }
        }
}

Other Information:

Debuq Log `> at start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.ProjectName/crc64cab5159034b1c301.MainActivity"

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.ProjectName/crc64cab5159034b1c301.MainActivity } Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/ProjectName.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Mono.Android.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Runtime.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Java.Interop.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/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:124 [0x00000]. Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Threading.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Runtime.InteropServices.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Threading.Thread.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Diagnostics.StackTrace.dll [External] Loaded assembly: data-0x7658c36200 [External] Loaded assembly: data-0x76579638c0 [External] Loaded assembly: data-0x765797b780 [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/netstandard.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Linq.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/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:419 [0x00000]. Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Text.Json.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Text.Encodings.Web.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.ComponentModel.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Microsoft.Maui.Controls.dll [External] [me.Projectname] Late-enabling -Xcheck:jni [me.Projectname] Unknown bits set in runtime_flags: 0x8000 [me.Projectname] The ClassLoaderContext is a special shared library. [Perf] Connecting to perf service. [debug-app-helper] Checking if libmonodroid was unpacked to /data/app/com.companyname.ProjectName-vpDyzz-vurEcR7CLuUrf6A==/lib/arm64/libmonodroid.so [debug-app-helper] Native libs extracted to /data/app/com.companyname.ProjectName-vpDyzz-vurEcR7CLuUrf6A==/lib/arm64, 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/com.companyname.ProjectName-vpDyzz-vurEcR7CLuUrf6A==/lib/arm64 [debug-app-helper] Using runtime path: /data/app/com.companyname.ProjectName-vpDyzz-vurEcR7CLuUrf6A==/lib/arm64 [debug-app-helper] checking directory: /data/user/0/com.companyname.ProjectName/files/.__override__/lib [debug-app-helper] directory does not exist: /data/user/0/com.companyname.ProjectName/files/.__override__/lib [debug-app-helper] Checking whether Mono runtime exists at: /data/user/0/com.companyname.ProjectName/files/.override/libmonosgen-2.0.so [debug-app-helper] Checking whether Mono runtime exists at: /data/app/com.companyname.ProjectName-vpDyzz-vurEcR7CLuUrf6A==/lib/arm64/libmonosgen-2.0.so [debug-app-helper] Mono runtime found at: /data/app/com.companyname.ProjectName-vpDyzz-vurEcR7CLuUrf6A==/lib/arm64/libmonosgen-2.0.so [me.Projectname] Attempt to remove non-JNI local reference, dumping thread [DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c [monodroid] Creating public update directory: /data/user/0/com.companyname.ProjectName/files/.__override__ [me.Projectname] 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=127.0.0.1:8903,server=y,embedding=1 [monodroid-assembly] open_from_bundles: failed to load assembly ProjectName.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.Collections.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.InteropServices.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 [me.Projectname] 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 [monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Json.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encodings.Web.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.dll [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 [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.ProjectName/files/.override/System.ObjectModel.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/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.ProjectName/files/.override/Microsoft.Maui.Graphics.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Microsoft.Maui.Essentials.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/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.ProjectName/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.ProjectName/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.ProjectName/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:414 [0x00000]. [monodroid-assembly] open_from_bundles: failed to load assembly System.Memory.dll Loaded assembly: /data/data/com.companyname.ProjectName/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.ProjectName/files/.override/System.Reflection.Emit.Lightweight.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Reflection.Emit.ILGeneration.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Reflection.Primitives.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.CompilerServices.Unsafe.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Runtime.CompilerServices.Unsafe.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Core.dll Loaded assembly: /data/data/com.companyname.ProjectName/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.ProjectName/files/.override/Microsoft.Extensions.DependencyInjection.Abstractions.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 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 Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Microsoft.Maui.Controls.Xaml.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Microsoft.Extensions.Configuration.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Microsoft.Extensions.Configuration.Abstractions.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Microsoft.Extensions.Logging.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.ProjectName/files/.override/Xamarin.AndroidX.AppCompat.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.Google.Android.Material.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/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.ProjectName/files/.override/Xamarin.AndroidX.Fragment.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.Activity.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.Lifecycle.ViewModel.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.Lifecycle.Common.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/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.ProjectName/files/.override/Xamarin.AndroidX.DrawerLayout.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.CustomView.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/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.ProjectName/files/.override/System.Net.Primitives.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.dll Loaded assembly: /data/data/com.companyname.ProjectName/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.ProjectName/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.ProjectName/files/.override/System.Xml.ReaderWriter.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/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.ProjectName/files/.override/System.Text.Encoding.Extensions.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Text.RegularExpressions.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Text.RegularExpressions.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly de-DE/System.Private.CoreLib.resources.dll [monodroid-assembly] open_from_bundles: failed to load assembly de-DE/System.Private.CoreLib.resources.dll [monodroid-assembly] open_from_bundles: failed to load assembly de/System.Private.CoreLib.resources.dll [monodroid-assembly] open_from_bundles: failed to load assembly de/System.Private.CoreLib.resources.dll [monodroid-assembly] open_from_bundles: failed to load assembly System.Numerics.Vectors.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Numerics.Vectors.dll [External] [me.Projectname] Explicit concurrent copying GC freed 1434(123KB) AllocSpace objects, 0(0B) LOS objects, 78% free, 1112KB/5208KB, paused 43us total 9.808ms [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.ProjectName/files/.override/Xamarin.AndroidX.RecyclerView.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.CardView.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly BarcodeScanner.Mobile.Maui.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/BarcodeScanner.Mobile.Maui.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Camera.View.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Google.Guava.ListenableFuture.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Camera.Core.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.Camera.View.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.Google.Guava.ListenableFuture.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.Camera.Core.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Loader.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.Loader.dll [External] [Perf] Fail to get file list com.companyname.ProjectName [Perf] getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array [monodroid-assembly] open_from_bundles: failed to load assembly BarcodeScanner.Mobile.Core.dll [monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Compatibility.dll [monodroid-assembly] open_from_bundles: failed to load assembly Plugin.Media.dll [monodroid-assembly] open_from_bundles: failed to load assembly mscorlib.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Essentials.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/BarcodeScanner.Mobile.Core.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Microsoft.Maui.Controls.Compatibility.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Plugin.Media.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/mscorlib.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.Essentials.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 Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Runtime.Serialization.Json.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Private.DataContractSerialization.dll [External] Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Runtime.Serialization.Xml.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Primitives.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Runtime.Serialization.Primitives.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly de-DE/System.Private.DataContractSerialization.resources.dll [monodroid-assembly] open_from_bundles: failed to load assembly de-DE/System.Private.DataContractSerialization.resources.dll [monodroid-assembly] open_from_bundles: failed to load assembly de/System.Private.DataContractSerialization.resources.dll [monodroid-assembly] open_from_bundles: failed to load assembly de/System.Private.DataContractSerialization.resources.dll [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CoordinatorLayout.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.CoordinatorLayout.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.LiveData.Core.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.Lifecycle.LiveData.Core.dll [External] [me.Projectname] Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) [me.Projectname] Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.ViewPager2.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.ViewPager2.dll [External] [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.ProjectName/files/.override/Xamarin.AndroidX.Lifecycle.Runtime.dll [External] [monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.ViewPager.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/Xamarin.AndroidX.ViewPager.dll [External] Thread started: .NET Timers #5 [AdrenoGLES] QUALCOMM build : 7331a27, Ieeb4a86f7b [AdrenoGLES] Build Date : 11/13/19 [AdrenoGLES] OpenGL ES Shader Compiler Version: EV031.27.05.02 [AdrenoGLES] Local Branch : [AdrenoGLES] Remote Branch : [AdrenoGLES] Remote Branch : [AdrenoGLES] Reconstruct Branch : [AdrenoGLES] Build Config : S L 8.0.12 AArch64 [AdrenoGLES] PFP: 0x005ff113, ME: 0x005ff066 [AdrenoUtils] : Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model [AdrenoUtils] : Failed to read chip ID from gpu_model. Fallback to use the GSL path [Gralloc3] mapper 3.x is not supported [OpenGLRenderer] Davey! duration=832ms; Flags=1, IntendedVsync=669429356440523, Vsync=669429406440521, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=669429419670476, AnimationStart=669429419812299, PerformTraversalsStart=669429419823237, DrawStart=669430034691257, SyncQueued=669430102073966, SyncStart=669430102658914, IssueDrawCommandsStart=669430102855632, SwapBuffers=669430184680372, FrameCompleted=669430189584278, DequeueBufferDuration=378000, QueueBufferDuration=2567000, [Choreographer] Skipped 45 frames! The application may be doing too much work on its main thread. [OpenGLRenderer] Davey! duration=765ms; Flags=0, IntendedVsync=669429440260732, Vsync=669430190260702, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=669430192886674, AnimationStart=669430192992403, PerformTraversalsStart=669430193206205, DrawStart=669430195823653, SyncQueued=669430196530320, SyncStart=669430199711101, IssueDrawCommandsStart=669430199911309, SwapBuffers=669430204657403, FrameCompleted=669430208696622, DequeueBufferDuration=2036000, QueueBufferDuration=2544000, Thread started: #6 Thread started: .NET ThreadPool Gate #7 Thread started: #8 [monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Intrinsics.dll Loaded assembly: /data/data/com.companyname.ProjectName/files/.override/System.Runtime.Intrinsics.dll [External] [me.Projectname] Explicit concurrent copying GC freed 7746(1113KB) AllocSpace objects, 0(0B) LOS objects, 81% free, 2881KB/14MB, paused 54us total 31.649ms Thread started: #9 Thread started: #10 Thread started: #11 Thread started: #12 Thread started: #13 Thread started: #14 [me.Projectname] Accessing hidden method Landroid/content/ContextWrapper;->getDisplay()Landroid/view/Display; (greylist, linking, allowed)`

davidbritch commented 1 year ago

Hi @6rube

Apologies for the much delayed response to this. For help and questions about using this product, please ask a question at Microsoft Q&A. Thanks!

eli191 commented 9 months ago

@davidbritch

This line crashes FileResult photo = await MediaPicker.Default.CapturePhotoAsync(); once a photo is taken and the user chooses it.

Exception is

System.NullReferenceException
Object reference not set to an instance of an object.

Stack is

D:\a\_work\1\s\src\Essentials\src\FileSystem\FileSystemUtils.android.cs in string FileSystemUtils.EnsurePhysicalPath(Uri uri, bool requireExtendedAccess) at line 58:4
Assembly:
Microsoft.Maui.Essentials
Version:
1.0.0.0
davidbritch commented 9 months ago

@eli191

It might be worth trying in 8.0.6, as some work was done on media capture on Android in that release.

eli191 commented 8 months ago

@davidbritch The version I use is 8.0.6-nightly.9827+sha.aa28d78367-azdo.8893595

eli191 commented 8 months ago

@davidbritch Stack of crash : (from sentry.io)

Crashed in non-app: string FileSystemUtils.EnsurePhysicalPath(Uri, bool)
void <>c__DisplayClass7_0.<CaptureAsync>g__OnResult|0(?)+OnResult(Intent intent)
void IntermediateActivity.OnActivityResult(int, Result, Intent)
async Task<FileResult> MediaPickerImplementation.CaptureAsync(MediaPickerOptions, bool)
async Task<bool> PhotoPage.TakePhotoAsync()  <- this line is my code
davidbritch commented 8 months ago

@eli191

Does taking a photo crash for you in this sample?