1

I am running openSUSE 12.2 64-bit trying to compile an app in Necessitas alpha 4.1. It's a basic app and the code is likely not the issue. Through the course of tracing the issue I made sure to have all dependencies and tools.jar, which can apparently cause similar errors. When compiling I get:

Packaging Error: Command '/usr/bin/ant clean debug' failed.Exit code: 1
File not found:

No file is actually listed. I copy/pasted this line from Projects->Build Steps->qmake:

/home/mark/Software/necessitas/Android/Qt/482/armeabi-v7a/bin/qmake /home/mark/Dev/qt/myProject/myProject.pro -r -spec android-g++ CONFIG+=debug CONFIG+=declarative_debug

Then I pasted in a terminal window and the result is:

sh: /home/mark/necessitas/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: No such file or directory

This is obviously incorrect as my path is ~/Software/necessitas not ~/necessitas. I have checked through every tab of Tools->Options but see nowhere that references the incorrect folder. Any clue where this is supposed to go?

Phil Hannent
  • 12,047
  • 17
  • 71
  • 118
MaKR
  • 1,882
  • 2
  • 17
  • 29

2 Answers2

2

I had this exact error last night. However I noticed that the Google documentation specifically said java-6-openjdk. So I installed the older JDK using synaptic and then ran:

sudo update-alternatives --config java

I selected the version 6 and re-ran the process. Which completed successfully.

(To be fair I was using Qt 5.1 beta 1 and freshly downloaded NDK and SDK's, ant was 1.8.1 from the repositories)

Phil Hannent
  • 12,047
  • 17
  • 71
  • 118
  • Thanks for the answer. I haven't been using Qt as much anymore, been doing mostly PHP or occasionally work in Eclipse. I do have 1 project that won't be easy to port so I'll still need to get it going when I want to work on that project, but now I'm thinking this question is mostly obsoleted due to Qt's new release. If I find a solution I'll edit the OP. – MaKR Jun 06 '13 at 22:20
1

Were you able to resolve your problem in the mean time ?

This has to do with the Java environment variables, more precisely with JAVA_HOME. Did you install OpenJDK right before you tried to launch your app ? I am not certain where OpenJDK installs in OpenSUSE, but on my ArchLinux the variable had to be set to :

JAVA_HOME=/usr/lib/jvm/java-7-openjdk

in order for QtCreator to compile the project properly.

In my case, I had Oracle's JDK installed, so right after installing OpenJDK, loging out and reloging updated my environment variables as wished.

There is also a similar post to yours: How to build my HelloWorld Android application with Necessitas (qt port)?

And you'll find a good necessitas starter video here : http://youtu.be/suPeZ7XC1xk

Community
  • 1
  • 1
Danyright
  • 396
  • 3
  • 11
  • I still haven't figured this out. I ended up using Eclipse for that project instead. My .bash_profile is: export JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/jre export PATH=$PATH:/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/jre/bin openSUSE does some weird things with symlinks in Java. I'll test 32-bit paths when I get a chance to look again, and I think the /jre directory is right, but I'll double-check that too. Thanks – MaKR Feb 06 '13 at 18:02
  • Here are the java paths I have on my Archlinux (64bits) desktop. Obviously, my JAVA_HOME points to the whole openjdk jvm folder, not just the jre. `printenv | grep java; JAVA_HOME=/usr/lib/jvm/java-7-openjdk; J2SDKDIR=/usr/lib/jvm/java-7-openjdk; J2REDIR=/usr/lib/jvm/java-7-openjdk/jre;` – Danyright Feb 11 '13 at 16:34
  • I tried changing the build paths and with how long it's been I've forgotten exactly how to duplicate this, but it still doesn't compile. I now have exit code 2 instead of 1. Also my qmake somehow decided to use standard qmake path instead of necessitas qmake, so I symlinked my default mkspec directory to necessitas mkspec. This put me back to /home/mark/necessitas/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: No such file or directory. My problem stems from /necessitas being inside of ~/Software and not in the root of ~/ – MaKR Feb 12 '13 at 21:18
  • Well, you need a Qt Version pointing to Necessitas' qmake (no matter where it is). Check in Qt Creator's `Options > Build & Run > Qt Versions`, if have it configured correctly. If not, add a new one, pointing to **qmake** (`.../Necessitas/necessitas/Android/Qt/482/armeabi-v7a/bin/qmake`). Meanwhile, I use Qt Creator 2.7 RC which includes Android functionalities (but not the Necessitas builds, which must then be linked). – Danyright Mar 20 '13 at 15:57