Code Monkey home page Code Monkey logo

Comments (21)

gregkorossy avatar gregkorossy commented on June 2, 2024 1

Well, I tested 24.1.0.1 on the AWS Device Farm's Note 3 with 4.4.2 and no crash happened.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

Yeah, this definitely looks like a reflection problem. I wonder what can cause this as there were no changes to the preference part of the support library...

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

I guess the fields are in place, but probably something in the parent class happens before the initialization of the fields and it tries to use them.

I have an idea to try and resolve them later, but I don't have a device I could test it on (none of the emulators nor my devices produce this bug).

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

I committed it, if you could test it, that'd be awesome!

from android-support-preference-v7-fix.

kakai248 avatar kakai248 commented on June 2, 2024

Thanks for the fast response! I'll reach the user and ask him to test.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

So, it's now on jcenter too. Look for the version number 24.1.0.1.

from android-support-preference-v7-fix.

kakai248 avatar kakai248 commented on June 2, 2024

I contacted the user and sent him an APK with the new version of the preferences. Still crashes. Same stacktrace.

Looking at the code it could fail in 3 different ways:

  1. The for doesn't execute once
  2. The if evaluates false everytime
  3. getDeclaredField returns null

I can't reproduce this in any way, don't know how to debug the problem. There's also so much I can ask the user to test. Really weird issue.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

I'll try to reproduce it on AWS Device Farm. It has a 4.4.2 Note 3 device, so hopefully it will crash there too.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

Haven't tried it yet, but seems like Google has released v24.1.1 of the support library (it's not on their revision history page at the time of writing this comment).

from android-support-preference-v7-fix.

kakai248 avatar kakai248 commented on June 2, 2024

I guess it could be because of Xposed. I really don't know. I'll stay in 23.4.0.5.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

I'd recommend against that as eventually you will probably have to use the 24 versions anyways.

If your user uses Xposed, that's basically out of anyone's reach. Anything that interferes with the Android system is a hazard to any application. I don't know the Xposed internals but if it overrides reflections by changing the name of the fields, that's just wtf.

from android-support-preference-v7-fix.

Mygod avatar Mygod commented on June 2, 2024

Xposed is like system hooks. Just ignore those.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

It's interesting though. If I could grab that device, I'd check the reflection things, like what's the name of the fields / classes being resolved.

from android-support-preference-v7-fix.

kakai248 avatar kakai248 commented on June 2, 2024

Yeah, eventually I'll have to update. It's not a must right now because I was only doing it for the preference category bottom margin.

It only happens to this one user, but if I update it, it completely kills the settings for him as he can't open anything at all.

And 24.1.1 doesn't seem to fix the problem. The patch notes are out.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

I can create a quickfix that makes it fall back to the original implementation when the reflection doesn't work, but that means no padding fix until the guys at Google fix it.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

So, the new version (24.1.1.0) is available on gradle. It contains the aforementioned quickfix so if you want to use v24 without crashing that user, he/she won't encounter now the crash but see the non-padding-fixed version of the preferences.

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

v24.2.0.0 has been released, update your gradle file:

compile 'com.takisoft.fix:preference-v7:24.2.0.0'

If you can, please check whether the bug still persists.

from android-support-preference-v7-fix.

kakai248 avatar kakai248 commented on June 2, 2024

Ah sorry, I totally forgot about this. Will update and ask the user if everything is okay.

from android-support-preference-v7-fix.

kakai248 avatar kakai248 commented on June 2, 2024

Seems to be working fine. When it is going to crash it ignores the margin and works fine. Thanks!

from android-support-preference-v7-fix.

gregkorossy avatar gregkorossy commented on June 2, 2024

Yes, because the new one falls back to the original (paddingless) implementation on failure. Hopefully Google fixes the official lib soon...

from android-support-preference-v7-fix.

j05u3 avatar j05u3 commented on June 2, 2024

This happened also to me on a sony xperia with android 4.4.4 and version 24.1.0.1
But I noticed that without proguard it worked fine.
Updated to the version 24.2.0.0 and is working fine either with proguard too.

from android-support-preference-v7-fix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.