Default Project Icon

necessitas

Home Wiki Tickets Git Downloads Ministro Necessitas Home Page

Setup QtCreator

qtcreator (3)
BogDan Vatra daminetreg
Attachments

After you finish to Install QtCreator or you finish to [Compile QtCreator] you have to set it up.

Requirements

  • Ant version: Please check your ant version before using Qt Creator, you should at least have ant 1.8.0. You can check with the ant -version command.
  • Java Development Kit: The optimal Java Development Kit for Necessitas is the OpenJDK. You can check with the java -version command if you have it, you can also install it if you don't have the OpenJDK with the sudo apt-get install openjdk-6-jdk command.

Configure Qt Creator

You will just need to set up the Qt in Path to the freshly installed Qt for Android Sdk, and to provide the android Sdk to use.

  • Previous step should have installed you Qt Creator for Android, you will find a shortcut on your desktop.
  • Run Qt Creator for Android and click on Tools > Options, then jump to the Qt4 tab. Just add the qmake path from the Qt For Android Sdk (/opt/necessitas/Android/<qtversion>/bin/qmake by default).
  • Give this Qt version a name (e.g. android-lighthouse-4.8.0).

Set Qt Path in Qt Creator Figure 1. Set Qt Path for Qt Creator to Qt Sdk for Android

Set Android Sdk, Ndk & Ant Path in Qt Creator Figure 2. Set Android Sdk, Ndk & Ant Path - With this view you can even manage the AVDs you created (AVD stands for Android Virtual Device)

  • Jump back to the Qt4 tab, select the version of Qt you added previously and build the gdb helpers, so that your debugging output will be clean and easily readable for Qt specific constructs.
  • Click Apply & Ok and you are done, you can start using the awesome Qt Sdk for Android.
  • You can now try: [How to write Qt apps for Android]

Related

Wiki: Compile QtCreator
Wiki: Debugging Qt apps for Android
Wiki: How to write Qt apps for Android
Wiki: Setup Android SDK
Wiki: Compile Qt framework
Wiki: How to install Necessitas SDK
Wiki: Home

  • Santeri Vesalainen
    Santeri Vesalainen
    2011-02-23

    (/opt/necessitas/Android//bin/qmake by default)
    --> /opt/Android/4.7.60/bin/qmake ? is 4.7.60 a running build id from qt?

     
    • daminetreg
      daminetreg
      2011-02-23

      Yes exactly, it's the version which will become Qt 4.8 in the future.
      I just fixed a mistake on the documentation, the sourceforge wiki didn't escaped well < > chars, thanks to you it's fixed.

       
  • amos
    amos
    2011-02-23

    I've gone through the various steps to setup QtCreator above but when I try to build the gdbhelpers I get the following errors (I clicked on build all) listed in the attachment.

    It looks like it's searching for the headers but not finding them.

    Any ideas?

     
    Attachments
  • amos
    amos
    2011-02-23

    That'll teach me to skim read the installation instructions. Can I get away with just moving the two installed folders into a necessitas folder?

    Edit: Never mind I've removed them, and am now reinstalling.

    Edit: Right that did it, is it right that Qml Dump and Qml Observer can't be compiled?

     
  • daminetreg
    daminetreg
    2011-02-23

        Can I get away with just moving the two installed folders into a necessitas folder?
    

    Yes this works normally :) Although I mean it's better that you reinstalled (because of the uninstaller, but I hope you'll never uninstall!)

        Right that did it, is it right that Qml Dump and Qml Observer can't be compiled?
    

    Yes it's the same for me, I don't know if BogDan get it, but I don't think so.

     

  • Anonymous
    2011-02-24

    Hello,

    Fistrly I have build android application using Eclipse ADT and ant 1.7. After installing necessitas Qt Creator I changed ant to 1.8, and build Qt C++ project normally, but have problem when deploying.
    It tries to create a java package but I get errors when compiling .java files, probably it's problem with CLASSPATH:
    The process "/usr/bin/make" exited normally.
    Copy Qt app & libs to Android package ...
    Stripping libraries, please wait
    Creating package file ...
    Package Creation: Running command '/usr/bin/ant debug'
    Buildfile: /home/ayaz/prj/untitled/android/build.xml
    setup Android SDK Tools Revision 9
    setup Project Target: Android 1.6
    setup API level: 4
    setup
    setup ------------------
    setup Resolving library dependencies:
    setup No library dependencies.
    setup
    setup ------------------
    setup
    setup WARNING: No minSdkVersion value set. Application will install on all Android versions.
    setup
    setup Importing rules file: tools/ant/main_rules.xml

    -debug-obfuscation-check:

    -set-debug-mode:

    -compile-tested-if-test:

    -dirs:
    echo Creating output directories if needed...

    -pre-build:

    -resource-src:
    echo Generating R.java / Manifest.java from the resources...

    -aidl:
    echo Compiling aidl files into Java classes...

    -pre-compile:

    compile:
    javac /home/ayaz/Desktop/android-sdk-linux_x86/tools/ant/main_rules.xml:361: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    javac Compiling 12 source files to /home/ayaz/prj/untitled/android/bin/classes
    javac /home/ayaz/prj/untitled/android/src/com/nokia/qt/android/QtActivity.java:17: cannot find symbol
    javac symbol : class ContactsContract
    javac location: package android.provider
    javac import android.provider.ContactsContract;
    javac ^

     

  • Anonymous
    2011-02-24

    On the step when I should build dbghelpers - QTCreator says : QT version is not properly installed, please run make install. What am I doing wrong? Please see screenshot in attachment. Thank you.

     
    Attachments
    • daminetreg
      daminetreg
      2011-03-02

      Did you install it in /opt/necessitas or in /opt/ directly ? Because it wasn't clear in the documentation when I wrote: /opt/necessitas by default, I wanted to point out that people should change it to /opt/necessitas and not let it on /opt/. I changed it.

       
    • Cocus Devices
      Cocus Devices
      2011-03-10

      I have the same strange thing. I ve installed in /opt/necessitas but still the same...

       
      • daminetreg
        daminetreg
        2011-03-10

        The problem comes from the jdk needed by the installer (by some steps of the install process) you have to take openjdk, it's less buggy than sun jdk: sudo apt-get install openjdk-6-jdk after that rerun the installer and it will works for sure. :)

         
        • yu jinyang
          yu jinyang
          2011-03-30

          i ve installed in /opt/necessitas and installed the OpenJDK ,the java path confige well.
          but still had the same problem. plesase help me .. i'll waiting online. thank u.

           
    • Johnny M.
      Johnny M.
      2011-05-09

      If you encounter a problem like "QT version is not properly installed, please run make install" aftre you've manually added qmake path (figure 1), you should do the following:
      sudo mkdir -p /data/data/eu.licentia.necessitas.ministro/files
      cd /data/data/eu.licentia.necessitas.ministro/files
      sudo ln -s /opt/necessitas/Android/<qtversion>/ qt

      Then restart Qt creator and repeat "Configure Qt Creator" step of this article.
      In my case it solved the problem.

       
      Last edit: Johnny M. 2011-05-09

  • Anonymous
    2011-02-24

    anonimus_coward@anonimus_box:/opt/necessitas/Android/4.7.60/bin$ ./qmake -v
    QMake version 2.01a
    Using Qt version 4.8.0 in /data/data/eu.licentia.necessitas.ministro/files/qt/lib
    Looks like something wrong with qmake.

     

  • Anonymous
    2011-02-25

    Hi, when I reinstall the necessitas, it also can't find the QT path? Where is the config file?
    I think when I uninstall it can't clear all the files,such as the shortcut of it.
    Because first my installed path is /opt, so it can't find the Qt path, second, after I reinstall it, it also can't find the QT path.

     
    Attachments
  • Gabriel
    Gabriel
    2011-02-26

    Hello,

    After having installed and configured the Necessitas Qt creator, when creating a new project, I got an error like this error :

    No Qt SDK for Android installed.
    Please install at least one SDK.

    So, I checked in the Tools > Options > Qt, and I had configured it like this :
    Qt Versions :
    + 4.8.0 -> /opt/necessitas/Android/4.7.60/bin/qmake

    The Tools > Options > Android tab also seems to be correctly configured :
    Android SDK Location : /media/Docs/Mes Téléchargements/android-sdk-linux_x86
    Android NDK location : /home/gabriel/android-ndk-r5b
    Android NDK toolchain version : arm-linux-androideabi-4.4.3
    Ant location : /usr/bin/ant

    Do you have an idea about what I did wrong ?

    Thanks a lot !

     
  • Gabriel
    Gabriel
    2011-02-26

    Excuse-me but I forgot to precise that I already had installed an android platform SDK.

    I ran the android tool. Then in the available packages, I checked several of SDK Platforms (each one verifying the minimum version requires). Then I clicked on the Install selected. After dowloading and installing, the selected elements has been moved into "Installed packages".

    But I still have the same problem...

    Sorry for my low level of english :(

     
  • BogDan Vatra
    BogDan Vatra
    2011-02-26

    I hope you didn't had QtCreator running when you've installed Android SDK Platforms. If yes, then you have to restart QtCreator.

     
  • Gabriel
    Gabriel
    2011-02-26

    I did all of those cases : installation of Android platform SDK with QtCreator running, without QtCreator. And I restarted QtCreator. I'm totally lost ! :(

     
  • Gabriel
    Gabriel
    2011-02-27

    I don't know what I did, but now it seems to work fine. Perhaps I didn't have enough place on my computer, since it functions since I have cleaned my disk.

     

  • Anonymous
    2011-02-28

    Maybe this document must mention that it require yum v1.8.0 or later. If not, one might wondering as the compiler give an error "Packaging Error: Command '/usr/bin/ant debug' failed.Exit code: 1"

     

Cancel   Add attachment