Build Error - can someone help me understand the possible cause?

Hi,

I switched my computer and loaded up an existing project. I tried to build it but run into the following exception during the build process (at the step where it says compiling assets into a single file or something):


Error building Player: Win32Exception: ApplicationName=‘javac.exe’, CommandLine=‘-bootclasspath “C:/Development/adt-bundle-windows-x86_64-20140702/sdk/platforms/android-20\android.jar” -d “C:\Users\RajHP\Documents\ActionGame\Temp\StagingArea\bin\classes” -source 1.6 -target 1.6 -encoding UTF-8 “com\unity3d\ads\android\R.java” “com\WaveLightGames\GunFrenzyRelease\R.java”’, CurrentDirectory=‘C:\Users\RajHP\Documents\ActionGame\Temp\StagingArea\gen’


I’ve installed the latest SDK and am able to build another project on this computer and version of Unity. Any idea what the above error means?

I thought that perhaps I needed to have javac.exe in the path specified so I copied that over from the JDK to that path and ran the build process again. This time, I got a different error:


Error building Player: CommandInvokationFailure: Failed to recompile android resource files. See the Console for details.
C:\Program Files (x86)\Java\jre7\bin\javac.exe -bootclasspath “C:/Development/adt-bundle-windows-x86_64-20140702/sdk/platforms/android-20\android.jar” -d “C:\Users\RajHP\Documents\ActionGame\Temp\StagingArea\bin\classes” -source 1.6 -target 1.6 -encoding UTF-8 “com\unity3d\ads\android\R.java” “com\WaveLightGames\GunFrenzyRelease\R.java”
stderr[
]
stdout[
]


Can anyone help me understand the issue?

I have the same problem.

I installed JDK and copied java foler to both Program files and Program files (x86), yet this problem persist.

Anyone?

Do not copy your files out to the other folders, it does not help… Try editing the PATH variable in your environments so that Unity knows where the java binaries are. The Android build process is not as simple as just having java compile them into java archive, it requires other java binaries and libraries to complete the entire process (like zipping and signing).

Where can I find the path variable?

You should remove you’re Java installation and install the latest Java SDK, version 8 .* from the Oracle site as it created my ‘System Variables’ this time on installation without me editing them myself.

You need to open ‘System Properties’->‘Advanced’->‘Environment Variables…’ then edit the ‘System Variables’

e.g.
Variable Name: JAVA_HOME
Variable Value: C:\Program Files\Java\jdk1.8.0_25

Variable Name: Path
Variable Value: C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\TortoiseHg;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\WinMerge;

As you see these modern Windows installations make a mess of things and install files everywhere.

Notice, no user or system global CLASSPATH is defined anymore like they used to do.

1 Like