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

plugin crashes app when trying to print #94

Closed
tim1003 opened this issue Aug 2, 2016 · 0 comments
Closed

plugin crashes app when trying to print #94

tim1003 opened this issue Aug 2, 2016 · 0 comments

Comments

@tim1003
Copy link

tim1003 commented Aug 2, 2016

Using latest version of plugin (0.7.2), calling print crashes my app. I'm on Android 4.4 on a Samsung Galaxy Tab 8.

logcat:
08-02 08:16:40.843: E/AndroidRuntime(6261): java.lang.IllegalArgumentException: documentAdapter cannot be null
08-02 08:16:40.843: E/AndroidRuntime(6261): at android.print.PrintManager.print(PrintManager.java:382)
08-02 08:16:40.843: E/AndroidRuntime(6261): at de.appplant.cordova.plugin.printer.Printer$4.onPageFinished(Printer.java:281)
08-02 08:16:40.843: E/AndroidRuntime(6261): at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:449)
08-02 08:16:40.843: E/AndroidRuntime(6261): at com.android.org.chromium.android_webview.AwContentsClient$AwWebContentsObserver$1.run(AwContentsClient.java:73)
08-02 08:16:40.843: E/AndroidRuntime(6261): at android.os.Handler.handleCallback(Handler.java:733)
08-02 08:16:40.843: E/AndroidRuntime(6261): at android.os.Handler.dispatchMessage(Handler.java:95)
08-02 08:16:40.843: E/AndroidRuntime(6261): at android.os.Looper.loop(Looper.java:146)
08-02 08:16:40.843: E/AndroidRuntime(6261): at android.app.ActivityThread.main(ActivityThread.java:5602)
08-02 08:16:40.843: E/AndroidRuntime(6261): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 08:16:40.843: E/AndroidRuntime(6261): at java.lang.reflect.Method.invoke(Method.java:515)
08-02 08:16:40.843: E/AndroidRuntime(6261): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
08-02 08:16:40.843: E/AndroidRuntime(6261): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
08-02 08:16:40.843: E/AndroidRuntime(6261): at dalvik.system.NativeStart.main(Native Method)

my code:
cordova.plugins.printer.isAvailable(
function (isAvailable) {
cordova.plugins.printer.print("

Hi

",, '"doc.html", function () {
});
}
);

The isAvailable seems to work, the crash happenson the .print call.

Any advicde on this?

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

No branches or pull requests

2 participants