Android build fails if build process includes 'install' step



  • Hi. I'm using Qt 5.1 with QtCreator 2.8, trying to deploy a trivial 'helloworld' application on my Android device. After setting up my project according to

    http://doc-snapshot.qt-project.org/qt5-stable/qtdoc/android-support.html
    http://qt-project.org/doc/qtcreator-2.8/creator-developing-android.html

    And hitting build I get an error during the build process. The issue goes away if I remove or disable one of the Build Steps I added in my project: a make install. To clarify, when you set up a project you normally have two steps automatically added for building: qmake and make. I added another make step that calls "make install" and its this step that fails with the Android build.

    All make install does is copy a few files to the build directory. This works fine on my desktop.

    Why can't I use a make install build step? Is this a bug?



  • You can give more information.

    This using linux or windows?
    You have the build log?
    You are trying to compile a project with Qtquick or QWidget?



    • Arch Linux
    • QtQuick with a simple qml file shown in QQuickView

    Here's the relevant part of the build log. I pastebinned the full thing here (http://pastebin.com/raw.php?i=5JE5QK2x)

    @
    22:21:29: The process "/usr/bin/make" exited normally.
    22:21:29: Starting: "/usr/bin/make" install
    mkdir: cannot create directory '/libs': Permission denied
    make: *** [install_target] Error 1
    22:21:29: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project qquick_helloworld_embedded (kit: Android for arm (GCC 4.7, Qt 5.1.1))
    When executing step 'Make'
    22:21:29: Elapsed time: 00:01.@


  • Lifetime Qt Champion

    Hi,

    if I am reading the error right you are trying to put something in /libs which would be in your root directory and you can't write there.



  • I didn't explicitly tell QtCreator to install anything in '/libs'. The Android kit is doing something or defaulting to something which results in that error. Like I said earlier, the same build process works with the default desktop kit (it even works with the blackberry kit).



  • I don't know if you found a solution but I ran into the same problem and here is how I did to fix it.

    Here is my .pro :
    @ TEMPLATE = lib
    CONFIG += qt plugin
    QT += quick

    #include development files
    include (DeveloperAPIFiles/DevelopmentFiles.pri)

    TARGET = xbmc_plugin
    DESTDIR = xbmc_plugin_Library
    DESTDIRQML = qml_folder

    HEADERS +=
    XBMCPlugin.h
    IWebRequestDispatcher.h
    PlayableItemModel.h

    SOURCES +=
    XBMCPlugin.cpp
    PlayableItemModel.cpp

    OTHER_FILES +=
    XBMCPlugin.qml
    Menu.qml
    RemoteItem.qml
    AudioLibrary.qml
    Home.qml
    MoviesLibrary.qml
    ShowsLibrary.qml
    music.png
    movies.png
    remote.png
    shows.png
    empty_cd.png
    cdbox.png
    dvdbox.png
    smoke.png
    small_play.png
    shadow_separator_h.png
    JoystickControl.png
    ArtistLibrary.qml
    AlbumsLibrary.qml
    SongsLibrary.qml
    LibraryGridViewDelegate.qml
    MoviesGridView.qml
    MovieDetailView.qml
    player_play.png
    player_pause.png
    player_stop.png
    player_forward.png
    player_backward.png
    player_fforward.png
    player_fbackward.png
    AlbumDetailView.qml
    ArtistAlbumsView.qml
    PlaylistDelegate.qml
    simple_arrow.png
    ArrowButton.qml
    PlayerControls.qml
    RemoteControls.qml

    INCLUDEPATH += $$PWD

    include (./Audio/Audio.pri)
    include (./Video/Video.pri)
    include (./Player/Player.pri)
    include (./Remote/Remote.pri)

    deploy qml files to correct dir

    qml_folder.files = $$OTHER_FILES
    qml_folder.path = $$DESTDIR
    @

    And I would normally build my project by running qmake, make and then make install.

    However when building for Android it seems that make install runs an extra step that copies your TARGET to $(INSTALL_ROOT)/libs/armeabi-v7a/
    where INSTALL_ROOT has to be provided otherwise it uses nothing hence the /libs error.

    I found two ways to solve the problem. You can either call your make install and specify the INSTALL_ROOT argument like that :
    make INSTALL_ROOT="/home/lemire_p/work/tepee3d/android" install
    or in my case just run make install_qml_folder which still moves my TARGET and resources to the path specified by DESTDIR.

    In any case, I hope this might help you.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.