Giter Club home page Giter Club logo

Comments (12)

satyan avatar satyan commented on July 21, 2024

were you able to determine the cause? I don't see any reason for this error to come.. Is this occasional or regular error?

from sugar.

PomepuyN avatar PomepuyN commented on July 21, 2024

Unfortunately, it's not occasional. It's the first source of crashes for my app (21 occurrences today).
Here are the full information about it: http://crashes.to/s/84527a7975b
I made more search about it but I was unable to find where it may come from.

What I don't understand is why there is a mix of valid columns and invalid one.

SHADOWMONITOR (code 1): , while compiling: UPDATE F_GROUP SET SHADOWMONITOR=?,SHADOWKLASS=?,TOTAL=?,GROUP_ID=?,NAME=?,PAGE=?,CURRENT=? WHERE ID = ?

My entity:

public class FGroup extends SugarRecord<FGroup> implements RequestData {

    int total;
    int current;
    String name;
    public String groupId;
    public int page;

    public FGroup() {
        super();
    }

    public FGroup(Context context, String groupId, String name, int page, int current, int total) {
        super();
        this.name = name;
        this.groupId = groupId;
        this.current = current;
        this.total = total;
    }
}

It seems to only occur on "UPDATE" commands but on different entities.

from sugar.

gaddas avatar gaddas commented on July 21, 2024

It's because the users had ART activated (read more http://source.android.com/devices/tech/dalvik/art.html ). It implements the base type Object with 2 extra fields:

public class Object {
    private transient Class<?> shadow$_klass_;
    private transient int shadow$_monitor_;

I made a pull request, but have missed the 2nd field initially.

from sugar.

satyan avatar satyan commented on July 21, 2024

ah.. that explains.. I did go through your pull request, but couldn't test it coz of lack of ART based device.

We could skip the transient fields.. that should be good enough. right?

from sugar.

satyan avatar satyan commented on July 21, 2024

@PomepuyN @gaddas Would you be able to test it out.. in SugarRecord.java line no: 360

 for (Field field : typeFields) {
            if (!field.isAnnotationPresent(Ignore.class) && !Modifier.isStatic(field.getModifiers())&& !Modifier.isTransient(field.getModifiers())) {
                toStore.add(field);
            }
        }

from sugar.

satyan avatar satyan commented on July 21, 2024

@PomepuyN you can try out the latest 1.3_beta jar.. it has the above change.

from sugar.

gaddas avatar gaddas commented on July 21, 2024

The example application is working - I tested without the change (got same error) and without (the error was gone).

from sugar.

satyan avatar satyan commented on July 21, 2024

Cool.. Thanks

from sugar.

PomepuyN avatar PomepuyN commented on July 21, 2024

Great!
Thanks a lot @gaddas
@satyan I will include the new jar and let you know if it solved my issue. I think I will be able to release it tomorrow.

from sugar.

PomepuyN avatar PomepuyN commented on July 21, 2024

Ok.
After two days in production, there are no more crashes.
Once again thanks to @gaddas and @satyan 👍

from sugar.

satyan avatar satyan commented on July 21, 2024

closing this.. as it looks fixed.

from sugar.

Giorgi avatar Giorgi commented on July 21, 2024

Perhaps it makes sense not to get fields on base class if the base class is Object so that we avoid crashes in future if Google adds other fields?

from sugar.

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.