From 10:00 CET Friday 22nd November we will adjust how the server works to deal with some recently reported problems. Therefore there may be a load problem, if you experience more problems than usual trying to access the forum then please PM AndyS or any of the moderators so they can inform me.


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



  • 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.



  • @sftpck any success?



  • 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 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 ?



  • 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.


Log in to reply