Starting pains with Necessitas on Windows 7


  • Moderators

    Finally I am trying to start with Necessitas and got stuck with my first "hello world" program already.

    I have installed Necessitas on Windows 7 with Qt creator 2.5. I followed the steps on the "Wiki article.":http://qt-project.org/wiki/How_to_use_Necessitas_Emulator_on_Windows_7

    here are the few lines of my test program:
    @
    #include <QtCore/QCoreApplication>
    #include <qDebug>

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);

    qDebug() << "hello world" << endl;
    
    return a.exec&#40;&#41;;
    

    }
    @

    It builds ok, but trying to run following error message will appear:
    @
    Packaging Error: Command 'C:/Program Files (x86)/WinAnt/bin/ant.bat clean debug' failed.Exit code: 1
    Error while building project test1 (target: Android)
    When executing build step 'Packaging for Android'
    @
    My guess is that it is trying to deploy on the device which is not connected. However, I like to start out with deploying on the simulator, but I do not find a place in Qt creator where to select.

    Any hints?


  • Moderators

    You should use QtCreator bundled with Necessitas SDK. Other than that - I'm using Linux only, so I can't help much more.


  • Moderators

    [quote author="sierdzio" date="1342101941"]You should use QtCreator bundled with Necessitas SDK. Other than that - I'm using Linux only, so I can't help much more.[/quote]
    Thanks for feedback.

    I have done both with the same result.



  • Hmm I wasn't even aware you could deploy with Necessitas on a non-Linux host.


  • Moderators

    Hi Koahnig,

    I wrote that wiki page about a year ago because there were no installation instructions for windows at that time.
    Things have changed since then. The maintainers have made "this installation page":http://community.kde.org/Necessitas/InstallSDK

    I'm planning to test necessitas out again in the near future.

    I've changed the wiki page and added a remark : the installation instructions are obsolete now.

    Good luck,

    Eddy


  • Moderators

    Hi Eddy

    thanks for reply. Actually your wiki page was a good guidance. The only major difference was that some part are now already in the necessitas bundle included. However, it did not make any difference.

    I had found the installation page a little later. Actually the scheme is not too different.

    However, there is one thing mentioned there. The paths should have no spaces. Even though, the picture above shows a space in "Open JDK folder". I have made an installation with no spaces in all java related folders, but that seems to have messed up more.

    Another options I have tried is the installation under Ubuntu Linux on VirtualBox. However, there seem to be many emulators in the way now. It is awful slow (and it does not run either ;-( )


  • Moderators

    Thanks for the feedback, Koahnig

    I'll keep that in mind when i try to install the latest version. But i don't see a picture above, can you tell me which image you are pointing to?

    If I succeed I will adapt the wiki again.

    Maybe I can give it a try this weekend


  • Moderators

    Sorry, was a bit imprecise ;-)

    On the installation page there is a section for "common problems and issues (Windows)":http://community.kde.org/Necessitas/InstallSDK#Common_problems_and_issues_.28Windows.29 I meant the screenshot above this section. There is the "Open JDK location" and it points to something on "c:/Program Files/Java/...". There is certainly at least one space. So the comment below in problems and issues may be a bit misleading.

    Looking forward hearing from you on your success. May be you can give me then a hint where I am failing.


  • Moderators

    Thanks, Koahnig,

    I will keep that in mind and install the jdk on the C:/ drive to avoid it. It seems to me at first glance this is the only one we have to choose ourselves.

    I'll be back ;-)


  • Moderators

    Hi Koahnig,

    I finally got necessitas working.

    I had the same issues you described, so hopefully I can help you out, if you're still interested ;-)

    firstly i installed the jdk using jdk-7u5-windows-x64.exe in C:\Program Files\Java\ (with a space!)
    then i installed necessitas in C:\necessitas.

    then i tested the AVD manager installed by necessitas, but that didn't work out. so i googled the android web pages and found some solutions. I had to set some environment variables on my own. Here they are :
    User variables
    ANT_HOME : Points to the folder containing: /bin/ant.bat
    C:\necessitas\apache-ant-1.8.2

    JAVA_HOME
    C:\Program Files\Java\jdk1.7.0_05

    PATH
    C:\necessitas\android-sdk\platform-tools;C:\necessitas\android-sdk\tools; C:\necessitas\QtCreator\bin;C:\QtSDK\mingw\bin;C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin;
    C:\Program Files\Java\jdk1.7.0_05\bin\java.exe;
    C:\Program Files\Java\jdk1.7.0_05\bin;C:\necessitas\apache-ant-1.8.2\bin

    ANDROID_SDK_HOME set it to the same location as your HOME environment variable
    In my case it is C:\Users\eddy

    then I followed the same steps as the wiki page and my hello world app is running both on the emulator and on an android device. I tried a QML test app, but sometimes it succeeds and sometimes not. I'll have to dig some more there...

    I hope this helps, if you have some more specific questions, I will be glad to be of your assistance.
    I'm going to adapt the wiki page to reflect the new changes and let the maintainers know about my findings.

    Cheers,

    Eddy


  • Moderators

    Thanks Eddy for your summary.

    I will give it another shot. At the moment I had to push it back for other priorities, but I am still interested. Certainly I have to make fresh start. Something has been messed up completely.

    I'll keep you posted.

    Cheers,

    koahnig


  • Moderators

    you're welcome

    Eddy



  • Eddy,
    i need your help! I am new to qt.
    When i run the application it give me following error.
    :-1: error: Packaging Error: Command 'E:/necessitas/apache-ant-1.8.4/bin/ant.bat clean debug' failed.Exit code: 1

    I'll be very thankful to you if you can help me.


  • Moderators

    [quote author="qtandroid" date="1391581516"]Eddy,
    i need your help! I am new to qt.
    When i run the application it give me following error.
    :-1: error: Packaging Error: Command 'E:/necessitas/apache-ant-1.8.4/bin/ant.bat clean debug' failed.Exit code: 1

    I'll be very thankful to you if you can help me.
    [/quote]

    In Qt 5.2, android port is fully integrated, you do not need to install Necessitas anymore. I suggest upgrading.



  • Thanks sierdzio!
    I'll try Qt 5.2



  • Still same error :(


Log in to reply
 

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