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

Proguard not supported by Printooth #122

Open
pitampoudel opened this issue Jul 27, 2024 · 0 comments
Open

Proguard not supported by Printooth #122

pitampoudel opened this issue Jul 27, 2024 · 0 comments

Comments

@pitampoudel
Copy link

I have implemented Printooth on my Android app and is working perfectly fine with the debug app but when I build a release version of my app with Proguard enabled then the app crashes at run time.

io.paperdb.PaperDbException: Couldn't read/deserialize file /data/user/0/com.bigbusnepal/files/io.paperdb/paired printer.pt for table paired printer

here is the full crash report:

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1300307914, result=-1, data=null} to activity {com.bigbusnepal/com.bigbusnepal.MainActivity}: io.paperdb.PaperDbException: Couldn't read/deserialize file /data/user/0/com.bigbusnepal/files/io.paperdb/paired printer.pt for table paired printer
    android.app.ActivityThread.deliverResults(ActivityThread.java:5673)
    android.app.ActivityThread.handleSendResult(ActivityThread.java:5712)
    android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
    android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
    android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:2470)
    android.os.Handler.dispatchMessage(Handler.java:106)
    android.os.Looper.loopOnce(Looper.java:240)
    android.os.Looper.loop(Looper.java:351)
    android.app.ActivityThread.main(ActivityThread.java:8423)
    java.lang.reflect.Method.invoke(Method.java:0)
    com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Caused by: io.paperdb.PaperDbException: Couldn't read/deserialize file /data/user/0/com.bigbusnepal/files/io.paperdb/paired printer.pt for table paired printer
    io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:323)
    io.paperdb.DbStoragePlainFile.select(DbStoragePlainFile.java:166)
    io.paperdb.Book.read(Book.java:73)
    com.mazenrashed.printooth.data.PairedPrinter$Companion.getPairedPrinter(PairedPrinter.kt:14)
    com.mazenrashed.printooth.Printooth.hasPairedPrinter(Printooth.java:58)
    core.utils.PrintManager_androidKt.rememberPrinterManager$lambda$7(PrintManager_android.kt:152)
    androidx.activity.compose.ActivityResultRegistryKt$rememberLauncherForActivityResult$1$1.invoke$lambda$0(ActivityResultRegistry.kt:106)
    androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.kt:371)
    androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.kt:331)
    androidx.activity.ComponentActivity.onActivityResult(ComponentActivity.kt:786)
    androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:151)
    android.app.Activity.dispatchActivityResult(Activity.java:8756)
    android.app.ActivityThread.deliverResults(ActivityThread.java:5666)
    android.app.ActivityThread.handleSendResult(ActivityThread.java:5712)
    android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
    android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
    android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:2470)
    android.os.Handler.dispatchMessage(Handler.java:106)
    android.os.Looper.loopOnce(Looper.java:240)
    android.os.Looper.loop(Looper.java:351)
    android.app.ActivityThread.main(ActivityThread.java:8423)
    java.lang.reflect.Method.invoke(Method.java:0)
    com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Caused by: com.esotericsoftware.kryo.KryoException: Error constructing instance of class: io.paperdb.PaperTable
    com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy$2.newInstance(Kryo.java:1300)
    com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1139)
    com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:0)
    com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:538)
    com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:712)
    io.paperdb.DbStoragePlainFile.readContent(DbStoragePlainFile.java:332)
    io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:316)
    io.paperdb.DbStoragePlainFile.select(DbStoragePlainFile.java:166)
    io.paperdb.Book.read(Book.java:73)
    com.mazenrashed.printooth.data.PairedPrinter$Companion.getPairedPrinter(PairedPrinter.kt:14)
    com.mazenrashed.printooth.Printooth.hasPairedPrinter(Printooth.java:58)
    core.utils.PrintManager_androidKt.rememberPrinterManager$lambda$7(PrintManager_android.kt:152)
    androidx.activity.compose.ActivityResultRegistryKt$rememberLauncherForActivityResult$1$1.invoke$lambda$0(ActivityResultRegistry.kt:106)
    androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.kt:371)
    androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.kt:331)
    androidx.activity.ComponentActivity.onActivityResult(ComponentActivity.kt:786)
    androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:151)
    android.app.Activity.dispatchActivityResult(Activity.java:8756)
    android.app.ActivityThread.deliverResults(ActivityThread.java:5666)
    android.app.ActivityThread.handleSendResult(ActivityThread.java:5712)
    android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
    android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
    android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:2470)
    android.os.Handler.dispatchMessage(Handler.java:106)
    android.os.Looper.loopOnce(Looper.java:240)
    android.os.Looper.loop(Looper.java:351)
    android.app.ActivityThread.main(ActivityThread.java:8423)
    java.lang.reflect.Method.invoke(Method.java:0)
    com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Caused by: java.lang.IllegalAccessException: java.lang.Class<io.paperdb.PaperTable> is not accessible from java.lang.Class<com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy$2>
    java.lang.reflect.Constructor.newInstance0(Constructor.java:0)
    java.lang.reflect.Constructor.newInstance(Constructor.java:343)
    com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy$2.newInstance(Kryo.java:1298)
    com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1139)
    com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:0)
    com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:538)
    com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:712)
    io.paperdb.DbStoragePlainFile.readContent(DbStoragePlainFile.java:332)
    io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:316)
    io.paperdb.DbStoragePlainFile.select(DbStoragePlainFile.java:166)
    io.paperdb.Book.read(Book.java:73)
    com.mazenrashed.printooth.data.PairedPrinter$Companion.getPairedPrinter(PairedPrinter.kt:14)
    com.mazenrashed.printooth.Printooth.hasPairedPrinter(Printooth.java:58)
    core.utils.PrintManager_androidKt.rememberPrinterManager$lambda$7(PrintManager_android.kt:152)
    androidx.activity.compose.ActivityResultRegistryKt$rememberLauncherForActivityResult$1$1.invoke$lambda$0(ActivityResultRegistry.kt:106)
    androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.kt:371)
    androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.kt:331)
    androidx.activity.ComponentActivity.onActivityResult(ComponentActivity.kt:786)
    androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:151)
    android.app.Activity.dispatchActivityResult(Activity.java:8756)
    android.app.ActivityThread.deliverResults(ActivityThread.java:5666)
    android.app.ActivityThread.handleSendResult(ActivityThread.java:5712)
    android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
    android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
    android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:2470)
    android.os.Handler.dispatchMessage(Handler.java:106)
    android.os.Looper.loopOnce(Looper.java:240)
    android.os.Looper.loop(Looper.java:351)
    android.app.ActivityThread.main(ActivityThread.java:8423)
    java.lang.reflect.Method.invoke(Method.java:0)
    com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant