Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved androiddeployqt ‘sh\r’: No such file or directory

    Installation and Deployment
    3
    5
    3047
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sftpck last edited by

      I'm trying to deploy my application to android but the command androiddeployqt stops with error:
      /usr/bin/env: ‘sh\r’: No such file or directory

      Qt: 5.11.1
      Gcc 4.9
      jdk: java-1.8.0-openjdk-amd64
      sdk: 25.2.5
      ndk: 16.1.4479499

      With verbose mode I get:

      ...
        -- Copied /media/dev/Android_for_x86_GCC_4_9_Qt_5_11_1_for_Android_x86-Release/android-build/res/values/libs.xml
      /usr/bin/env: ‘sh\r’: No such file or directory
      Stripping libraries to minimize size.
      Updating Android package files with project settings.
        -- res/values/libs.xml
        -- AndroidManifest.xml 
      Pregenerating entry list for assets file engine.
      Building the android package failed!
      16:10:46: The process "/opt/Qt/5.11.1/android_x86/bin/androiddeployqt" exited with code 14.
      

      If I use ant instead of gradle, the deploy succeed.

      Already tried with jdk 1.9, same error. (Couldn't build with ant, but error was different)

      It appear that the error is related to some encoding, but I couldn't find any script using command sh.

      Thanks.

      S 1 Reply Last reply Reply Quote 1
      • S
        seyed @sftpck last edited by

        @sftpck any success?

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Stadelmann last edited by

          I found some windows encoded files in the android directory with CR/LF. After converting them to unix (use dos2unix) the build succeed.

          S 1 Reply Last reply Reply Quote 2
          • S
            sftpck @Sebastian Stadelmann last edited by

            @Sebastian-Stadelmann said in androiddeployqt ‘sh\r’: No such file or directory:

            I found some windows encoded files in the android directory with CR/LF. After converting them to unix (use dos2unix) the build succeed.

            @Sebastian-Stadelmann Can you specify which android folder you mention and the files you change the encoding ?

            1 Reply Last reply Reply Quote 0
            • S
              sftpck last edited by

              The problem is solved.

              When I created a template in Projects -> Build Settings -> Build Android APK -> Create Template it was created in Windows environment. This template generated a folder (my ANDROID_PACKAGE_SOURCE_DIR) with AndroidManifest.xml, gradle files, libs and resources.
              In these folder the file named gradlew had the "End of line" as Windows Format, I changed it for UNIX / OS X Format and voila, the deploy succeeds.

              1 Reply Last reply Reply Quote 2
              • First post
                Last post