Skip to content

Conversation

@okaymak-esites
Copy link

@okaymak-esites
Copy link
Author

Fixes error:

java.lang.IllegalAccessException: java.lang.Class<MyEntity> is not accessible from java.lang.Class<com.orm.SugarRecord>

The entity is defined as:

class MyEntity extends SugarRecord {
    ...fields...

    public MyEntity() {
    }

    ...getters/setters
}

@RoyMontoya
Copy link
Contributor

setting setAccessible(true) doesn't affect pre-marshmellow? if it does my suggestion would be to keep setAcessible(false) for Pre-marshmellow. you can isolate the new code with something like this: if(Build.VERSION.SDK_INT==Build.VERSION_CODES.MARSHMELLOW){
setAccessible(true);
}

@okaymak-esites
Copy link
Author

No, it doesn't affect pre-marshmallow.

@RoyMontoya
Copy link
Contributor

Awesome! (Y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants