Bug 661 - Error when trying to capture image from camera or selecting image from gallary
Summary: Error when trying to capture image from camera or selecting image from gallary
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 1.0
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-09-07 05:29 UTC by Alexandr
Modified: 2012-04-25 16:30 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Alexandr 2011-09-07 05:29:04 UTC
After finishing activity that called action to capture or select foto i am getting error.

Logcat:

I/ActivityManager( 1294): Starting activity: Intent { act=android.intent.action.PICK dat=content://media/external/images/media cmp=com.motorola.gallery/.ImageGallery }
--------- beginning of /dev/log/main
D/ImageGallery(18706): onCreate
E/GridViewSpecial(18706): mCellWidth=110 mCellHeight=110
V/WorldViewOpenGL(18706): GLThread constructor
E/ImageFlowView(18706): create mWorldView @ com.motorola.cxd.ui3D.WorldViewGestureOpenGL@4592d7b0
D/ImageGallery(18706): setInclusionByIntent: mInclusion=5
D/ImageGallery(18706): spinner selection is: 0
D/ImageGallery(18706): SCREEN ORIENTATION PORTRAIT!!!!
D/ImageGallery(18706): leave onCreate
D/ImageGallery(18706): ImageGallery onStart was called!
V/MediaProvider(16810): enter query, uri: content://media/none/media_scanner
I/ImageGallery(18706): ImageGallery rebake was called!
D/GridViewSpecial(18706): GridViewSpecial clearCache was called!
I/ImageGallery(18706): mInclusion=5
D/ImageGalleryModel(18706): Type=0,Inclusion=5
D/ImageManager(18706): start buildAllMedia 
V/MediaProvider(16810): enter query, uri: content://media/external/images/media
V/MediaProvider(16810): enter query, uri: content://media/internal/images/media
D/ImageManager(18706): buildAllMedia , list count=160 takes 112
I/ImageGallery(18706): ImageGallery checkThumbnails was called!
D/setViewStatus(18706): mAllImages=160
E/ImageGallery(18706): mTargetScroll=0
D/ImageGallery(18706): Register TagReceiver
D/ImageGallery(18706): ##################### leave onStart! Take time=141
D/ImageGallery(18706): ImageGallery onResume was called!
I/ImageGallery(18706): ImageGallery checkThumbnails was called!
D/ImageGallery(18706): Leave onResume! Take time=1
D/ImageManager(18706): com.motorola.gallery.ImageManager$ImageList:count(160), cache(1), uriMap(0)checkThumbnails 
V/MediaProvider(16810): enter query, uri: content://media/external/images/media
D/GridViewSpecial(18706): onLayout changed
D/GridViewSpecial(18706): viewWidth=480 viewHeight=723
D/GridViewSpecial(18706): DisplayMetrics{density=1.5, width=480, height=854, scaledDensity=1.5, xdpi=96.0, ydpi=96.0}
D/GridViewSpecial(18706): GridViewSpecial clearCache was called!
D/GridViewSpecial(18706): calcLayoutSpec: viewWidth=480
E/GridViewSpecial(18706): start!
D/dalvikvm(18706): GC_EXTERNAL_ALLOC freed 780 objects / 52712 bytes in 77ms
D/dalvikvm(18706): GC_EXTERNAL_ALLOC freed 141 objects / 5320 bytes in 57ms
D/dalvikvm(18706): GC_EXTERNAL_ALLOC freed 36 objects / 1352 bytes in 60ms
E/ImageManager(18706): randomAccessFilePath directoryName=/mnt/sdcard/dcim/.thumbnails, ls=media
E/ImageManager(18706): randomAccessFilePath uri=content://media/external/images/media
D/ImageManager(18706): com.motorola.gallery.ImageManager$ImageList:count(0), cache(0), uriMap(0)checkThumbnails 
D/dalvikvm(18706): GC_EXTERNAL_ALLOC freed 86 objects / 5440 bytes in 46ms
I/ActivityManager( 1294): Process com.twitter.android (pid 18789) has died.
V/MediaProvider(16810): enter query, uri: content://media/internal/images/media
D/GridViewSpecial(18706): onLayout not changed
D/GridViewSpecial(18706): viewWidth=480 viewHeight=723
D/GridViewSpecial(18706): DisplayMetrics{density=1.5, width=480, height=854, scaledDensity=1.5, xdpi=96.0, ydpi=96.0}
D/GridViewSpecial(18706): GridViewSpecial clearCache was called!
E/ImageManager(18706): randomAccessFilePath directoryName=/mnt/sdcard/dcim/.thumbnails, ls=media
E/ImageManager(18706): randomAccessFilePath uri=content://media/internal/images/media
D/ImageGallery(18706): check thumbnails thread finishing; took 590
D/ImageLoader(18706): ImageLoader.stop 1 threads
D/GridViewSpecial(18706): calcLayoutSpec: viewWidth=480
E/GridViewSpecial(18706): start!
D/dalvikvm(18706): GC_EXTERNAL_ALLOC freed 944 objects / 64448 bytes in 81ms
D/dalvikvm(18706): GC_EXTERNAL_ALLOC freed 143 objects / 6712 bytes in 56ms
D/dalvikvm(18706): GC_EXTERNAL_ALLOC freed 0 objects / 0 bytes in 73ms
W/Cursor  (18706): Unclosed Cursor detected
W/Cursor  (18706):      at android.content.ContentResolver.query(ContentResolver.java:258)
W/Cursor  (18706):      at android.provider.MediaStore$Images$Media.query(MediaStore.java:492)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager$ImageList.createCursor(ImageManager.java:3305)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager$ImageList.<init>(ImageManager.java:3130)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager.allImages(ImageManager.java:5655)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager.allImages(ImageManager.java:5594)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager$Albums._getAllList(ImageManager.java:6457)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager$Albums.buildAllMedia(ImageManager.java:6965)
W/Cursor  (18706):      at com.motorola.gallery.ImageGalleryModel.allImages(ImageGalleryModel.java:55)
W/Cursor  (18706):      at com.motorola.gallery.ImageGallery.allImages(ImageGallery.java:2229)
W/Cursor  (18706):      at com.motorola.gallery.ImageGallery.rebake(ImageGallery.java:1927)
W/Cursor  (18706):      at com.motorola.gallery.ImageGallery.onStart(ImageGallery.java:1987)
W/Cursor  (18706):      at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1129)
W/Cursor  (18706):      at android.app.Activity.performStart(Activity.java:3798)
W/Cursor  (18706):      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2726)
W/Cursor  (18706):      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
W/Cursor  (18706):      at android.app.ActivityThread.access$2500(ActivityThread.java:129)
W/Cursor  (18706):      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2117)
W/Cursor  (18706):      at android.os.Handler.dispatchMessage(Handler.java:99)
W/Cursor  (18706):      at android.os.Looper.loop(Looper.java:143)
W/Cursor  (18706):      at android.app.ActivityThread.main(ActivityThread.java:4717)
W/Cursor  (18706):      at java.lang.reflect.Method.invokeNative(Native Method)
W/Cursor  (18706):      at java.lang.reflect.Method.invoke(Method.java:521)
W/Cursor  (18706):      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
W/Cursor  (18706):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
W/Cursor  (18706):      at dalvik.system.NativeStart.main(Native Method)
W/Cursor  (18706): Unclosed Cursor detected
W/Cursor  (18706):      at android.content.ContentResolver.query(ContentResolver.java:258)
W/Cursor  (18706):      at android.provider.MediaStore$Images$Media.query(MediaStore.java:492)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager$ImageList.createCursor(ImageManager.java:3305)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager$ImageList.<init>(ImageManager.java:3130)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager.allImages(ImageManager.java:5638)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager.allImages(ImageManager.java:5594)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager$Albums._getAllList(ImageManager.java:6457)
W/Cursor  (18706):      at com.motorola.gallery.ImageManager$Albums.buildAllMedia(ImageManager.java:6965)
W/Cursor  (18706):      at com.motorola.gallery.ImageGalleryModel.allImages(ImageGalleryModel.java:55)
W/Cursor  (18706):      at com.motorola.gallery.ImageGallery.allImages(ImageGallery.java:2229)
W/Cursor  (18706):      at com.motorola.gallery.ImageGallery.rebake(ImageGallery.java:1927)
W/Cursor  (18706):      at com.motorola.gallery.ImageGallery.onStart(ImageGallery.java:1987)
W/Cursor  (18706):      at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1129)
W/Cursor  (18706):      at android.app.Activity.performStart(Activity.java:3798)
W/Cursor  (18706):      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2726)
W/Cursor  (18706):      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
W/Cursor  (18706):      at android.app.ActivityThread.access$2500(ActivityThread.java:129)
W/Cursor  (18706):      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2117)
W/Cursor  (18706):      at android.os.Handler.dispatchMessage(Handler.java:99)
W/Cursor  (18706):      at android.os.Looper.loop(Looper.java:143)
W/Cursor  (18706):      at android.app.ActivityThread.main(ActivityThread.java:4717)
W/Cursor  (18706):      at java.lang.reflect.Method.invokeNative(Native Method)
W/Cursor  (18706):      at java.lang.reflect.Method.invoke(Method.java:521)
W/Cursor  (18706):      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
D/dalvikvm(18706): GC_EXTERNAL_ALLOC freed 872 objects / 50664 bytes in 64ms
W/Cursor  (18706):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
W/Cursor  (18706):      at dalvik.system.NativeStart.main(Native Method)
E/ImageManager(18706): randomAccessFilePath directoryName=/mnt/sdcard/dcim/.thumbnails, ls=media
E/ImageManager(18706): randomAccessFilePath uri=content://media/external/images/media
E/ImageLoader(18706): java.io.IOException: File is bad
E/ImageLoader(18706): java.io.IOException: File is bad
E/ImageLoader(18706): 	at com.motorola.gallery.ImageManager$BaseImage.miniThumbBitmap(ImageManager.java:876)
E/ImageLoader(18706): 	at com.motorola.gallery.ImageLoader$1.run(ImageLoader.java:226)
E/ImageLoader(18706): 	at java.lang.Thread.run(Thread.java:1096)
D/Util    (18706): check IOException 
E/GridViewSpecial(18706): Bad images index=15
E/ImageLoader(18706): java.io.IOException: File is bad
E/ImageLoader(18706): java.io.IOException: File is bad
E/ImageLoader(18706): 	at com.motorola.gallery.ImageManager$BaseImage.miniThumbBitmap(ImageManager.java:876)
E/ImageLoader(18706): 	at com.motorola.gallery.ImageLoader$1.run(ImageLoader.java:226)
E/ImageLoader(18706): 	at java.lang.Thread.run(Thread.java:1096)
D/Util    (18706): check IOException 
I/ActivityManager( 1294): Displayed activity com.motorola.gallery/.ImageGallery: 1775 ms (total 1775 ms)
E/GridViewSpecial(18706): Bad images index=14
E/ImageLoader(18706): java.io.IOException: File is bad
E/ImageLoader(18706): java.io.IOException: File is bad
E/ImageLoader(18706): 	at com.motorola.gallery.ImageManager$BaseImage.miniThumbBitmap(ImageManager.java:876)
E/ImageLoader(18706): 	at com.motorola.gallery.ImageLoader$1.run(ImageLoader.java:226)
E/ImageLoader(18706): 	at java.lang.Thread.run(Thread.java:1096)
D/Util    (18706): check IOException 
E/GridViewSpecial(18706): Bad images index=13
E/ImageLoader(18706): java.io.IOException: File is bad
E/ImageLoader(18706): java.io.IOException: File is bad
E/ImageLoader(18706): 	at com.motorola.gallery.ImageManager$BaseImage.miniThumbBitmap(ImageManager.java:876)
E/ImageLoader(18706): 	at com.motorola.gallery.ImageLoader$1.run(ImageLoader.java:226)
E/ImageLoader(18706): 	at java.lang.Thread.run(Thread.java:1096)
D/Util    (18706): check IOException 
E/GridViewSpecial(18706): Bad images index=16
E/ImageGallery(18706): launchCropperOrFinish
D/ImageGallery(18706): mFileNameAsked is null
D/ImageGallery(18706): ImageGallery onPause was called!
V/MediaProvider(16810): enter query, uri: content://media/external/images/media/176
I/ActivityManager( 1294): Starting activity: Intent { cmp=com.ruatti.r4c/ruatti.gui.modules.media.UploadDataActivity (has extras) }
D/WifiService( 1294): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@45a84ee8}
E/NetworkLocationProvider( 1294): releaseCheckLocationLock: wake lock has already been released
D/WifiService( 1294): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@45a84ee8}
I/ActivityManager( 1294): Displayed activity com.ruatti.r4c/ruatti.gui.modules.media.UploadDataActivity: 539 ms (total 539 ms)
D/ImageGallery(18706): ImageGallery onStop was called!
D/ImageGallery(18706): unRegister TagReceiver
D/ImageLoader(18706): ImageLoader.stop 1 threads
E/GridViewSpecial(18706): recycleBitmap mMissingImageThumbnailBitmap
D/ImageGallery(18706): ImageGallery onDestroy was called!
V/WorldViewOpenGL(18706): onDetachedFromWindow end mGLThread
D/KeyCharacterMap( 1375): load: dev='qtouch-touchscreen' path='/system/usr/keychars/qtouch-touchscreen.kcm.bin'
W/KeyCharacterMap( 1375): Can't open keycharmap file
W/KeyCharacterMap( 1375): Error loading keycharmap file '/system/usr/keychars/qtouch-touchscreen.kcm.bin'. hw.keyboards.65538.devname='qtouch-touchscreen'
W/KeyCharacterMap( 1375): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
D/KeyCharacterMap(18933): load: dev='qtouch-touchscreen' path='/system/usr/keychars/qtouch-touchscreen.kcm.bin'
W/KeyCharacterMap(18933): Can't open keycharmap file
W/KeyCharacterMap(18933): Error loading keycharmap file '/system/usr/keychars/qtouch-touchscreen.kcm.bin'. hw.keyboards.65538.devname='qtouch-touchscreen'
W/KeyCharacterMap(18933): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
D/WifiService( 1294): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@45a84ee8}
E/NetworkLocationProvider( 1294): releaseCheckLocationLock: wake lock has already been released
D/WifiService( 1294): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@45a84ee8}
I/ActivityManager( 1294): Process com.ruatti.r4c (pid 18933) has died.
W/ActivityManager( 1294): Scheduling restart of crashed service com.ruatti.r4c/ruatti.gui.services.TrayIconService in 5000ms
W/GpsLocationProvider( 1294): Unneeded remove listener for uid 1000
I/WindowManager( 1294): WIN DEATH: Window{45c3dbd8 com.ruatti.r4c/ruatti.gui.modules.main.RolesActivity paused=false}
I/WindowManager( 1294): WIN DEATH: Window{45cc4700 com.ruatti.r4c/ruatti.gui.modules.main.LoginActivity paused=false}
I/WindowManager( 1294): WIN DEATH: Window{45be1f68 com.ruatti.r4c/ruatti.gui.modules.main.MainActivity paused=false}
I/WindowManager( 1294): WIN DEATH: Window{45b63fc0 com.ruatti.r4c/ruatti.gui.modules.media.MediaMainActivity paused=true}
I/ActivityManager( 1294): Start proc com.ruatti.r4c for activity com.ruatti.r4c/ruatti.gui.modules.main.MainActivity: pid=18995 uid=10071 gids={3003, 1015, 1007, 1006}
D/Zygote  ( 1032): Process 18933 exited cleanly (1)
D/WifiService( 1294): acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@45a84ee8}
E/asset   (18995): MAS: getAppPckgAndVerCode package: com.ruatti.r4c === version 1
I/ActivityThread(18995): Publishing provider com.ruatti.r4c.__mono_init__: mono.MonoRuntimeProvider
D/dalvikvm(18995): Trying to load lib /data/data/com.ruatti.r4c/lib/libmonodroid.so 0x457ffaf0
D/dalvikvm(18995): Added shared lib /data/data/com.ruatti.r4c/lib/libmonodroid.so 0x457ffaf0
I/MonoDroid-Debugger(18995): Not starting the debugger as the timeout value has been reached; current-time: 1315387443  timeout: 1315382156
D/WifiService( 1294): releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@45a84ee8}
E/NetworkLocationProvider( 1294): releaseCheckLocationLock: wake lock has already been released
D/dalvikvm(18995): GC_FOR_MALLOC freed 12375 objects / 465776 bytes in 55ms
D/dalvikvm(18995): GC_FOR_MALLOC freed 9886 objects / 462760 bytes in 57ms
D/dalvikvm(18995): GC_FOR_MALLOC freed 8697 objects / 424664 bytes in 149ms
D/dalvikvm(18995): Trying to load lib lib_glossary.so 0x0
I/dalvikvm(18995): Unable to dlopen(lib_glossary.so): Cannot load library: load_library[1083]: Library 'lib_glossary.so' not found
E/MBGlossaryManager(18995): lib_glossary.so can't be loaded
D/dalvikvm(18995): GC_EXTERNAL_ALLOC freed 289 objects / 14312 bytes in 47ms
W/InputManagerService( 1294): Got RemoteException sending setActive(false) notification to pid 18933 uid 10071
D/WifiService( 1294): ACTION_BATTERY_CHANGED pluggedType: 2
D/BatteryMonitor(18884): receive a battery message
D/BatteryMonitor(18884): The temperature is 35
D/BatteryMonitor(18884): BatteryMonitorService:--------------------- temp 35
I/ActivityManager( 1294): Displayed activity com.ruatti.r4c/ruatti.gui.modules.main.MainActivity: 7328 ms (total 7328 ms)


Here is code:

void NewPictureButtonClick(object sender, EventArgs e)
{
  var values = new ContentValues();
  _imageTimeStamp = Android.Text.Format.DateFormat.Format("yyyyMMdd_kkmmss", new Java.Util.Date()) + ".jpg";
  values.Put(MediaStore.MediaColumnsConsts.Title, _imageTimeStamp);
  var intent = new Intent(MediaStore.ActionImageCapture);
  var imageUri = ContentResolver.Insert(SdCartMounted ? MediaStore.Images.Media.ExternalContentUri : MediaStore.Images.Media.InternalContentUri, values);
  intent.PutExtra(MediaStore.ExtraOutput, imageUri);
  StartActivityForResult(intent, CAPTURE_PHOTO);
}

void SelectPictureButtonClick(object sender, EventArgs e)
{
  var intent = new Intent(Intent.ActionPick);
  intent.SetDataAndType(
  SdCartMounted ? MediaStore.Images.Media.ExternalContentUri : MediaStore.Images.Media.InternalContentUri,
  MediaStore.Images.Media.ContentType);
  StartActivityForResult(intent, SELECT_PHOTO);
}
Comment 1 Jonathan Pobst 2012-04-25 16:30:20 UTC
I do not get a crash with either snippet of code.  I am guessing this bug is long obsolete.