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

Error after trying to search #101

Closed
permadart opened this issue Mar 13, 2016 · 3 comments
Closed

Error after trying to search #101

permadart opened this issue Mar 13, 2016 · 3 comments

Comments

@permadart
Copy link

On a clean install of the app, I run this piece of code for a search

List<UserData> results = new RushSearch() .find(UserData.class);

Clearly, the first time the app runs it has nothing stored on the dbb.

Yet, I am getting this error:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.avena.avena, PID: 31352
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String co.uk.rushorm.core.AnnotationCache.getTableName()' on a null object reference
at co.uk.rushorm.core.RushSearch.buildSql(RushSearch.java:90)
at co.uk.rushorm.core.RushSearch.find(RushSearch.java:41)
at com.avena.avena.dashboard.Profile.onCreateView(Profile.java:101)

Could you please give me a hand with this?

EDIT:

Suddenly is giving me the same error on every single search, on every single place where I have a search, no matter where am I trying to search for.

@ghost
Copy link

ghost commented Mar 14, 2016

Hi,

This is likely to be one of of two things.

Either you are manually setting the included classes on the RushConfig and have missed out the "Profile" class or you are calling search before initialization has completed.

If it it neither of those things let me know and ill see if I can debug further.

Thanks

@permadart
Copy link
Author

I managed to fix it, based on this #99, and this #74.

Official documentation mentions nothing about setting the classes manually, and it has been working just fine up until yesterday.

In the end I had to do this:

AndroidInitializeConfig config = new AndroidInitializeConfig(getApplicationContext());
List<Class<? extends Rush>> classes = new ArrayList<>();
classes.add(Some.class);
classes.add(Some.class);
config.setClasses(classes);
RushCore.initialize(config);

@Stuart-campbell
Copy link
Owner

Just closing a few open issues.

Setting the package name is now required which resolved this issue.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants