-
Notifications
You must be signed in to change notification settings - Fork 581
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
ExceptionInInitializerError While database is initializing #424
Comments
I'm encountering the same bug, on multiple 4.0.3 and 4.0.4 devices.
I think the problem comes from SugarORM. Normally, I'm using the latest version of the code (11e8d74). |
It appears there is a fatal error while the DB is initializing, this causes the DB to be corrupted for the user. Not sure if it is purely from SugarDB or from 3rd party framework. But it appears the error is on DB update. Right now i am trying to delete existing DBs where this error occurs. |
Hello, |
Good news ! I replaced this line in my Manifest : |
currently sorting this out by deleting existing database file and letting it be reinitialized on the first call to sugar orm. It seems the error happens on upgrade.
|
I guess that would work, but deleting all data on error seems like bad user experience to me. |
I think it's useful to take a look at issue #391 |
@nicolabeghin you are right, currently adding domain package name solves the error, but testing with master branch with fix for multidex support, still got the error. |
@Ajibola could you post your logs? I do not have an Android 6.0 to test right now |
@sibeliusseraphini in my case this happens on < 6.0. I can confirm it doesn't work on android 4.3 and 4.4 when compiling with targetSdk 23 and support library 23.0.1 |
@nicolabeghin maybe this PR #362, could fix it, could you test it please? |
thanks @sibeliusseraphini! I can confirm it solves the issue.
|
I've tried tried with DOMAIN_PACKAGE_NAME and without it. I'm on 4.4.2 and this library is not working for me in any case 👎 |
fixed with #362 |
@leberrm Looks like this issue has not yet been fixed. |
here is resolved... |
This maybe late but I have found an issue with the way objects are compared in Android versions lower than LOLLIPOP within Sugar ORM @TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public boolean equals(Object o) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// your logic for confirming equality
}
return super.equals(o);
} |
Hi my friend
a lot of error suger in high version api accord by actived instant run
Please me.im a little known English
…On Dec 14, 2017 00:26, "James Njenga" ***@***.***> wrote:
This maybe late but I have found an issue with the way objects are
compared in Android version lower that *LOLLIPOP*
For you model (Class extending SugarRecord) on *Android Versions lower
than LOLLIPOP*, Change the equals method if you have override it to
something like:
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@OverRide
public boolean equals(Object o) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// your logic for confirming equality
}
return super.equals(o);
}
``
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#424 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AX9IEiZeigHhzN24Lt70HHdXLzHpG1qhks5tADn3gaJpZM4GiM6H>
.
|
We have been using Sugar ORM for a while now and have an application in production with it. We have a table Stats that was not being setup and this caused that part of the code to throw errors. Now i can't seem to get anything to work, getting an ExceptionInInitializerError while the database is trying to initialize when the app launches for the first time. This error causes the app to crash.
Was using version 1.4 beta, now migrated to 1.4 release but still same error. I have uninstalled the app and cleared the app data on device, but this doesn't help at all. Please do anyone have an idea what is going on?
The app is currently using multidex, not sure how this could affect the db though.
ava.lang.ExceptionInInitializerError
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at java.lang.Class.classForName(Native Method)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at java.lang.Class.forName(Class.java:251)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at com.orm.util.ReflectionUtil.getDomainClass(ReflectionUtil.java:273)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at com.orm.util.ReflectionUtil.getDomainClasses(ReflectionUtil.java:257)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at com.orm.SchemaGenerator.createDatabase(SchemaGenerator.java:42)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at com.orm.SugarDb.onCreate(SugarDb.java:26)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at com.orm.SugarDb.getDB(SugarDb.java:36)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at com.orm.SugarRecord.getSugarDataBase(SugarRecord.java:34)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime: at com.orm.SugarRecord.findWithQuery(SugarRecord.java:161)
11-13 23:32:01.924 18015-18015/ng.amebo E/AndroidRuntime:
The text was updated successfully, but these errors were encountered: