Skip to content

Build for Android failed: "can't concat str to bytes" #17572

@alexcohn

Description

@alexcohn
System information (version)
  • OpenCV => 4.3 (master)
  • Operating System / Platform => Windows 10 64bit
  • Compiler => Python 3.6.6
Detailed description

While checking the system configuration, python displays an error:

Check dir <whatever>\opencv-build\OpenCV-android-sdk\sdk\java\javadoc (create: True, clean: True)
Executing: ['cmake', '--version']
Failed: [WinError 2] The system cannot find the file specified
Executing: ['<whatever>\\Android\\Sdk\\cmake\\3.10.2.4988404\\bin\\cmake', '--version']
Failed: can't concat str to bytes

Steps to reproduce

python ../opencv/platforms/android/build_sdk.py --build_doc --extra_modules_path ../opencv_contrib/modules . ../opencv

Proposed fix
Index: platforms/android/build_sdk.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- platforms/android/build_sdk.py	(revision 9ba5581d176baf7c8fceb12b4dcef6c49c7a087d)
+++ platforms/android/build_sdk.py	(date 1592410122872)
@@ -59,6 +59,7 @@
     try:
         log.debug("Executing: %s" % cmd)
         result = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+        result = str(result)
         log.debug("Result: %s" % (result+'\n').split('\n')[0])
         return True
     except Exception as e:
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions