c# - Xamarin mediaPicker.TakePhotoAsync crashes app -


i have xamarin.forms app uses xlabs, working fine, started crash app, if take photo or press button photo screen, googling around 4 hours , still have no idea why happening, ideas or thoughts, please help!

here lines of code:

    private async task takepicture()     {         mediapicker = resolver.resolve<idevice>().mediapicker;          try         {             var mediafile = await mediapicker.takephotoasync(new cameramediastorageoptions             {                 defaultcamera = cameradevice.front,                 maxpixeldimension = 1,                 percentquality = 2,             });              var image = getresizedimage(mediafile.source, 990, 560);             onimageupdate(this, image);         }         catch (exception ex)         {             this.status = ex.message;         }     } 

my permission alright:

<uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.camera" /> 

stacktrace:

07-02 16:01:20.433 d/mono    (20722): assembly ref addref xlabs.platform.droid[0x77114be8] -> system[0x7915c498]: 14 07-02 16:01:20.463 d/activity(20722): #1 settransgradationmodecolor false 07-02 16:01:21.118 d/mono    (20722): assembly ref addref xamarin.forms.platform.android[0x7710d050] -> system.xml[0x77bdfb08]: 6 07-02 16:01:21.143 d/mono    (20722): assembly ref addref system.runtime.serialization[0x7b249010] -> system[0x7915c498]: 15 07-02 16:01:21.223 d/mono    (20722): assembly ref addref system.runtime.serialization[0x7b249010] -> system.core[0x77910b48]: 13 07-02 16:01:21.393 d/abslistview(20722): ondetachedfromwindow 07-02 16:01:21.413 d/abslistview(20722): ondetachedfromwindow 07-02 16:01:21.978 d/locationhandler(20722): logged location changed: location[fused 55.545249,37.561894 acc=10 et=+3d2h50m24s315ms] 07-02 16:01:26.948 d/locationhandler(20722): logged location changed: location[fused 55.545247,37.561896 acc=10 et=+3d2h50m29s329ms] 07-02 16:01:30.343 d/activity(20722): #1 settransgradationmodecolor false 07-02 16:01:30.503 i/dalvikvm-heap(20722): grow heap (frag case) 70.455mb 47775760-byte allocation 07-02 16:01:30.528 d/dalvikvm(20722): gc_concurrent freed 11651k, 22% free 59395k/75312k, paused 1ms+2ms, total 26ms 07-02 16:01:30.898 d/dalvikvm(20722): gc_explicit freed 7037k, 28% free 54531k/75312k, paused 1ms+3ms, total 21ms 07-02 16:01:30.908 d/mono    (20722): gc_old_bridge num-objects 532 num_hash_entries 585 sccs size 580 init 0.00ms df1 1.07ms sort 0.20ms dfs2 0.67ms setup-cb 0.58ms free-data 0.92ms links 66/66/60/2 dfs passes 1183/646 07-02 16:01:30.908 d/mono    (20722): gc_major: (los overflow) pause 19.10ms, total 19.27ms, bridge 39.09ms major 2240k/2096k los 3281k/17532k 07-02 16:01:30.943 e/moreinfohpw_view(20722): parent view not textview 07-02 16:01:30.983 d/progressbar(20722): updatedrawablebounds: left = 0 07-02 16:01:30.983 d/progressbar(20722): updatedrawablebounds: top = 0 07-02 16:01:30.983 d/progressbar(20722): updatedrawablebounds: right = -2 07-02 16:01:30.983 d/progressbar(20722): updatedrawablebounds: bottom = -2 07-02 16:01:30.993 d/progressbar(20722): updatedrawablebounds: left = 0 07-02 16:01:30.993 d/progressbar(20722): updatedrawablebounds: top = 0 07-02 16:01:30.993 d/progressbar(20722): updatedrawablebounds: right = -2 07-02 16:01:30.993 d/progressbar(20722): updatedrawablebounds: bottom = -2 07-02 16:01:31.003 d/activity(20722): #3 settransgradationmodecolor false 07-02 16:01:31.043 d/progressbar(20722): updatedrawablebounds: left = 0 07-02 16:01:31.043 d/progressbar(20722): updatedrawablebounds: top = 0 07-02 16:01:31.043 d/progressbar(20722): updatedrawablebounds: right = 96 07-02 16:01:31.043 d/progressbar(20722): updatedrawablebounds: bottom = 96 07-02 16:01:31.048 w/view    (20722): requestlayout() improperly called  md5530bd51e982e6e7b340b73e88efe666e.pagerenderer{42886ae8 v.e...c. ......id 0,0-720,1134} during layout: running second layout pass 07-02 16:01:31.048 w/view    (20722): requestlayout() improperly called md5530bd51e982e6e7b340b73e88efe666e.activityindicatorrenderer{4279fa78 v.e..... ......id 0,0--2,-2} during layout: running second layout pass 07-02 16:01:31.048 w/view    (20722): requestlayout() improperly called md5530bd51e982e6e7b340b73e88efe666e.rendererfactory_defaultrenderer{4270c278 v.e...c. ......id 0,0--2,-2} during layout: running second layout pass 07-02 16:01:32.003 d/locationhandler(20722): logged location changed: location[fused 55.545246,37.561896 acc=10 et=+3d2h50m34s361ms] 

so happens masterdetailpage recreates, because constructor of called calling again, mediapicker contentpage, guess 'drops' current activity , starts over, still don't know why

takephotoasync marked obsolete (i think because of crash). should use gettakephotoui. starts new intent. works in app.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -