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?
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)
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
Related
I am building the first application in QT Creator, and came to the step I don't understand.
I have Mac, Android Studio is installed, Android SDK and NDK are installed using Studio. PATH to $ANDROID_NDK_ROOT is set manually.
My application compiles for Desktop without problems but trying to compile it for Android gives me this error:
/bin/sh: /Users/drob/Library/Android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-g++: No such file or directory
/bin/sh: /Users/drob/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
/bin/sh: /Users/drob/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
Project ERROR: Cannot run target compiler '/Users/drob/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++'. Output:
===================
/bin/sh: /Users/drob/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory
===================
Maybe you forgot to setup the environment?
Error while parsing file /Users/drob/OneDrive/DEVEL/PROJECTS/QT_Projects/btchat/btchat.pro. Giving up.
I found that I should do the following steps, but I am scared to completely crash the system:
1. Install G++ (but what is this and how to install it on Mac properly)
2. Create G++ toolchain using NDK script (unfortunately too complicated for me. Some guide will be welcome)
What I also found out is that normally QT for Mac uses Clang compiler from XCode that I also have got installed. Should I somehow make QT Creator use that compiler instead of G++?
Sorry for questions that might sound silly but I am really lost at that point
Using the trial and error method I found that it is practically impossible to make NDK r10e work with QT 5.9. I ended up installing latest NDK and latest QT (5.12.6)
I've read this: Cordova and setting Android using command line
and that How to add android to cordova platform? PATH error? and generally speaking whole documentation. I've added both 'platform-tool' and 'tool' paths, installed android 4.4 and I'm still getting the error from the tittle when I'm trying cordova platform add android to my current project ( in cmd and in netbeans ).
The only thing I haven't done is adding java and ant to path. I was trying with ;%JAVA_HOME%\bin;%ANT_HOME%\bin but still those commands aren't recognizable.
What else can I do?
EDIT:
I've added java and ant to PATH. This is what I get in cmd:
C:\xampp\htdocs\mobile_maps>cordova platform add android
[Error: The command `android` failed. Make sure you have the latest Android SDK
installed, and the `android` command (inside the tools/ folder) added to your pa
th. Output: ]
Second EDIT:
i also get 'xcopy' is not recognized as an internal or external command even though I've added %SystemRoot%\System32; %SystemRoot%; %SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0 . I really don't know what else I can do..
usually this happens when:
1. Java is not installed
2. Java is not exported (no JAVA_HOME env variable) or paths are wrong
3. only 64bit version of Java is installed
to fix install 32bit support on your system.
and (as comments below) relog in Windows to environment changes take effect.
After I installed Worklight 6.1 and the Android plug-in and SDK, I got the below exception when trying to build an app:
[2013-12-13 13:27:07] Starting build process: application 'WorklightTest', all environments
[2013-12-13 13:27:10] Failed importing native project for 'Android phones and tablets' Failed to read project description file from location
D:\Development\worklight_dev\WorklightTestApp\apps\WorklightTest\android\native.project.
[2013-12-13 13:27:10] A core eclipse exception has occurred: Failed to
read project description file from location
D:\Development\worklight_dev\WorklightTestApp\apps\WorklightTest\android\native.project.
Actually, I did it with worklight 6.0...
I had the exact same problem and on my Windows 7 Machine it was also a Java Install / Version problems as it seems.
I am an IBMer, so I had the IBM Java JRE and SDKs for version 7 installed. Also the Oracle JRE and JDK. Also both for 32bit and 64bit. The command line always referred to the IBM JDK.
Once I removed all the IBM JREs and JDKs and left only the two, Oracle JDK 7-21 in 32bit and 64bit, on my machine, the creation of the Android project was successful.
I had the same issue and got it resolved (under Ubuntu) by updating Java alternative to the same Java SDK (openjdk-7) that is required by Worklight; using:
sudo update-alternatives --config java
Also checked the SDK alternative points to the same:
sudo update-alternatives --config javac
I have ran across this issue many times haven't yet found a solid resolution. In my latest experience today, this combination of things worked for me consistently for 3 different occurrences on Windows 7
delete native folder in android environment
set -vm flag in eclipse.ini to use Oracle JRE
start eclipse with -clean flag
From: IBM Worklight 6.0 - Build issues
Try to:
Delete the native folder and build the project again
Create a new workspace for Eclipse
Run Eclipse with the -clean flag
I have installed a fresh copy (not upgraded) of Worklight 6.1, created new project+app+environment and the build passed successfully.
I suggest to try the above suggestions as they are ordered.
I just downloaded qt-creator 2.8 and tried deploying my current android project only to get the error: :-1: error: Packaging Error: Command '/usr/bin/ant clean debug' failed.Exit code: 1
I ran ant clean and ant clean debug manually and they worked fine. I also deployed the same project using qt-creator 2.7.1 successfully so I don't think its a java file issue but rather a Qt-creator related one. The same error reproduces regardless of the project, even with a qt hello world. I've tried deleting all of the build and android folders and rebuilding but that didn't work either.
Does anyone know why it wouldn't work?
My system is: 3.8.0-23-generic #34-Ubuntu SMP Wed May 29 20:22:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
This is caused from a missing or invalid OpenJDK location setting. To fix it, go to the Tools -> Options dialog. Select the Android filter from the left-hand side of the dialog. Then in the OpenJDK location entry field, ensure you have a complete path to an installed OpenJDK. If you don't have the OpenJDK installed, then Ant will fail. My path that I set in that field is /usr/lib/jvm/java-6-openjdk-amd64.
this time with a droid related question.
Im running Eclipse Helios and Mac OS X 10.6.8
I have been following a book and a few tutorials on building the NDK from both command line and Eclipse.
I am copying the source over there is no static library business. I can compile from the command line fine with the "ndk-build" executable and it works fine.
Though i need to compile inside Eclipse for the reasons i don't need to go into here.
Ive tried 2 techniques and the one i have seen working is to convert my Project to a c++ project and then in Project / Properties / c/c++ Build tab / Build Command i set to ndk-build , this is set to be visible in my path (hence why it compiles when i go to directory and use ndk-build from Terminal)
I then in the C/C++ General tab add the following locations as include directories :
/Users/Me/Code/Android/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/include
/Users/me/Code/Android/android-ndk-r7b/platforms/android-9/arch-arm/usr/include
/Users/me/Code/Android/android-ndk-r7b/sources/android/native_app_glue
Then when i go to compile i don't get any out put i just get the following error:
Invoking autoreconf in build directory: /Users/me/Code/Android/DroidBlaster
sh -c autoreconf -i
autoreconf: `configure.ac' or `configure.in' is required
Configuration failed with error
Ive tried a few other tutorials but to no avail, if i could award a bounty on this is would as its urgent i get this fixed.
Cheers community :)
NOTE:
Ive worked out that it is using auto tools to build the project where this is incorrect as i should be building with the NDK , getting closer to an answer hopefully. Seems that i cant convert my Android project with CDT to a custom build configuration, might be a bug to do with Eclipse, trying a fresh install
Ok so i worked it out, it was because i was trying to compile using Auto tools when i should have set up the project when i should have been using "Convert to C/C++ project" didn't help though that eclipse installed CDT incorrectly and i had to reinstall to get the right plugins.