Open eygraber opened 4 years ago
Very interesting! Not sure if it's worth it to do if you haven't done it, but have you bisected to a commit that caused it to see if the prescribed R8 rule is sufficient? Have you investigated a way to package a shrinker config file into the build so everyone can benefit (I know there's a way and other projects - for instance - ACRA might serve as an example but I've never done it personally)
I just added this library yesterday. It was working on my debug builds, but when our CI created a nightly release build with R8 I saw this crash.
I built a release version manually and confirmed that it crashes. Then I put the fix I mentioned in and it doesn't crash. As a sanity check I built the app without this library and it doesn't crash.
These rules should get packaged with the library, and I'm not sure why they're not sufficient enough to prevent this crash. In fact, I think they're a little overkill in keeping all those classes, but I'm not sure what it could be narrowed down to.
Getting back from holidays now - is it safe to say the expected fix (to keep your app from crashing) is a PR with an update to that file to implement the new rule you proposed? That seems reasonable to me at any rate - if so could you submit the PR for it? Especially for text files like this github makes the PR workflow pretty easy - I think if you just hit the edit button on the file within the github UI it handles all the fork/clone stuff for you and just gives you an editing textbox
I'm unable to test now, but I believe the file could be update to:
-keepclasseswithmembernames,includedescriptorclasses class io.requery.android.database.** {
native <methods>;
}
I will update when I get a chance to test it and make sure it doesn't introduce regressions.
Did you find any issues with that change? looks relatively safe
It should be fine. I used it for a few weeks before switching to SqlCipher (business requirement) and everything worked.
I did some more research when I encountered similar problems in SqlCipher and I could make a PR based on those findings sometime this week.
Using version 3.30.1 of this library, I get the following crash when opening the app on a release build that uses R8.
If I add this to my rules then there is no crash:
In my app I depend on this library, and call
ReLinker.loadLibrary(context, "sqlite3x")
: