StickyListHeaders icon indicating copy to clipboard operation
StickyListHeaders copied to clipboard

Android O Beta - java.lang.IllegalStateException: Handling non empty state of parent class is not implemented

Open NLLAPPS opened this issue 8 years ago • 48 comments

Is this project still maintained? Every now and then I get above error on Android O Beta. I guess it is related the OS but just heads up

Stack trace:

Java.lang.IllegalStateException: Handling non empty state of parent class is not implemented at se.emilsjolander.stickylistheaders.StickyListHeadersListView.onSaveInstanceState(StickyListHeadersListView.java:1098) at android.view.View.dispatchSaveInstanceState(View.java:17157) at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:3668) at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:3674) at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:3674) at android.view.View.saveHierarchyState(View.java:17140)

NLLAPPS avatar Jun 04 '17 18:06 NLLAPPS

I can confirm, this error happens only on Android O for us, and seems to happen only on Nexus/Pixel devices.

Edit: Was mislead by API level 25 in crash reports, looks like Android O reported API level 25 for a while.

sandy-8925 avatar Jun 08 '17 23:06 sandy-8925

As far as I know it only happens on Android O. It might be a bug with the platform

NLLAPPS avatar Jun 09 '17 06:06 NLLAPPS

With O and maybe earlier, the assumption that StickyListHeaderListView class relies on (that the super class does not have any state of its own to safe) no longer necessarily holds true. On my fork I tried to implement proper handling of this new situation: https://github.com/mtotschnig/StickyListHeaders/commit/c9f9a44cb689320fa2e22496460a83264d1b3020

mtotschnig avatar Jun 09 '17 23:06 mtotschnig

@mtotschnig Great, thanks. Do you have a compile url for gradle for your fork? Because this library seems is discontinued and won't get any fix.

chrisonline avatar Jun 12 '17 21:06 chrisonline

@chrisonline Yes it can be included via Jitpack: https://jitpack.io/#mtotschnig/StickyListHeaders/master-SNAPSHOT

mtotschnig avatar Jun 12 '17 22:06 mtotschnig

@mtotschnig There might be an issue with your implementation. I had a crash in the app, unrelated to your code but trace kept showing me your implementation about saved state. I was not able to capture it. I will post details if I can recreate it

NLLAPPS avatar Jun 26 '17 09:06 NLLAPPS

Ah! Error exactly as @nvquockhtn posted at https://github.com/mtotschnig/StickyListHeaders/commit/c9f9a44cb689320fa2e22496460a83264d1b3020

NLLAPPS avatar Jun 26 '17 09:06 NLLAPPS

I got this issue from crashlytics too (Java.lang.IllegalStateException: Handling non empty state of parent class is not implemented).

Did you find a way to reproduce it? I setup Android O on a virtual device on Android Studio (nexus pixel xl) but everything works fine. If it happens in the onSaveInstance, I expect it to happen on some configuration change, but no way to reproduce it (I tried to rotate, lock, switch from one app to another, whatever, everything works fine).

I'd like to at least be able to reproduce it so that I can be sure that the fix works. So, if you have any clue about how to trigger the exception, I'd be suuuuper glad!

Cylix avatar Jun 26 '17 21:06 Cylix

I was able to reproduce on actual physical device (Nexus 6P with Android O) when launching a different activity from the activity containing StickyListHeadersListView in it's view hierarchy.

On Mon, Jun 26, 2017, 2:05 PM Simon Ninon [email protected] wrote:

I got this issue from crashlytics too (Java.lang.IllegalStateException: Handling non empty state of parent class is not implemented).

Did you find a way to reproduce it? I setup Android O on a virtual device on Android Studio (nexus pixel xl) but everything works fine. If it happens in the onSaveInstance, I expect it to happen on some configuration change, but no way to reproduce it (I tried to rotate, lock, switch from one app to another, whatever, everything works fine).

I'd like to at least be able to reproduce it so that I can be sure that the fix works. So, if you have any clue about how to trigger the exception, I'd be suuuuper glad!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/emilsjolander/StickyListHeaders/issues/477#issuecomment-311181564, or mute the thread https://github.com/notifications/unsubscribe-auth/AAyszwn778H7UdexgwuB5F_veFmZuhL9ks5sIB0GgaJpZM4Nvc9T .

sandy-8925 avatar Jun 26 '17 21:06 sandy-8925

I was not able to reproduce it on Nexus 5x with latest Android beta but got many crash reports from Nexus 6P when launching a different activity from the activity with StickyHeaders. I wonder if it is related to device.

NLLAPPS avatar Jun 26 '17 21:06 NLLAPPS

I didn't reproduce it with a virtual device either. But with a physical Nexus 6P it happened all the time.

Sloy avatar Jun 26 '17 21:06 Sloy

Thanks for your replies! Yeah, unfortunately, I do not have nexus 6P or pixel, only a Nexus 6 but there is no way to install Android O on it apparently, so I guess I have no way, for now, to reproduce on my side. Thank again for the quick replies :)

Cylix avatar Jun 26 '17 21:06 Cylix

By the way, you can increase the probability of reproducing the crash by setting "Don't keep activities" in the systems' developer settings.

mtotschnig avatar Jun 27 '17 06:06 mtotschnig

Hi, I am facing similar issue and were anyone able to solve this?

java.lang.IllegalStateException: at se.emilsjolander.stickylistheaders.StickyListHeadersListView.onSaveInstanceState (StickyListHeadersListView.java:1029)

crucibond avatar Sep 10 '17 23:09 crucibond

It is solved in https://github.com/mtotschnig/StickyListHeaders/releases/tag/2.7.1 . Use it via Jitpack compile 'com.github.mtotschnig:StickyListHeaders:2.7.1'

mtotschnig avatar Sep 11 '17 07:09 mtotschnig

@emilsjolander any plans to bring in @mtotschnig fixes? I'd prefer not to add Jitpack to my project! Thanks!

madhacked avatar Sep 12 '17 22:09 madhacked

@madhacked this project is 100% not maintained anymore, the last commit is dated from 2015. I don't think you should expect any plans. Best case would be someone forking this repo and maintaining the fork.

Cylix avatar Sep 12 '17 23:09 Cylix

fyi @madhacked and those who do not want to use jitpack or the additional support library dependency:

I have compiled the aar off master + 1 proper fix commit (https://github.com/edisonw/StickyListHeaders/commit/3dd88a2ad789ec24f369be35a8494ccf9379a07e)

The download link is here:

https://github.com/edisonw/StickyListHeaders/blob/master/release-2.7.2.aar

Everyone feel free to rename and download it locally if needed.

Note the correct way to use an aar file, if your file is inside /projectRoot/app/libs/sticky-list-headers.aar,

You need to declare this in your root dependency configuration:


        flatDir {
            dirs project(':app').file('libs')
        }

And then you can use it as compile(name:'sticky-list-headers', ext:'aar')

edisonw avatar Sep 13 '17 04:09 edisonw

Hey guys,

@mtotschnig's personal forks had changes other than the problem addressed above. I've created a fork with his solution to the problem without any other changes. PR: https://github.com/jungc/StickyListHeaders/pull/1 It has been merged to master on my fork Also, I changed the version number to "2.7.1-FORK" in case this project ever gets maintained again.

Where to get the .aar file for your project :) https://github.com/jungc/StickyListHeaders/releases/tag/2.7.1-FORK

NOTE: 1. This change comes from Groupon. 2. We won't maintain it.

jungc avatar Oct 10 '17 23:10 jungc

@jungc how can I install/use this fork?

haemi avatar Oct 24 '17 05:10 haemi

Mute

Vào 11-10-2017 07:34, "Jaden Choi" [email protected] đã viết:

Hey guys,

@mtotschnig https://github.com/mtotschnig's personal forks had changes other than the problem addressed above. I've created a fork with his solution to the problem without any other changes jungc#1 https://github.com/jungc/StickyListHeaders/pull/1 Also, I changed the version number to "2.7.1-FORK" in case this project ever gets maintained again.

**NOTE:

  1. This change comes from Groupon.
  2. We won't maintain it.**

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/emilsjolander/StickyListHeaders/issues/477#issuecomment-335638152, or mute the thread https://github.com/notifications/unsubscribe-auth/ATBBl750ctjbzkois8-BGV-v0OvvsYwzks5sq_7zgaJpZM4Nvc9T .

dapda avatar Oct 24 '17 09:10 dapda

@haemi thanks for pointing that out. I've uploaded the .aar file here https://github.com/jungc/StickyListHeaders/releases/tag/2.7.1-FORK

jungc avatar Oct 25 '17 04:10 jungc

@jungc thanks, I did that but I get failed to resolve: se.emilsjolander:stickylistheaders:stickylistheaders:

I updated my app-build.gradle:

repositories {
    maven { url "${rootDir}/local_repos" }
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
    google()
}
implementation "se.emilsjolander:stickylistheaders:stickylistheaders:2.7.1-FORK@aar"

file is here:

local_repos/se/emilsjolander/stickylistheaders/2.7.1-FORK/stickylistheaders-2.7.1-FORK.aar

haemi avatar Oct 31 '17 15:10 haemi

@jungc help pleeeeease...

haemi avatar Nov 07 '17 14:11 haemi

@haemi @Sloy sorry about the delay. It looks like I made a typo with the previous release draft. It took me awhile to notice but it should be: implementation "se.emilsjolander:stickylistheaders:2.7.1-FORK@aar" :) <group id>:<artifact id>:<version>@aar^

jungc avatar Nov 14 '17 06:11 jungc

Hey guys, you don't have to use a fork; the extra saved state comes from the autofill framework.

Disable autofill on the StickyListHeadersListView, and it will work fine.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
  myList.setImportantForAutofill(IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS);
}

Of course, if you WANT autofill in your list view, then this workaround is not for you :)

brianguertin avatar Nov 17 '17 17:11 brianguertin

@brianguertin thanks, it's working perfectly!

CsabaZz avatar Nov 23 '17 14:11 CsabaZz

@brianguertin Thanks, it works. Strange that I have two list with sticky headers and this issue only happen to one of them. I tried to compare the two and they seems exactly the same. Only one of them need your "fix".

Thanks again!

ykphuah avatar Nov 25 '17 09:11 ykphuah

Android 25 the same issue occured.

prince3156 avatar Jan 04 '18 14:01 prince3156

#420 Xposed v89 SDK26 crash on module download page

kohterachai avatar Jan 15 '18 15:01 kohterachai