diegocarloslima / FloatingGroupExpandableListView

An open source Android library that provides a floating group view at the top of the ExpandableListView
Apache License 2.0
373 stars 136 forks source link

Crash issue in Adroid 10 #52

Open Ktirumalsetty opened 4 years ago

Ktirumalsetty commented 4 years ago

2020-07-24 00:44:21.690 7989-7989/com.KryptosTextApp.KryptosText E/AndroidRuntime: FATAL EXCEPTION: main Process: com.KryptosTextApp.KryptosText, PID: 7989 java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference at com.diegocarloslima.fgelv.lib.FloatingGroupExpandableListView.dispatchDraw(FloatingGroupExpandableListView.java:192) at android.view.View.draw(View.java:21424) at android.widget.AbsListView.draw(AbsListView.java:4388) at android.view.View.updateDisplayListIfDirty(View.java:20298) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.draw(View.java:21424) at android.view.View.updateDisplayListIfDirty(View.java:20298) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.draw(View.java:21424) at androidx.viewpager.widget.ViewPager.draw(ViewPager.java:2426) at android.view.View.updateDisplayListIfDirty(View.java:20298) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1277) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.draw(View.java:21424) at android.view.View.updateDisplayListIfDirty(View.java:20298) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at androidx.drawerlayout.widget.DrawerLayout.drawChild(DrawerLayout.java:1478) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.draw(View.java:21424) at android.view.View.updateDisplayListIfDirty(View.java:20298) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4149) 2020-07-24 00:44:21.693 7989-7989/com.KryptosTextApp.KryptosText E/AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:20289) at android.view.View.draw(View.java:21153) at android.view.ViewGroup.drawChild(ViewGroup.java:4388)

xiachengcheng commented 4 years ago

Same issue here, any schedule or work around?

xiachengcheng commented 4 years ago

Crash happened in :

 if (VERSION.SDK_INT >= 14) {
            this.mSelectorPosition = (Integer)ReflectionUtils.getFieldValue(AbsListView.class, "mSelectorPosition", this);
        } else {
            this.mSelectorPosition = (Integer)ReflectionUtils.getFieldValue(AbsListView.class, "mMotionPosition", this);
        }

in dispatchDraw(Canvas), where ReflectionUtils.getFieldValue(AbsListView.class, "mSelectorPosition", this) returns null. So problem is that will author upgrade this library anymore?

deli990 commented 4 years ago

用ExpandableListView 替换掉FloatingGroupExpandableListView即可解决奔溃问题。引发的原因是:mSelectorPosition在android10(sdk= 30)上被添加了注解 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P 最大sdk =28 ) int mSelectorPosition = INVALID_POSITION;ReflectionUtils.getFieldValue(AbsListView.class, "mSelectorPosition", this)使用反射是拿不到这个成员变量的值的。

tugceaktepe commented 4 years ago

Hello, Will there be an update for Android 10 ?

helloliuyf commented 3 years ago

用ExpandableListView 替换掉FloatingGroupExpandableListView即可解决奔溃问题。引发的原因是:mSelectorPosition在android10(sdk= 30)上被添加了注解 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P 最大sdk =28 ) int mSelectorPosition = INVALID_POSITION;ReflectionUtils.getFieldValue(AbsListView.class, "mSelectorPosition", this)使用反射是拿不到这个成员变量的值的。

意思是不用推荐用这个库吗?直接用ExpandableListView ?

thelou1s commented 2 years ago

用ExpandableListView 替换掉FloatingGroupExpandableListView即可解决奔溃问题。引发的原因是:mSelectorPosition在android10(sdk= 30)上被添加了注解 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P 最大sdk =28 ) int mSelectorPosition = INVALID_POSITION;ReflectionUtils.getFieldValue(AbsListView.class, "mSelectorPosition", this)使用反射是拿不到这个成员变量的值的。

reflection sucks, reflection not public field sucks.