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

Task minifyReleaseWithR8 failing on 1.18.0 #292

Closed
tfcporciuncula opened this issue Aug 30, 2023 · 4 comments · Fixed by #322 or #321
Closed

Task minifyReleaseWithR8 failing on 1.18.0 #292

tfcporciuncula opened this issue Aug 30, 2023 · 4 comments · Fixed by #322 or #321
Assignees
Labels
bug Something isn't working

Comments

@tfcporciuncula
Copy link

tfcporciuncula commented Aug 30, 2023

Same as #280, but for new missing rules

When building a release build with the latest version (1.18.0) and AGP 8.1.1, and after adding the missing rules needed starting from 1.17.0, we now get this:

Task :android:app:minifyReleaseWithR8 FAILED
AGPBI: {"kind":"error","text":"Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/fred/Repositories/app/android/app/build/outputs/mapping/release/missing_rules.txt.","sources":[{}]}
AGPBI: {"kind":"error","text":"Missing class net.sqlcipher.Cursor (referenced from: boolean com.rudderstack.android.sdk.core.persistence.DefaultPersistenceProvider.checkIfEncryptionIsValid(java.io.File) and 1 other context)\nMissing class net.sqlcipher.database.SQLiteDatabase$CursorFactory (referenced from: boolean com.rudderstack.android.sdk.core.persistence.DefaultPersistenceProvider.checkIfEncryptionIsValid(java.io.File) and 4 other contexts)\nMissing class net.sqlcipher.database.SQLiteDatabase (referenced from: net.sqlcipher.database.SQLiteDatabase com.rudderstack.android.sdk.core.persistence.EncryptedPersistence.initialDatabase and 11 other contexts)\nMissing class net.sqlcipher.database.SQLiteOpenHelper (referenced from: void com.rudderstack.android.sdk.core.persistence.EncryptedPersistence.<init>(android.app.Application, com.rudderstack.android.sdk.core.persistence.EncryptedPersistence$DbParams, com.rudderstack.android.sdk.core.persistence.Persistence$DbCreateListener) and 2 other contexts)","sources":[{}],"tool":"R8"}

Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/fred/Repositories/app/android/app/build/outputs/mapping/release/missing_rules.txt.

Missing class net.sqlcipher.Cursor (referenced from: boolean com.rudderstack.android.sdk.core.persistence.DefaultPersistenceProvider.checkIfEncryptionIsValid(java.io.File) and 1 other context)
Missing class net.sqlcipher.database.SQLiteDatabase$CursorFactory (referenced from: boolean com.rudderstack.android.sdk.core.persistence.DefaultPersistenceProvider.checkIfEncryptionIsValid(java.io.File) and 4 other contexts)
Missing class net.sqlcipher.database.SQLiteDatabase (referenced from: net.sqlcipher.database.SQLiteDatabase com.rudderstack.android.sdk.core.persistence.EncryptedPersistence.initialDatabase and 11 other contexts)
Missing class net.sqlcipher.database.SQLiteOpenHelper (referenced from: void com.rudderstack.android.sdk.core.persistence.EncryptedPersistence.<init>(android.app.Application, com.rudderstack.android.sdk.core.persistence.EncryptedPersistence$DbParams, com.rudderstack.android.sdk.core.persistence.Persistence$DbCreateListener) and 2 other contexts)

The missing_rules.txt file has this:

# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn net.sqlcipher.Cursor
-dontwarn net.sqlcipher.database.SQLiteDatabase$CursorFactory
-dontwarn net.sqlcipher.database.SQLiteDatabase
-dontwarn net.sqlcipher.database.SQLiteOpenHelper

For now we can add those rules ourselves like before, but it would make more sense if the library can already include them.

@tfcporciuncula tfcporciuncula added the bug Something isn't working label Aug 30, 2023
@desusai7
Copy link
Contributor

Hi @tfcporciuncula,

We are working on it, will keep you posted.

@desusai7
Copy link
Contributor

Hey @tfcporciuncula,

Can you please try addding the proguard rules from here to your app and see if that solves the issue ?

@tfcporciuncula
Copy link
Author

It does, we've added the rules we got from the generated missing_rules.txt file I mentioned, but we would expect the library to bundle its own rules like most other libraries do.

@desusai7
Copy link
Contributor

Yes, we will definitely do that in the upcoming releases. Right now we are working on fine-tuning the rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment