cesarvr / pdf-generator

Cordova plugin to generate pdf in the client-side
MIT License
107 stars 61 forks source link

Android 4.1.2, API 16 java.lang.NoClassDefFoundError: android.print.PrintManager #69

Closed MEELB777 closed 6 years ago

MEELB777 commented 6 years ago

H, thanks for the plugin.

The plugin works on many devices, but I have a special case:

Cordova: 7.1.0 Platform: android 7.0.0 Pugin version: cordova-pdf-generator 2.0.0 Android minSdkVersion="16" Device version: Android 4.1.2, API 16

Error debugging on device:

E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: android.print.PrintManager at com.pdf.generator.PDFGenerator$1.run(PDFGenerator.java:79) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4935) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) at dalvik.system.NativeStart.main(Native Method)

Does this plugin supports minSdkVersion="16", if not, which is the minSdkVersion that the plugin supports.

Thanks

cesarvr commented 6 years ago

Sorry about that , the plugin should work with >=API 21. Right now the lowest version of that PDFPrinter class is in API 19 but is having some stability problems, so with API 21 should be fine.

Cheers.

MEELB777 commented 6 years ago

Thanks for the info.

I used device.platform and device.version of the cordova-plugin-device to control that, so only devices with Android >= API 21 call the plugin, and in the others cases show an alert.

Thanks