financisto icon indicating copy to clipboard operation
financisto copied to clipboard

App crashes when image is attached

Open jubreal opened this issue 7 years ago • 3 comments

Expected behavior  

The app should remain stable and not crash when users are using the app and inserting necessary info involved in a transaction such as images which serve as evidence of transaction. This is a financial app and such features supporting transaction evidence are highly important.    

Actual behavior  

The app crashes when user tries to attach image in the transaction field.    

How to reproduce

1.     Download the latest release of the app from playstore.
2.     Install and launch the app and grant all permissions (Camera, Storage e.t.c)
3.     Create your account. Here is how to create account:
        Tap the ‘+’ icon at the bottom left corner of the screen
        Fill in your details such as Title, Currency, Opening Amount in the provided space and click ok to save.
4.     Proceed by clicking on Blotter icon which is the icon next to Accounts at the top of the display.
5.     Tap the ‘+’ icon at the bottom left of the display.
6.     Fill in the details or you can just scroll to the Attach picture section
7.     Click on the  Attach picture
8.     Select camera or Choose images (to select from pictures already available in gallery) It will be observed that the app crashes after this action, hence, the bug  

  • Browser/App version: app version 1.8.1
  • Operating system: Android 6.0  

Recording Of The Bug  

https://youtu.be/1fiNYNZpquw  

log report

06-01 17:51:16.909 V/WindowManager(945): Changing focus   from Window{f64e55 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.TransactionActivity}   to Window{d72fbed u0 PopupWindow:c47755d} Callers=com.android.server.wm.WindowManagerService.addWindow:2848   com.android.server.wm.Session.addToDisplay:171   android.view.IWindowSession$Stub.onTransact:124   com.android.server.wm.Session.onTransact:133    
06-01 17:51:16.910 I/WindowManager(945): Focus moving from   Window{f64e55 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.TransactionActivity} to Window{d72fbed u0   PopupWindow:c47755d}   
06-01 17:51:16.932 I/BufferQueueProducer(274):   [PopupWindow:c47755d](this:0x7f805da800,id:1370,api:1,p:7712,c:274) connect(P): api=1 producer=(7712:ru.orangesoftware.financisto) producerControlledByApp=true   
06-01 17:51:16.957 I/WindowManager(945): Losing delayed   focus: Window{f64e55 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.TransactionActivity}   
06-01 17:51:23.098 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_ic_action_tick   
06-01 17:51:23.099 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_ic_action_double_tick   
06-01 17:51:23.102 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_gd_quick_action_top_frame   
06-01 17:51:23.105 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_gd_quick_action_grid_bottom_frame   
06-01 17:51:23.105 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_gd_quick_action_arrow_up   
06-01 17:51:23.106 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_gd_quick_action_grid_arrow_down   
06-01 17:51:23.107 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_actionbar_add_big   
06-01 17:51:23.108 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_ic_action_transfer   
06-01 17:51:23.110 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_actionbar_tiles_large   
06-01 17:51:23.115 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_ic_action_arrow_left_bottom   
06-01 17:51:23.117 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_ic_action_arrow_right_top   
06-01 17:51:23.118 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_ic_action_arrow_top_down   
06-01 17:51:23.119 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_ic_action_share   
06-01 17:51:23.123 D/QUERY class   ru.orangesoftware.financisto.model.Account(7789):   select e._id as _id, e.card_issuer as e_card_issuer, e.closing_day as   e_closing_day, e.creation_date as e_creation_date, e0.decimal_separator as   e0_decimal_separator, e0.decimals as e0_decimals, e0.group_separator as   e0_group_separator, e0.is_default as e0_is_default, e0.name as e0_name, e0.symbol as e0_symbol, e0.symbol_format   as e0_symbol_format, e0._id as e0__id, e0.title as e0_title, e.is_active as   e_is_active, e.is_include_into_totals as e_is_include_into_totals, e.issuer   as e_issuer, e.last_account_id as e_last_account_id, e.last_category_id as   e_last_category_id, e.last_transaction_date as e_last_transaction_date, e.total_limit   as e_total_limit, e.note as e_note, e.number as e_number, e.payment_day as   e_payment_day, e.sort_order as e_sort_order, e.total_amount as   e_total_amount, e.type as e_type, e._id as e__id, e.title as e_title from   ACCOUNT as e inner join currency as e0 on e0._id=e.currency_id order by   e_is_active desc, e_sort_order desc, e_title asc   
06-01 17:51:23.129 D/Financisto(7789): About to update tab   accounts   
06-01 17:51:23.131 D/QUERY class   ru.orangesoftware.financisto.model.Account(7789):   select e._id as _id, e.card_issuer as e_card_issuer, e.closing_day as   e_closing_day, e.creation_date as e_creation_date, e0.decimal_separator as   e0_decimal_separator, e0.decimals as e0_decimals, e0.group_separator as   e0_group_separator, e0.is_default as e0_is_default, e0.name as e0_name, e0.symbol as e0_symbol, e0.symbol_format   as e0_symbol_format, e0._id as e0__id, e0.title as e0_title, e.is_active as   e_is_active, e.is_include_into_totals as e_is_include_into_totals, e.issuer   as e_issuer, e.last_account_id as e_last_account_id, e.last_category_id as   e_last_category_id, e.last_transaction_date as e_last_transaction_date,   e.total_limit as e_total_limit, e.note as e_note, e.number as e_number,   e.payment_day as e_payment_day, e.sort_order as e_sort_order, e.total_amount   as e_total_amount, e.type as e_type, e._id as e__id, e.title as e_title from   ACCOUNT as e inner join currency as e0 on e0._id=e.currency_id order by   e_is_active desc, e_sort_order desc, e_title asc   
06-01 17:51:23.133 D/Financisto(7789): Tab accounts updated   in 4ms   
06-01 17:51:23.134 V/ActivityThread(7789): Performing   resume of ActivityRecord{13e9f0 token=android.os.BinderProxy@961eb69 {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}}   
06-01 17:51:23.134 D/QUERY class   ru.orangesoftware.financisto.model.Currency(7789):   select e._id as _id, e.decimal_separator as e_decimal_separator, e.decimals   as e_decimals, e.group_separator as e_group_separator, e.is_default as   e_is_default, e.name as e_name, e.symbol as e_symbol, e.symbol_format as   e_symbol_format, e._id as e__id, e.title as e_title from currency as e where   (e_is_default=?)   
06-01 17:51:23.135 V/ActivityThread(7789): Performing   resume of ActivityRecord{9a64e67 token=android.app.LocalActivityManager$LocalActivityRecord@25cf414   {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.AccountListActivity}}   
06-01 17:51:23.136 D/ActivityThread(7789):   ACT-AM_ON_RESUME_CALLED ActivityRecord{9a64e67 token=android.app.LocalActivityManager$LocalActivityRecord@25cf414   {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.AccountListActivity}}   
06-01 17:51:23.137 D/QUERY class   ru.orangesoftware.financisto.model.Account(7789):   select e._id as _id, e.card_issuer as e_card_issuer, e.closing_day as   e_closing_day, e.creation_date as e_creation_date, e0.decimal_separator as   e0_decimal_separator, e0.decimals as e0_decimals, e0.group_separator as   e0_group_separator, e0.is_default as e0_is_default, e0.name as e0_name, e0.symbol as e0_symbol, e0.symbol_format   as e0_symbol_format, e0._id as e0__id, e0.title as e0_title, e.is_active as e_is_active,   e.is_include_into_totals as e_is_include_into_totals, e.issuer as e_issuer,   e.last_account_id as e_last_account_id, e.last_category_id as   e_last_category_id, e.last_transaction_date as e_last_transaction_date,   e.total_limit as e_total_limit, e.note as e_note, e.number as e_number,   e.payment_day as e_payment_day, e.sort_order as e_sort_order, e.total_amount   as e_total_amount, e.type as e_type, e._id as e__id, e.title as e_title from   ACCOUNT as e inner join currency as e0 on e0._id=e.currency_id order by   e_is_active desc, e_sort_order desc, e_title asc   
06-01 17:51:23.142 D/ActivityThread(7789):   ACT-AM_ON_RESUME_CALLED ActivityRecord{13e9f0 token=android.os.BinderProxy@961eb69 {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}}   
06-01 17:51:23.142 V/ActivityThread(7789): Resume   ActivityRecord{13e9f0 token=android.os.BinderProxy@961eb69 {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}}   started activity: false, hideForNow: false, finished: false   
06-01 17:51:23.145 D/OpenGLRenderer(7789):   <ru.orangesoftware.financisto> is running.   
06-01 17:51:23.159 D/ViewRootImpl(7789): hardware   acceleration is enabled, this = ViewRoot{f30678c ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity,ident   = 0}   
06-01 17:51:23.161 D/WindowManager(945):   addWindowToListInOrderLocked: win=Window{1ffec33 u0   ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity} Callers=com.android.server.wm.WindowManagerService.addWindow:2808   com.android.server.wm.Session.addToDisplay:171   android.view.IWindowSession$Stub.onTransact:124   com.android.server.wm.Session.onTransact:133    
06-01 17:51:23.163 V/ActivityThread(7789): Resuming   ActivityRecord{13e9f0 token=android.os.BinderProxy@961eb69 {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}}   with isForward=true   06-01 17:51:23.164 V/PhoneWindow(7789): DecorView   setVisiblity: visibility = 0 ,Parent =ViewRoot{f30678c   ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity,ident = 0}, this   =com.android.internal.policy.PhoneWindow$DecorView{1a8c8c6   V.E...... R.....ID 0,0-0,0}   
06-01 17:51:23.164 V/ActivityThread(7789): Scheduling idle   handler for ActivityRecord{13e9f0 token=android.os.BinderProxy@961eb69 {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}}   
06-01 17:51:23.164 D/ActivityThread(7789):   ACT-LAUNCH_ACTIVITY handled : 0 / ActivityRecord{13e9f0   token=android.os.BinderProxy@961eb69   {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}}   
06-01 17:51:23.182 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_account_type_card_visa   
06-01 17:51:23.185 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_icon_lock   06-01 17:51:23.189 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_divider_vertical_dark   
06-01 17:51:23.194 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_progress_horizontal_budget   06-01 17:51:23.198 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_account_type_cash   
06-01 17:51:23.207 D/BufferQueueDump(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity] this:0x7f85429680,   value:0x7ffd7554dc, iLen:6   06-01 17:51:23.207 I/BufferQueueConsumer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:0,p:-1,c:274) setConsumerName: ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity   
06-01 17:51:23.207 I/BufferQueueConsumer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:0,p:-1,c:274) setDefaultBufferSize: width=1 height=1   06-01 17:51:23.209 V/WindowManager(945): findFocusedWindow:   Found new focus @ 7 = Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   06-01 17:51:23.209 V/WindowManager(945): Changing focus   from null to Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   Callers=com.android.server.wm.WindowManagerService.relayoutWindow:3625 com.android.server.wm.Session.relayout:201 android.view.IWindowSession$Stub.onTransact:284 com.android.server.wm.Session.onTransact:133    06-01 17:51:23.209 D/WindowManager(945): Input focus has   changed to Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   06-01 17:51:23.226 I/BufferQueueConsumer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:0,p:-1,c:274) setDefaultBufferSize: width=1080 height=1800   06-01 17:51:23.229 I/WindowManager(945): Focus moving from   null to Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   06-01 17:51:23.229 I/WindowManager(945): Gaining focus:   Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   06-01 17:51:23.230 D/OpenGLRenderer(7789): CanvasContext()   0x7f81e02000 initialize window=0x7f98e60c10, title=ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity   06-01 17:51:23.241 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_account_type_cash   06-01 17:51:23.248 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_total_error   06-01 17:51:23.252 I/BufferQueueProducer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:7789,c:274) connect(P): api=1 producer=(7789:ru.orangesoftware.financisto) producerControlledByApp=true   06-01 17:51:23.276 I/BufferQueueProducer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:7789,c:274) new GraphicBuffer needed   06-01 17:51:23.299 I/ActivityManager(945): [AppLaunch]   Displayed Displayed ru.orangesoftware.financisto/.activity.MainActivity: +767ms   06-01 17:51:23.299 D/ActivityManager(945):   AP_PROF:AppLaunch_LaunchTime:ru.orangesoftware.financisto/.activity.MainActivity:767:17205444   06-01 17:51:23.301 V/WindowManager(945): findFocusedWindow:   Found new focus @ 7 = Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   06-01 17:51:23.307 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_account_type_card_visa   06-01 17:51:23.308 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_icon_lock   06-01 17:51:23.308 D/Resources(7789): resEntryNameFinal = ru_orangesoftware_financisto_divider_vertical_dark   06-01 17:51:23.313 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_progress_horizontal_budget   06-01 17:51:23.314 D/Resources(7789): resEntryNameFinal =   ru_orangesoftware_financisto_account_type_cash   06-01 17:51:23.325 I/BufferQueueProducer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:7789,c:274) new GraphicBuffer needed   06-01 17:51:23.353 V/WindowManager(945): findFocusedWindow:   Found new focus @ 7 = Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   06-01 17:51:24.382 I/BufferQueueProducer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:7789,c:274) new GraphicBuffer needed   06-01 17:51:24.392 I/BufferQueueProducer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:7789,c:274) queueBuffer: fps=1.82 dur=1097.45 max=1059.05   min=38.40   06-01 17:51:24.398 I/BufferQueueProducer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:7789,c:274) new GraphicBuffer needed   06-01 17:51:24.400 D/test    (1074):   >>>>>>>>>>>>>>>>>   comName:ru.orangesoftware.financisto.activity.MainActivity   06-01 17:51:24.409 D/xionghui(1074): xionghui TaskKey   pkg=ru.orangesoftware.financisto   isLocked=false   06-01 17:51:24.410 D/xionghui(1074): xionghui TaskKey   pkg=ru.orangesoftware.financisto   isLocked=false   06-01 17:51:24.519 D/test    (1074):   >>>>>>>>>>>>>>>>>   comName:ru.orangesoftware.financisto.activity.MainActivity   06-01 17:51:24.526 V/WindowManager(945): findFocusedWindow:   Found new focus @ 5 = Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   06-01 17:51:24.532 V/WindowManager(945): Set focused app   to: AppWindowToken{729ea52 token=Token{b5c5edd ActivityRecord{6b2f2b4 u0   com.android.systemui/.recents.RecentsActivity   t78173}}} old focus=AppWindowToken{34bc2b1 token=Token{4fcf158   ActivityRecord{e66a63b u0 ru.orangesoftware.financisto/.activity.MainActivity t78270}}} moveFocusNow=true   06-01 17:51:24.536 V/WindowManager(945): Changing focus   from Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   to null Callers=com.android.server.wm.WindowManagerService.setFocusedApp:4506 com.android.server.am.ActivityManagerService.setFocusedActivityLocked:2873   com.android.server.am.ActivityStack.moveTaskToFrontLocked:4303 com.android.server.am.ActivityStackSupervisor.startActivityUncheckedLocked:2331    06-01 17:51:24.537 I/WindowManager(945): Focus moving from   Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity} to null   06-01 17:51:24.537 I/WindowManager(945): Losing focus:   Window{1ffec33 u0 ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}   06-01 17:51:24.577 D/ActivityThread(7789): ACT-AM_ON_PAUSE_CALLED   ActivityRecord{9a64e67 token=android.app.LocalActivityManager$LocalActivityRecord@25cf414 {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.AccountListActivity}}   06-01 17:51:24.577 D/ActivityThread(7789):   ACT-AM_ON_PAUSE_CALLED ActivityRecord{13e9f0 token=android.os.BinderProxy@961eb69 {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}}   06-01 17:51:24.602 V/ActivityThread(7789): Finishing stop   of ActivityRecord{13e9f0 token=android.os.BinderProxy@961eb69 {ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity}}:   show=false win=com.android.internal.policy.PhoneWindow@b56220   06-01 17:51:24.605 V/PhoneWindow(7789): DecorView   setVisiblity: visibility = 4 ,Parent =ViewRoot{f30678c   ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity,ident = 0}, this   =com.android.internal.policy.PhoneWindow$DecorView{1a8c8c6   I.E...... R.....ID 0,0-1080,1800}   06-01 17:51:24.611 I/BufferQueueProducer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:-1,c:274) disconnect(P): api 1   06-01 17:51:24.612 I/BufferQueueConsumer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:-1,c:274) getReleasedBuffers: returning mask   0xffffffffffffffff   06-01 17:51:24.621 I/BufferQueueProducer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:-1,c:274) disconnect(P): api 1   06-01 17:51:24.630 I/PPS     (945):   [notifyActivityState] ru.orangesoftware.financisto, .activity.MainActivity,   Stopped   06-01 17:51:24.630 I/PPS     (945):   [PPSNotifyAppState] nPackNum:60, pack:ru.orangesoftware.financisto, com:.activity.MainActivity, state:4, pid:7789,   last_boost_tid:7789   06-01 17:51:24.636 D/xionghui(1074): xionghui TaskKey   pkg=ru.orangesoftware.financisto   isLocked=false   06-01 17:51:24.636 D/xionghui(1074): xionghui TaskKey   pkg=ru.orangesoftware.financisto   isLocked=false   06-01 17:51:25.117 I/BufferQueueConsumer(274):   [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:-1,c:-1) disconnect(C)   06-01 17:51:25.119 I/BufferQueue(274): [ru.orangesoftware.financisto/ru.orangesoftware.financisto.activity.MainActivity](this:0x7f805d9400,id:1375,api:1,p:-1,c:-1)   ~BufferQueueCore   06-01 17:51:25.580 D/xionghui(1074): xionghui TaskKey   pkg=ru.orangesoftware.financisto   isLocked=false   06-01 17:51:25.580 D/xionghui(1074): xionghui TaskKey   pkg=ru.orangesoftware.financisto   isLocked=false   06-01 17:51:27.174 D/GasService(2222): FG app changed: from   ru.orangesoftware.financisto to com.pluscubed.matlog   06-01 17:51:27.473 D/xionghui(1074): xionghui TaskKey   pkg=ru.orangesoftware.financisto   isLocked=false   06-01 17:51:27.473 D/xionghui(1074): xionghui TaskKey   pkg=ru.orangesoftware.financisto   isLocked=false    ```

jubreal avatar Jun 01 '18 17:06 jubreal

Probably this is log snippet is more useful (I compiled the app myself, so some details might be different from the released version). The problem seems to be that Financisto attempts to copy to a directory /storage/emulated/0/financisto/pictures that does not exist. If I create that directory manually in my phone's file manager, the crash does not occur.

Exception 'java.io.FileNotFoundException' occurred in thread 'RxNewThreadScheduler-1' at java.io.FileOutputStream.open0(FileOutputStream.java:-1)
E/RxImageConverters: Error converting uri
                     java.io.FileNotFoundException: /storage/emulated/0/financisto/pictures/2018070520005263.jpg (No such file or directory)
                         at java.io.FileOutputStream.open0(Native Method)
                         at java.io.FileOutputStream.open(FileOutputStream.java:287)
                         at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
                         at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
                         at com.mlsdev.rximagepicker.RxImageConverters.copyInputStreamToFile(RxImageConverters.java:58)
                         at com.mlsdev.rximagepicker.RxImageConverters.access$000(RxImageConverters.java:22)
                         at com.mlsdev.rximagepicker.RxImageConverters$1.subscribe(RxImageConverters.java:30)
                         at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
                         at io.reactivex.Observable.subscribe(Observable.java:11040)
                         at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
                         at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:463)
                         at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
                         at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
                         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
                         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                         at java.lang.Thread.run(Thread.java:764)
D/ViewRootImpl@8a1a604[TransactionActivity]: ViewPostIme pointer 0
D/ViewRootImpl@8a1a604[TransactionActivity]: ViewPostIme pointer 1
W/ViewRootImpl@8a1a604[TransactionActivity]: Dropping event due to no window focus: 
                                             mStopped=false mHasWindowFocus=false mPausedForTransition=false
D/ViewRootImpl@8a1a604[TransactionActivity]: MSG_WINDOW_FOCUS_CHANGED 1
D/View: requestFocusFromTouch
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@b2bd87a nm : ru.orangesoftware.financisto ic=com.android.internal.widget.EditableInputConnection@5fc882b
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/ViewRootImpl@8a1a604[TransactionActivity]: ViewPostIme key 1
D/ViewRootImpl@8a1a604[TransactionActivity]: MSG_WINDOW_FOCUS_CHANGED 0
D/ViewRootImpl@8a1a604[TransactionActivity]: MSG_WINDOW_FOCUS_CHANGED 1
D/View: requestFocusFromTouch
W/System.err: io.reactivex.exceptions.OnErrorNotImplementedException: /storage/emulated/0/financisto/pictures/2018070520005263.jpg (No such file or directory)
W/System.err:     at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
                  at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
                  at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77)
                  at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.checkTerminate(ObservableFlatMap.java:495)
W/System.err:     at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.drainLoop(ObservableFlatMap.java:331)
                  at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.drain(ObservableFlatMap.java:323)
                  at io.reactivex.internal.operators.observable.ObservableFlatMap$InnerObserver.onError(ObservableFlatMap.java:571)
                  at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainFused(ObservableObserveOn.java:222)
                  at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:250)
W/System.err:     at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109)
                  at android.os.Handler.handleCallback(Handler.java:789)
                  at android.os.Handler.dispatchMessage(Handler.java:98)
                  at android.os.Looper.loop(Looper.java:164)
                  at android.app.ActivityThread.main(ActivityThread.java:6944)
                  at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
              Caused by: java.io.FileNotFoundException: /storage/emulated/0/financisto/pictures/2018070520005263.jpg (No such file or directory)
                  at java.io.FileOutputStream.open0(Native Method)
                  at java.io.FileOutputStream.open(FileOutputStream.java:287)
                  at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
                  at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
W/System.err:     at com.mlsdev.rximagepicker.RxImageConverters.copyInputStreamToFile(RxImageConverters.java:58)
                  at com.mlsdev.rximagepicker.RxImageConverters.access$000(RxImageConverters.java:22)
                  at com.mlsdev.rximagepicker.RxImageConverters$1.subscribe(RxImageConverters.java:30)
                  at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
                  at io.reactivex.Observable.subscribe(Observable.java:11040)
                  at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/System.err:     at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:463)
                  at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
                  at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                  at java.lang.Thread.run(Thread.java:764)

Oberon00 avatar Jul 05 '18 18:07 Oberon00

I propose the following patch (DISCLAIMER: Works for me, but I have no idea about Android Development best practises):

diff --git a/app/src/main/java/ru/orangesoftware/financisto/utils/PicturesUtil.java b/app/src/main/java/ru/orangesoftware/financisto/utils/PicturesUtil.java
index f09c360..a76b531 100644
--- a/app/src/main/java/ru/orangesoftware/financisto/utils/PicturesUtil.java
+++ b/app/src/main/java/ru/orangesoftware/financisto/utils/PicturesUtil.java
@@ -39,8 +39,13 @@ public class PicturesUtil {
 
     public static File pictureFile(String pictureFileName, boolean fallbackToLegacy) {
         File file = new File(PICTURES_DIR, pictureFileName);
+
         if (fallbackToLegacy && !file.exists()) {
             file = new File(LEGACY_PICTURES_DIR, pictureFileName);
+        } else {
+            if (!PICTURES_DIR.mkdirs() && !PICTURES_DIR.exists()) {
+                throw new RuntimeException("Failed creating picture directory: " +  PICTURES_DIR.getAbsolutePath());
+            }
         }
         return file;
     }

Oberon00 avatar Jul 05 '18 18:07 Oberon00

please check fix deployed in a fork version: https://play.google.com/store/apps/details?id=ru.orangesoftware.financistob

yetanothercoder avatar Sep 17 '18 19:09 yetanothercoder