Following the line numbers to the source code is the best you can hope for with custom/uninformative exceptions like this. In this case, the exception is raised if some stdout doesn’t match a certain pattern <https://github.com/trevorwang/aapt/blob/b6aca60a82661cd0200f050d205e3721d6cd8ac7/src/aapt2/aapt.py#L82-L86>. That stdout comes from dump() <https://github.com/trevorwang/aapt/blob/b6aca60a82661cd0200f050d205e3721d6cd8ac7/src/aapt2/aapt.py#L52-L53C12> which calls aapt <https://github.com/trevorwang/aapt/blob/b6aca60a82661cd0200f050d205e3721d6cd8ac7/src/aapt2/aapt.py#L25> which invokes an aapt2\bin\Windows\aapt2.exe <https://github.com/trevorwang/aapt/blob/b6aca60a82661cd0200f050d205e3721d6cd8ac7/src/aapt2/aapt.py#L33-L36> executable but using the rather evil subprocess.getoutput() <https://github.com/trevorwang/aapt/blob/b6aca60a82661cd0200f050d205e3721d6cd8ac7/src/aapt2/aapt.py#L41> which has zero error handling. Without that error handling, the the aapt() function doesn’t even notice if aapt2.exe is missing and blindly returns the string Can't recognise '...\aapt2.exe ... as an internal or external command, or batch script..
So tl;dr, you’ll need to make sure that aapt2.exe gets into your application. i.e. Add --collect-datas=aapt2 to your build command. But I’d get away from this library if I were you. Not only does it have this lack of error handling but it also breaks if the path to your .apk file contains spaces. -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/3620ac3a-795f-4403-88c9-1b5c9f4e7f73n%40googlegroups.com.