domoritz / open-mensa-android

Android OpenMensa Client, shows the meals for university canteens
44 stars 12 forks source link

Exception at startup #33

Closed eTaernis closed 7 years ago

eTaernis commented 7 years ago

Hi, this app worked great on my device while I have been on Marshmallow but with my new ROM (Nougat 7.1.1), it does not work. Once I start the app and tries downloading data, I get this error: "Exception: Only the original thread that created a view hierarchy can touch its views."

Please have a look at my logcat:

03-09 22:43:37.244 I/ActivityManager(1103): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=de.uni_potsdam.hpi.openmensa cmp=de.uni_potsdam.hpi.openmensa/.MainActivity} from uid 10075 on display 0
03-09 22:43:37.250 D/audio_hw_primary(700): out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
03-09 22:43:37.253 D/audio_hw_primary(700): select_devices for use case (low-latency-playback)
03-09 22:43:37.253 D/audio_hw_extn(700): audio_extn_set_anc_parameters: anc_enabled:0
03-09 22:43:37.261 I/ActivityManager(1103): Start proc 27698:de.uni_potsdam.hpi.openmensa/u0a137 for activity de.uni_potsdam.hpi.openmensa/.MainActivity
03-09 22:43:37.312 W/System  (27698): ClassLoader referenced unknown path: /data/app/de.uni_potsdam.hpi.openmensa-1/lib/arm64
03-09 22:43:37.320 D/OpenGLRenderer(20456): endAllActiveAnimators on 0x7f8b9de400 (RippleDrawable) with handle 0x7f8b8c4040
03-09 22:43:37.383 D/Canteendroid(27698): Got favourites []
03-09 22:43:37.383 D/Canteendroid(27698): Update favourites: []
03-09 22:43:37.386 D/Canteendroid(27698): Out of date because no last fetch date is set.
03-09 22:43:37.386 D/Canteendroid(27698): Fetch canteens because storage is out of date or empty
03-09 22:43:37.418 D/Canteendroid(27698): Refreshing favourite canteen list
03-09 22:43:37.419 D/Canteendroid(27698): Got favourites []
03-09 22:43:37.419 D/Canteendroid(27698): Fetching from http://openmensa.org/api/v2/canteens?limit=50
03-09 22:43:37.419 D/Canteendroid(27698): Update favourites: []
03-09 22:43:37.420 D/Canteendroid(27698): Got favourites []
03-09 22:43:37.420 I/DpmTcmClient(27698): RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
03-09 22:43:37.420 D/Canteendroid(27698): Update favourites: []
03-09 22:43:37.421 D/Canteendroid(27698): Spinner items: []
03-09 22:43:37.425 D/NetworkSecurityConfig(27698): No Network Security Config specified, using platform default
03-09 22:43:37.427 D/Canteendroid(27698): Got favourites []
03-09 22:43:37.427 D/Canteendroid(27698): Update favourites: []
03-09 22:43:37.459 I/Adreno  (27698): QUALCOMM build                   : 49a2ab3, Ifedc5bd8d0
03-09 22:43:37.459 I/Adreno  (27698): Build Date                       : 12/15/16
03-09 22:43:37.459 I/Adreno  (27698): OpenGL ES Shader Compiler Version: XE031.09.00.04
03-09 22:43:37.459 I/Adreno  (27698): Local Branch                     : 
03-09 22:43:37.459 I/Adreno  (27698): Remote Branch                    : 
03-09 22:43:37.459 I/Adreno  (27698): Remote Branch                    : 
03-09 22:43:37.459 I/Adreno  (27698): Reconstruct Branch               : 
03-09 22:43:37.463 I/OpenGLRenderer(27698): Initialized EGL, version 1.4
03-09 22:43:37.463 D/Canteendroid(27698): New Fragment requested 2
03-09 22:43:37.463 D/OpenGLRenderer(27698): Swap behavior 1
03-09 22:43:37.465 D/Canteendroid(27698): New Fragment requested 1
03-09 22:43:37.465 D/Canteendroid(27698): New Fragment requested 3
03-09 22:43:37.507 I/ActivityManager(1103): Displayed de.uni_potsdam.hpi.openmensa/.MainActivity: +258ms
03-09 22:43:37.535 W/afwallstart(456): type=1400 audit(0.0:21291): avc: denied { getattr } for path="/data/data/com.android.providers.downloads" dev="dm-0" ino=2179129 scontext=u:r:sysinit:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
03-09 22:43:37.604 W/Canteendroid(27698): Exception: Only the original thread that created a view hierarchy can touch its views.
03-09 22:43:37.605 D/Canteendroid(27698): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
03-09 22:43:37.605 D/Canteendroid(27698):   at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6897)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:1083)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.view.ViewGroup.invalidateChild(ViewGroup.java:5205)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.view.View.invalidateInternal(View.java:13660)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.view.View.invalidate(View.java:13596)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.widget.ProgressBar.invalidateDrawable(ProgressBar.java:1689)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.graphics.drawable.Drawable.invalidateSelf(Drawable.java:435)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.graphics.drawable.Drawable.setVisible(Drawable.java:819)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.graphics.drawable.LayerDrawable.setVisible(LayerDrawable.java:1326)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.widget.ProgressBar.swapCurrentDrawable(ProgressBar.java:623)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.widget.ProgressBar.setIndeterminate(ProgressBar.java:608)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.app.ProgressDialog.setIndeterminate(ProgressDialog.java:297)
03-09 22:43:37.605 D/Canteendroid(27698):   at de.uni_potsdam.hpi.openmensa.helpers.RetrieveFeedTask.doInBackground(RetrieveFeedTask.java:110)
03-09 22:43:37.605 D/Canteendroid(27698):   at de.uni_potsdam.hpi.openmensa.helpers.RetrieveFeedTask.doInBackground(RetrieveFeedTask.java:29)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.os.AsyncTask$2.call(AsyncTask.java:305)
03-09 22:43:37.605 D/Canteendroid(27698):   at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-09 22:43:37.605 D/Canteendroid(27698):   at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
03-09 22:43:37.605 D/Canteendroid(27698):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
03-09 22:43:37.605 D/Canteendroid(27698):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
03-09 22:43:37.605 D/Canteendroid(27698):   at java.lang.Thread.run(Thread.java:761)
03-09 22:43:38.535 W/afwallstart(456): type=1400 audit(0.0:21292): avc: denied { getattr } for path="/data/data/com.android.providers.downloads" dev="dm-0" ino=2179129 scontext=u:r:sysinit:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
03-09 22:43:39.224 I/AudioPolicyManagerCustom(700): FLAG None hence request for a primary output
03-09 22:43:39.224 I/AudioPolicyManagerCustom(700): FLAG None hence request for a primary output
03-09 22:43:39.224 D/audio_hw_primary(700): out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
03-09 22:43:39.226 D/audio_hw_primary(700): select_devices for use case (low-latency-playback)
03-09 22:43:39.226 D/audio_hw_extn(700): audio_extn_set_anc_parameters: anc_enabled:0
03-09 22:43:39.535 W/afwallstart(456): type=1400 audit(0.0:21293): avc: denied { getattr } for path="/data/data/com.android.providers.downloads" dev="dm-0" ino=2179129 scontext=u:r:sysinit:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
03-09 22:43:39.784 I/ActivityManager(1103): START u0 {flg=0x10804000 cmp=com.android.systemui/.recents.RecentsActivity} from uid 10033 on display 0
03-09 22:43:39.808 D/Canteendroid(27698): Save state, flushed cache storage
Harry-R commented 7 years ago

I have the same problem on LineageOS, 14.1 based on Android 7.1.1.

domoritz commented 7 years ago

I don't have time to maintain this app any more. I can merge PRs but won't be able to help otherwise.

gsauthof commented 7 years ago

I can confirm this issue on Android 7.1.2:

04-20 22:15:42.519 26266 26285 D Canteendroid: Fetching from http://openmensa.org/api/v2/canteens/202/meals/?start=2017-04-19
04-20 22:15:42.549 26266 26266 D Canteendroid: Chose canteen 202
04-20 22:15:42.580 26266 26266 W Canteendroid: Exception: Only the original thread that created a view hierarchy can touch its views.
04-20 22:15:42.580 26266 26266 D Canteendroid: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6892)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:1083)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.view.ViewGroup.invalidateChild(ViewGroup.java:5205)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.view.View.invalidateInternal(View.java:13656)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.view.View.invalidate(View.java:13592)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.widget.ProgressBar.invalidateDrawable(ProgressBar.java:1689)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.graphics.drawable.Drawable.invalidateSelf(Drawable.java:435)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.graphics.drawable.Drawable.setVisible(Drawable.java:819)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.graphics.drawable.LayerDrawable.setVisible(LayerDrawable.java:1326)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.widget.ProgressBar.swapCurrentDrawable(ProgressBar.java:623)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.widget.ProgressBar.setIndeterminate(ProgressBar.java:608)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.app.ProgressDialog.setIndeterminate(ProgressDialog.java:297)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at de.uni_potsdam.hpi.openmensa.helpers.RetrieveFeedTask.doInBackground(RetrieveFeedTask.java:110)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at de.uni_potsdam.hpi.openmensa.helpers.RetrieveFeedTask.doInBackground(RetrieveFeedTask.java:29)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.os.AsyncTask$2.call(AsyncTask.java:305)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
04-20 22:15:42.580 26266 26266 D Canteendroid:  at java.lang.Thread.run(Thread.java:761)
04-20 22:15:42.717 26266 26293 D Canteendroid: Fetching from http://openmensa.org/api/v2/canteens/202/meals/?start=2017-04-19
04-20 22:15:42.728 26266 26266 D Canteendroid: Fetched 6 days

The app is still usable after that, though.

That means the default plan is loaded and displayed after the exception popup is accepted.

domoritz commented 7 years ago

Fixed and released: https://play.google.com/store/apps/details?id=de.uni_potsdam.hpi.openmensa&hl=en

azrdev commented 6 years ago

@domoritz could you mark the current HEAD with a git tag? The f-droid package will then be updated, it is currently very out of date (and especially experiencing this issue).

domoritz commented 6 years ago

Done