-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Avoid EncryptedHelper ART warning due to missing SQLCipher super class #428
Comments
I've obtained this warnirng in this line. Please look the way that I do. final Database db;
final DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(context, MyStrings.database, null);
db = helper.getWritableDb();
final DaoMaster daoMaster = new DaoMaster(db);
final DaoSession daoSession = daoMaster.newSession(); |
Please tell us on which device and Android version you are seeing this. |
Lenovo PHAB 750M |
I've updated 2.X to version 3.1.1 /art: Rejecting re-init on previously-failed class java.lang.Class<org.greenrobot.greendao.database.DatabaseOpenHelper$EncryptedHelper> my code:
but it can be still work. |
Do you guys include the greendao JAR manually? Try to add it via a Gradle dependency. Found a similar issue on the Android bug tracker. -ut |
This realm bug might also be of interest, issue was with how RxJava support is "loaded". -ut |
No response. Closing. -ut |
@greenrobot-team @greenrobot The same issue on xiaomi mi note 3 with marshmallow with latest version of lib |
Also having the same issue on xiaomi mi note 3 marshmallow |
@umesh0492 @baylonedward Can you show me how you are including greenDAO in your Gradle config files? Are you adding it as a JAR or Gradle dependency? -ut |
I hava the same problem in my phone, YQ601, Android Version:5.1.1 |
@greenrobot-team Came here from Google because I saw all these warnings, too, in Logcat. Huawei Honor 7 with Android 6.0
Gradle: Code:
|
@greenrobot Hello! I have the same problem,with some information below: and in my project
in my module
Code: DaoMaster.DevOpenHelper devOpenHelper = new DaoMaster.DevOpenHelper(this, "voerka");
Database database = devOpenHelper.getWritableDb();
DaoSession mDaoSession = new DaoMaster(database).newSession();
UserDao userDao = mDaoSession.getUserDao();
User user = new User(null, "xiaoming", "小明");
userDao.insert(user); |
Same here on Samsung Galaxy S7 with Android 7.0 as well as on S3 with Android 6 build.gradle buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1'
}
}
apply plugin: 'org.greenrobot.greendao'
apply plugin: 'com.android.application'
greendao {
schemaVersion 1
}
[...]
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.android.support:cardview-v7:25.1.1'
compile 'org.greenrobot:greendao:3.2.0'
compile 'org.greenrobot:eventbus:3.0.0'
} |
If I understand correctly this is not a crash? This warning should be harmless and is probably caused by ART not being able to load the classes used for database encryption in greenDAO. Unless you are using database encryption and forgot to add the SQLCipher dependency, you should be fine. |
Dear @greenrobot-team, this warning is not harmless, as it is a false alarm that pollutes the log. It's a lengthy stack trace that makes real problems dissolve in it. Can you please come up with a stub or something that will satisfy ART and stop this from appearing? |
@greenrobot It's better to try to deal with this problem amicably |
The issue also appears on the Nexus 5X
|
I just tried to reproduce this on a simple project with an API 25 and API 16 emulator but I am not seeing this message (neither debug or release build). Can you check if you maybe have dependency conflicts by running the |
No response. Closing. -ut |
I encounter the same problem. The reason is some class missing. gradle just like this: |
I am also getting these errors and I am not calling |
@davetao Can you provide a small example project and steps to reproduce this? Because as said before I tried to reproduce this, but can't. So we can not work on a fix. -ut |
Indeed, But I can find any calls to getEncryptedWritableDb(), as I did not use it from the beginning. I'd like to provide examples, but I saw others have done that , it will be the same. Even, I'd like to provide you my devices, because I think it is device based, if possible, I mail you my device, I am from China. |
@greenrobot-team you can reproduce by setting compileSdkVersion and targetSdkVersion to 28 in DaoExample , and then run the app on Virtual Device API 28. |
@greenrobot-team you can reproduce by setting compileSdkVersion and targetSdkVersion to 28 in DaoExample with Android Studio 3.2 Version, and then run the app on Virtual Device API 28.100% repetition |
EncryptedHelper is a non-static inner class of DatabaseOpenHelper,classloader believes non-static class is very important to the Outer one. So classloader tries a lot to load EncryptedHelper, whereas |
I got the same problem while running on API 28. We can introduce this library to avoid this problem: |
this is the most reasonable explanation, But how to fix it if I did not want to add EncryptedHelper dependency ? |
Same issue. The culprit is the EncryptedHelper as @intheworld mentioned. |
Confirmed using example set to
-ut |
#924 gets it down to 2 warnings. Not sure how to get rid of them completely. -ut |
@greenrobot-team what is the roadmap to merge #924? |
Including 'net.zetetic:android-database-sqlcipher' (even you are not using encrypted database) does help you get rid of those warnings, but it also brings a significant APK size increase (from 9.3M to 16.4M in my case). You may need to use 'debugImplementation' if your product is APK size sensitive. |
i get the same warning in my app |
Edit: note that with this fix, the encryption helper is accessed via reflection. If your code uses ProGuard or R8, you will have to update your rules. |
Today I've updated to version 3.1.1
When I launch the app, I make a request and pass the data to db.
Since the new update I watch this warning, is it normal? Excuse for my english
The text was updated successfully, but these errors were encountered: