Can't print: "invalid argument"
Hey,
I am using CUPS Printing 1.4.0 on Android 7.1 (Lineage) with a Canon MB2000.
It detects the printer in the settings just fine, but when I switch to an app and try to print, I get a Toast saying "invalid argument" (see screenshots).


I tried to logcat and filtered for lines containing "CUPS":
11-01 15:48:02.230 14235 15074 V CUPS : No answer in mDNS response: java.net.DatagramPacket@88c7a75
11-01 15:48:02.750 14235 15074 D CUPS : process: qualified name: Canon MB2000 series._ipp._tcp.local.
11-01 15:48:02.757 14235 15074 D CUPS : A new printer responded to an mDNS query: Canon MB2000 series (http on [fe80::fa0d:60ff:fe34:b92b])
11-01 15:48:03.793 14235 15074 V CUPS : No answer in mDNS response: java.net.DatagramPacket@c9dfa0a
11-01 15:48:04.849 14235 14235 D CUPS : onPrintersDiscovered({http://[fe80::fa0d:60ff:fe34:b92b]:631/printers/print=Canon MB2000 series})
11-01 15:48:07.972 14235 14980 V CUPS : No answer in mDNS response: java.net.DatagramPacket@765a898
11-01 15:48:08.252 14235 14980 D CUPS : process: qualified name: Canon MB2000 series._ipp._tcp.local.
11-01 15:48:08.312 14235 14980 D CUPS : A new printer responded to an mDNS query: Canon MB2000 series (http on [fe80::fa0d:60ff:fe34:b92b])
11-01 15:48:08.958 14235 14235 D CUPS : onStartPrinterStateTracking: PrinterId{serviceName=io.github.benoitduffez.cupsprint/io.github.benoitduffez.cupsprint.printservice.CupsService, localId=http://[fe80::fa0d:60ff:fe34:b92b]:631/printers/print}
11-01 15:48:09.376 14235 14980 V CUPS : No answer in mDNS response: java.net.DatagramPacket@d3748f1
11-01 15:48:10.440 14235 14235 D CUPS : onPrintersDiscovered({http://[fe80::fa0d:60ff:fe34:b92b]:631/printers/print=Canon MB2000 series})
11-01 15:48:10.461 14235 14980 I CUPS : Checking printer status: PrinterId{serviceName=io.github.benoitduffez.cupsprint/io.github.benoitduffez.cupsprint.printservice.CupsService, localId=http://[fe80::fa0d:60ff:fe34:b92b]:631/printers/print}
11-01 15:48:10.502 14235 14235 V CUPS : HTTP response code: 0
I can print on this printer using my GNU/Linux computer just fine.
OK thanks for the detailed report. I will try to have a look at it when I have some free time.
I see you use Lineage, can you try with another device running stock Android?
Can you reproduce this on a stock Android device?
Sorry, I don't have one at hand. I do have one running CyanogenMod though, if that is any help?
I'm not sure no. I see this uses a fe80 IPv6 address, does this work from your laptop or any computer on the network (different from the CUPS server)?
Are you sure the CUPS server is well configured and works properly for all the devices on your network?
There is more logging in the recent versions. If you have the Play Store, can you please try the beta that will be released tomorrow? If no, can you build an apk of the last commit of develop?
Either way, please reproduce the issue and send the logcat logs. Thanks
Hello I have the same error as mentionned above by @Lesik and I've got the same logcat plus these two lines :
11-04 17:30:31.853 4796 4796 E CUPS : Couldn't start printer state tracking
11-04 17:30:31.853 4796 4796 E CUPS : Invalid argument
Hope it can help resolve...
I'm using /e/ Rom and CUPS v1.4.0 on HP ENVY printer. No problem to print with my computers.
Is it still reproduced on 1.5.0?
Unfortunately, I don't currently have the printer at hand. Feel free the temporarily close the issue, I will reopen it once I'm able to reproduce.
I've compiled 1.5.0 master with android studio installed, and build debug apk. I managed to have an apk with command line. I 've tested it on phone but it doesn't discovered printers where 1.4.0 from f-droid does... If you can release a 1.5.0 version to f-droid i'll test it. I don't know if my compilation/build is ok.