Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error on Marshmallow #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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