Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. androiddeployqt ‘sh\r’: No such file or directory

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

Scheduled Pinned Locked Moved Solved Installation and Deployment
5 Posts 3 Posters 3.8k Views
  • 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 Offline
    S Offline
    sftpck
    wrote on last edited by
    #1

    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
    1
    • S sftpck

      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 Offline
      S Offline
      seyed
      wrote on last edited by
      #2

      @sftpck any success?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sebastian Stadelmann
        wrote on last edited by
        #3

        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
        2
        • S Sebastian Stadelmann

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

          S Offline
          S Offline
          sftpck
          wrote on last edited by
          #4

          @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
          0
          • S Offline
            S Offline
            sftpck
            wrote on last edited by
            #5

            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
            2

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved