I have a ant target, xml file in my TFS project folder. the project folder is bound with TFS(Team Foundation Server). My problem is when ever i try to build the project by running the ant target in that TFS bound location it fails. it gives the following failure.
> ria_ant_build.xml:435: Error running C:\Program Files\Java\jdk1.6.0_20\bin\javac.exe compiler
at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.
java:508)
at org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.java:61)
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1153)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:930)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_20\bin\javac.exe": CreateProcess erro
r=87, The parameter is incorrect
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.
java:505)
... 19 more
Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 24 more
but when i copy the project to a different location and remove the read only attribute from the folder the ant target runs without any error and I'm getting a deploy-able artifact. but even when i remove the read only attribute from the TFS folder i could not build the ant target.It seems like the problem exist on the TFS location it self. :(
can some one suggest me a method to solve this problem. I have to stay in the TFS location you guys know the reason i assume :)
--
Thanks & Regards,
Rangana
From your question it's hard to figure out what really causes your problem.
Perhabs, your ant call length is too long and even longer than the max command prompt line (that's 8191 characters in the latest versions of Windows). As question Fail to launch application (CreateProcess error=87), can't use shorten classpath workaround says you may consider "to shorten folder names, reduce depth of folder trees, using parameter files, etc".
Try to run ant with the -debug option to see the specific command-line parameters of your build call inside the TFS workspace. In that way you can estimate the total length of the call.
Related
I want to run a Netbeans 7.3 platform application (let's name it app A) from another Java application (app B). To do this, in B's code I'm invoking the Ant library as follows:
Path pathA = ... // where the A's sources are
Path fileBuild = pathA.resolve("build.xml");
Project p = new Project();
p.setUserProperty("ant.file", fileBuild.toFile().getAbsolutePath());
p.init();
ProjectHelper helper = ProjectHelper.getProjectHelper();
p.addReference("ant.projectHelper", helper);
helper.parse(p, buildFile);
p.setDefault("run");
p.executeTarget(p.getDefaultTarget());
Unfortunately, the error I'm getting is:
C:\Program Files\NetBeans 7.3\harness\suite.xml:184: The following error occurred while executing this line:
C:\Program Files\NetBeans 7.3\harness\common.xml:217: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files (x86)\Java\jdk1.7.0_45\jre"
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:568)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:443)
at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:306)
at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:221)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
...
The JAVA_HOME variable is set correctly both as system path variable and in netbeans config file and points to C:\Program Files (x86)\Java\jdk1.7.0_45.
The question is, what am I missing? When running the app A from Netbeans menu, everything runs fine, so what should I append to the build file/ant settings to achieve A runs from B's code execution?
Thanks in advance!
Edit: I managed to get a more precise error stack, maybe this can help.
Error on test cases execution.
C:\Program Files\NetBeans 7.3\harness\common.xml:217: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files (x86)\Java\jdk1.7.0_45\jre"
at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:130)
at org.apache.tools.ant.taskdefs.Javac.findSupportedFileExtensions(Javac.java:984)
at org.apache.tools.ant.taskdefs.Javac.scanDir(Javac.java:961)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:932)
at org.netbeans.nbbuild.CustomJavac.execute(CustomJavac.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at odoetest.server.ServerInvokerAnt.start(ServerInvokerAnt.java:48)
at odoetest.EntryPoint.invokeTests(EntryPoint.java:58)
at odoetest.EntryPoint.main(EntryPoint.java:38)
Edit-2: I don't have any separate ant installation and use the ant delivered with Netbeans. When I run ant -diagnostics, I get this info. When I invoke the build or run job from the command line like
ant -f /path/to/build.xml run
no errors are thrown, the program starts. I just can't do the exact same thing from java code from above.
Your Ant build.xml will still be referring to a JRE rather than the JDK.
Right-click on your project, select Libraries, check that Java Platform points to a JDK rather than a JRE. See here for details.
If this fails:
You can explicitly set properties for Project p
as in manouti's answer above. This will ensure that Project p as well as Project A will be referring to a JDK rather than JRE. AFAIK, no need to fork.
You can set properties in your .properties file, though it is not always easy to debug whether this is being implemented for each project.
You can explicitly include folders/files on the classpath of your target using the <classpath> element - see the Apache Ant Manual for some not very clear documentation.
This would be:
<classpath>
<pathelement path="${path.to.jdk}"/>
</classpath>
See also this answer.
NetBeans has setting which java to use internally. It's part of the netbeans.conf file. You are able to set the Java version for every NetBeans project which might be different.
However your JAVA_HOME points to a JRE and not JDK. That's why it cannot find the compiler - javac.
The error is occurring when calling the Ant javac task. Try to locate the call to that task (it should be in common.xml at the line shown in the error message), and try adding fork="yes" to it so that it runs the JDK compiler in an external process. See http://ant.apache.org/manual/Tasks/javac.html:
<javac fork="yes" ...
Also try adding the following property in the project invocation:
Project p = new Project();
p.setUserProperty("ant.file", fileBuild.toFile().getAbsolutePath());
p.setProperty("java.home", "C:\\Program Files (x86)\\Java\\jdk1.7.0_45");
I am a d00b at modding and I'm using the Minecraft Mastery book.
when I try to run the unedited minecraft on eclipse, I get this first:
[07:09:48] [main/ERROR]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[07:09:52] [main/ERROR]: The minecraft jar file:/C:/Users/minecraft/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1147/forgeBin-1.7.2-10.12.2.1147.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
[07:09:52] [main/ERROR]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!
[07:09:52] [main/ERROR]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/minecraft/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1147/forgeBin-1.7.2-10.12.2.1147.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it
[07:09:52] [main/ERROR]: FML appears to be missing any signature data. This is not a good thing
then after 3 more lines of normal, I get this:
[07:09:55] [main/ERROR]: Unable to launch
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_71]
at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_71]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886) ~[?:1.7.0_71]
at java.lang.Runtime.loadLibrary0(Runtime.java:849) ~[?:1.7.0_71]
at java.lang.System.loadLibrary(System.java:1088) ~[?:1.7.0_71]
at org.lwjgl.Sys$1.run(Sys.java:73) ~[lwjgl-2.9.0.jar:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_71]
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.loadLibrary(Sys.java:95) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.Sys.<clinit>(Sys.java:112) ~[lwjgl-2.9.0.jar:?]
at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:2523) ~[Minecraft.class:?]
at net.minecraft.client.main.Main.main(SourceFile:36) ~[Main.class:?]
... 6 more
I have also added C:\Program Files\Java\jre7\bin; to the path variable witch now looks like this:
C:\Program Files\Java\jre7\bin;C:\ProgramData\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\PROGRAM FILES\NOKIA\PC CONNECTIVITY SOLUTION\;C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\WINDOWS LIVE;C:\Windows\SYSTEM32;C:\Windows;C:\Windows\SYSTEM32\WBEM;C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;C:\PROGRAM FILES\WINDOWS LIVE\SHARED;C:\PROGRAM FILES\IVI FOUNDATION\VISA\WINNT\BIN;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\VXIPNP\WinNT\Bin;C:\Users\Kieran (Admin)\AppData\Local\Smartbar\Application\;C:\Program Files\QuickTime\QTSystem\C:\Program Files\Java\jre8;C:\Program Files\QuickTime\QTSystem\
I've already tried downgrading java from 1.8 to 0.7, but it just changed the error slightly.
please help :)
You are missing native libraries required by lwjgl.
Extract libraries/org/lwjgl/lwjgl/lwjgl-platform/2.9.1/lwjgl-platform-2.9.1-natives-linux.jar to some directory in your project. The name might differ. It should have a bunch of .so or .dll files inside.
Left click on it -> "Build Path" -> "Configure Build Path..."
Expand "lwjgl-2.9.1.jar"
Select "Native library location: (None)"
Click "Edit" and set it to directory which you just created.
As the first log states:
The minecraft jar file:/C:/Users/minecraft/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1147/forgeBin-1.7.2-10.12.2.1147.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!
Did you try reinstalling Minecraft?
Looks like you need to add the lwjgl.jar to your classpath.
I have a weird bug that is popping up in my Ant build. The build works as such: build.xml calls a new buildTargets.xml file, and in that file most of the work is being done. buildTargets.xml creates a bunch of new files in gwt-out/htdocs/** and another directory staging/htdocs/**. Basically, files are being created in gwt-out/htdocs and then copied into staging/htdocs. The error is that only one file is not being copied, and I am getting a java.IO.FileNotFoundException (Access is denied) error. The weird part is that the file changes from build to build.
At first I thought it was an Eclipse problem so I built through the command line, and a new (a different file than eclipse) was not being put into staging/htdocs, which was yielded the same error. I've attached what Ant has said with the -debug flag. The error seems to pop up when the files are being tokenized in buildTargets.xml. After searching around it seems that the most common response was to fix my permissions-- however the file is being dynamically created, and when I go to check on that file all permissions are enabled (except "Special"), so I don't think that's the issue.
Other SO questions similar to mine all deal with building on a remote server and fixing my permissions to that server-- however this is all local to my computer, so I'm not sure that is the issue either. Could it be an error with the copying task in the Ant build?
Here's the error:
BUILD FAILED
C:\CSDK\build\buildTargets.xml:253: Failed to copy C:\Users\admin\worksp
ace\BuildPortal\out\gwt-out\htdocs\war\BuildPortalTest.iOS_Bu
ild_Portal\sc\modules\ISC_DataBinding.js to C:\Users\admin\workspace\BuildPortal
\out\staging\htdocs\war\BuildPortalTest.iOS_Build_Portal\sc\m
odules\ISC_DataBinding.js due to java.io.FileNotFoundException C:\Users\admin\wo
rkspace\BuildPortal\out\staging\htdocs\war\BuildPortalTest.iO
S_Build_Portal\sc\modules\ISC_DataBinding.js (Access is denied)
at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:907)
at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:563)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.FileNotFoundException: C:\Users\admin\workspace\BuildPortal\o
ut\staging\htdocs\war\BuildPortalTest.iOS_Build_Portal\sc\mod
ules\ISC_DataBinding.js (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
Thanks.
I ended up using the retry task, and that seemed to work based off of Isaac's description of what was possibly going wrong.
I install the plugin CHelper for InelliJ IDEA (for MacOSX) and it doesn't work fine. I have a problem to compile a task problem, you can see the log in below.
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: /src/test/A - Maze.task (No such file or directory)
at net.egork.chelper.tester.NewTester.test(NewTester.java:41)
at net.egork.chelper.tester.NewTester.main(NewTester.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.io.FileNotFoundException: /src/test/A - Maze.task (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
at net.egork.chelper.tester.NewTester.test(NewTester.java:39)
... 6 more
The Event Log : 20:12:53 Compilation completed successfully in 1 sec
My chelper.properties :
smartTesting=true
archiveDirectory=/src/archive
defaultDirectory=/src/test
extensionProposed=true
outputClass=java.io.PrintWriter
excludePackages=java.,javax.,com.sun.
outputDirectory=/src
author=
libraryMigrated=true
failOnIntegerOverflowForNewTasks=false
inputClass=java.util.Scanner
enableUnitTests=true
testDirectory=/src/test
Some Image to clarify my question/problem.
Can anyone help me to fix that issue in my config?
Thanks!
Check the output folder selected in your projects build path. Are these uncompiled files in your src folder in your build folder? I am betting they are not since most project builders will only copy over the compiled class files. If that is the case you will need to Google the Resource folder that Eclipse uses to copy them to instead.
I'm having issues with the IDE Processing.
I'm trying to compile something to Android. I'm on Android Mode, of course. But I'm getting this Error at the time of compiling. (It's not the code itself)
I've installed "adb devices", it seems Ok. I've done all the "51-android.rules" process. I've installed API 10(the one requested) and Android Tools. I don't really know what should be wrong.
-----------------
API<=15: Adding annotations.jar to the classpath.
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-code-gen:
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
Generating resource IDs...
BUILD FAILED
/home/user/adt-bundle-linux-x86_64-20130729/sdk/tools/ant/build.xml:649: The following error occurred while executing this line:
/home/user/adt-bundle-linux-x86_64-20130729/sdk/tools/ant/build.xml:690: Execute failed: java.io.IOException: Cannot run program "/home/user/adt-bundle-linux-x86_64-20130729/sdk/build-tools/18.0.1/aapt" (in directory "/tmp/android8933435574063638939sketch"): java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
at com.android.ant.AaptExecTask.execute(AaptExecTask.java:699)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at processing.mode.android.AndroidBuild.antBuild(AndroidBuild.java:415)
at processing.mode.android.AndroidBuild.build(AndroidBuild.java:73)
at processing.mode.android.AndroidMode.handleRunDevice(AndroidMode.java:220)
at processing.mode.android.AndroidEditor$14.run(AndroidEditor.java:310)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 44 more
Total time: 2 seconds
The problem is on this part of the script from "build.xml":
<echo level="info">----------</echo>
<echo level="info">Handling Resources...</echo>
<aapt executable="${aapt}"
command="package"
verbose="${verbose}"
manifest="${out.manifest.abs.file}"
originalManifestPackage="${project.app.package}"
androidjar="${project.target.android.jar}"
rfolder="${gen.absolute.dir}"
nonConstantId="${android.library}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
ignoreAssets="${aapt.ignore.assets}"
binFolder="${out.absolute.dir}"
proguardFile="${out.absolute.dir}/proguard.txt">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
</aapt>
According to the error log, this is the line 690: proguardFile="${out.absolute.dir}/proguard.txt">
But I donnt know what to do.
Could you please give me a hand on this? I'm wasting so much time in this. I'm in trouble with this since yesterday morning. I've searched on google with no help.
EDIT:
I've deleted and re-installed the tools packages and the console of SDK Manager gave me this error:
Validate XML: https://dl-ssl.google.com/android/repository/sys-img/x86/sys-img.xml
Parse XML: https://dl-ssl.google.com/android/repository/sys-img/x86/sys-img.xml
Found Intel x86 Atom System Image, Android API 10, revision 2
Found Intel x86 Atom System Image, Android API 15, revision 1
Found Intel x86 Atom System Image, Android API 16, revision 1
Found Intel x86 Atom System Image, Android API 17, revision 1
Done loading packages.
Preparing to install archives
Downloading Android SDK Platform-tools, revision 18.0.1
Installing Android SDK Platform-tools, revision 18.0.1
**Stopping ADB server failed (code -1).**
Installed Android SDK Platform-tools, revision 18.0.1
Downloading Android SDK Build-tools, revision 18.0.1
I've been experiencing this issue as well, and apparently there are 2 possible causes:
Apparently the location of aapt has been changed by a recent version of the SDK tools, v22. I'm not sure if removing that version of the tools would fix it, or if that would be recommended. This thread has some fixes that might work.
If this doesn't fix the problem, you may be trying to run the 32 bit aapt on a 64 bit system without the 32 bit runtime installed. In this case the fix from this thread may fix the issue:
sudo apt-get --no-install-recommends install ia32-libs-multiarch
In my case, only the second of these fixes was necessary. By the way, I should point out that I was building android via Phonegap, so the use case may not match 100%. However, the same problem was occurring on the exact same line, where ant tries to execute aapt.
(Aside: The problem isn't necessarily on line 690 specifically, I think that line 690 is just given because it's the end of the "clause" specifying the execution of aapt.)