question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException: Attempt to invoke virtual method 'com.orm.Database com.orm.SugarApp.getDatabase()' on a null object reference

See original GitHub issue

I’am constantly getting this error. The SugarApp class never calls onCreate therefore, any operation fails.

java.lang.NullPointerException: Attempt to invoke virtual method 'com.orm.Database com.orm.SugarApp.getDatabase()' on a null object reference

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
Leandroscommented, Aug 12, 2014

I’ve forgot to add android:name="com.orm.SugarApp" to my application tag in the AndroidManifest.xml.

0reactions
qstpnvcommented, Jan 16, 2018

@hoshomoh or you can just extend your class from SugarApp (public class YourApplication extends SugarApp)

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Attempt to invoke virtual method 'com.orm.Database ...
Attempt to invoke virtual method 'com.orm.Database com.orm.SugarApp.getDatabase()' on a null object referenc ... I am using Android Studio to develop my android ...
Read more >
Attempt to invoke virtual method on a null object reference Fixed
java.lang. NullPointerException : Attempt to invoke virtual method on a null object reference Fixed Coding With Hammad ...
Read more >
android studio | on a null object reference - YouTube
NullPointerException : Attempt to invoke virtual method 'android. database.sqlite.SQLiteDatabase com.pd.demo.DBmain.getReadableDatabase () ' on ...
Read more >
SQLite Database null object reference question : r/androiddev
When I try to delete a row, I get the following error message: Attempt to invoke virtual method 'android.database.sqlite.SQLiteDatabase android.content.
Read more >
Attempt to invoke virtual method 'com.orm.Database com.orm ...
SugarApp внутри application tag. ... SugarApp.getDatabase()' on a null object referenc ... NullPointerException: Attempt to invoke virtual method 'com.orm.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found