Im trying to generate ant buildfiles.But Im receiving a error
"The build class path order of the source directories of project library is not correct. Exported Ant buildfile will not compile your sources correctly until you swap the order of these directories:
gen<->src"
Im building from eclipse using file->export->Ant-buildfile
When im trying to build from command-line i recieve:
$ ant debug
Buildfile: /build.xml
BUILD FAILED
Target "debug" does not exist in the project "com.Grupp01.gymapp.MainActivity".
Screen capture of error and eclipse:
I had the same probem. Solving was: right click on library ->Properties ->Java Build Path -> Order and Export. Entry "gen" must be upper then "src" (use buttons up, down).
I have dolved this using this steps.
Right Click on your project -> Properties -> Java Build Path-> "gen" should be upper than "src". So, re arrage the folders. It worked for me.
Related
I imported an Android project in eclipse ADT and it needs the Android NDK to work. I downloaded and configured the NDK in Window > Preferences and made a few configurations in the project properties from other stackoverflow sources but the project has build errors and is just NOT working....
**** Build of configuration Default for project GLTexture ****
\ndk-build all
Cannot run program "\ndk-build": Launching failed
Error: Program "/ndk-build" is not found in PATH
PATH=[C:/Program Files/Java/jre7/bin/client;C:/Program
Files/Java/jre7/bin;C:/ProgramFiles/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Users\Abbas\AppData\Roaming\npm;C:\IDEs\adt-bundle-windows-x86-20130219\adt-bundle-windows-x86-20130219\eclipse;]
**** Build Finished ****
Any help would be appreciated thanks!
This error means it can't find the ndk-build command, which is located in the top level folder of the NDK install. Double check the value you set in Window -> Preferences -> Android -> NDK. I have mine set to I:\ADT\android-ndk-r9 and in that folder is the ndk-build and ndk-build.cmd scripts used by eclipse. Note that this value is per workspace, so if you 've changed workspaces since you've set the ndk path you will need to re-enter it. Also, right click on your project, select properties, and under C/C++ Build your Build command should be exactly ndk-build with optional arguments.
Note that it is NOT required to have the NDK in your system path. I just confirmed this by removing it from my path (its needed in path if you build from command line), restarting eclipse and rebuilding the project. But note that you can run ndk-build from the command line in your project folder if the NDK is in your path.
I'm trying to build this project https://github.com/OnlyInAmerica/Osmdroid-Plus/wiki to a JAR but I can't. I followed the "Configuration" steps in there and alredy have the Tomcat ant command to build, but it says "build.xml does not exist!" and ant -v command doesn't work either or creating a build with eclipse. I export it as jar with eclipse but using that JAR gives me an error in my project "Conversion to Dalvik format failed with error 1".
have you try this? :
Right click on project -> export -> select under "java" -> select path -> finish
this step would create a jar file for your project.
to use the jar into another project:
Right click on your project -> Build Path -> Add external archive -> select the jar file
I am trying to run an OpenCV4Android in my eclipse. I am working on Linux(CentOS 6).
I have done everything mentioned in this link but I am still getting build errors. I have also set the NDK path in preferences hat is not mentioned in the tutorial and tried a lot more things. When I try to build the library project the console gives:
"Cannot run program "/ndk-build": Unknown reason
Error: Program "/ndk-build" is not found in PATH"
All the projects also have build errors and the src and gen folders in openCV4 Library is not created and the build path shows:
"Unable to get system library for the project"
When i try to change the project properties I get an error saying the page contains invalid values and I cannot change the android api version. Plz help. Have been trying to set this up since 3 days now.
Thank you.
First Clean and Build you library Project alone and then try cleaning all your projects. In order to solve the "Cannot run program "/ndk-build": Unknown reason Error: Program "/ndk-build" is not found in PATH" error, Try the following steps:
Head to the project's properties. If you're using Windows, the shortcut is Alt + Enter; or simply right-click the project name to find its properties.
Go to the C/C++ Build section; under Builder Settings tab in Build command: text box you're likely to find something similar to that below, if it's empty then type in the similar text - namely: ${NDKROOT}/ndk-build.cmd where NDKROOT, as its name implies, refers to the path where your NDK root folder exists.
Now you must inform eclipse what NDKROOT equates to; as in, where is the NDK root path. You can do this by heading to (in your project's properties) C/C++ Build > Environment > press Add…
Now add your environment variable named NDKROOT (the Name) with the relevant path (Value). Note that you're to repeat this per NDK project. You would get a window similar to that below.
Press OK to the New variable input window and then OK again to the properties window.
Hopefully this will help!
I am adding admob external jar in my project and i am using andengine as a library project but when i try to export the project i get this error. Also adding andengine library project adds andengine.jar also in android dependencies. Is that suppose to happen?
I have tried almost all other answers on stackoverflow but nothing seems to work.
If anyone can help me pls?
Following is my project image
Just solved this problem. I updated my sdk to latest and that solved the problem!
Try exit eclipse, backup if you want, delete gen and bin folders. Start eclipse again, build then export.
This usually happens to me after either eclipse has been running for a long time or after I have build a signed apk successfully. To fix it I just restart eclipse.
In Eclipse, select the project causing the error- go to the menu project -> properties -> java build path -> libraries and remove all jars including the android jars.
Then, right click the project, go to android tools -> fix project properties. Then, add back any other external jars you wanted to add to the build path following the same menu project -> properties -> java build path -> libraries. To ensure there are no errors due to missing libraries.
Then, do a 'clean' on menu project and build again. It should work.
Android export wizards works, ant does not, difference?
MyProject
-> has AndroidProjectLibrary referenced
-> has AndroidProjectLibrary referenced (the option in eclipse that says add Project to the buidl path)
AndroidProjectLibrary (the option in eclipse that says add Project to the buidl path)
JavaLibrary
With eclpse: when using the export wizard of the ADT works fine.
But when using "ant debug" or "ant release" the classes of "JavaLibrary" are not found and the project can not be compiled. (I have the build.xml and the local and default properties set, run with android project update, etc)
If a copy the .class files from the bin folder from JavaLibrary to the bin folder from MyProject, then it can compile,o otherwise not.
My question is what the export wizard from android does differently than running "ant debug"?
And what is the solution for my problem?
Thanks.
Before using ant on an Android project you need to configure it.
use the following command from your project path (SDK/plateform-tools and SDK/tools must be on your $PATH):
android update project --path .
Then you will be able to do ant help/clean/compile/debug/release
Sometimes you will need to override default properties values from SDK/tools/ant/main_rules.xml, do that in a build.properties inside your project.