"Encountered errors while building your game" - unsure?? - Log Supplied

LindsayG20

  • Posts: 60
Just want to bump this, because I'm getting a little worried on what the outcome of this will be.

captaincomic

  • *
  • Posts: 6108
Maybe there is a problem with your javapath symlinks. See this article:
http://marxsoftware.blogspot.co.at/2015/07/windows-oracle-java-path.html

LindsayG20

  • Posts: 60
Maybe there is a problem with your javapath symlinks. See this article:
http://marxsoftware.blogspot.co.at/2015/07/windows-oracle-java-path.html

Thanks for the info Captain, but i'm not sure how to go about doing this. I noticed i did have a duplicate folder directory which it actually could have been pointing to. For a clean start, i uninstalled all Java installs, and removed any extra java files (safely). I then installed the latest java install on my computer again (which i noticed was x86 (jdk1.8.0_65).

It doesn't seem to have the same error as before any more, however i'm now getting another error which seems to be relative to a 'null reference'?

Hopefully this one is a little easier to correct?

For extra information, i'm running on windows 7. And have updated the SDK as well (with success).

Logs provided.

captaincomic

  • *
  • Posts: 6108
In this logs in still shows the same error, but at least it also gives a line number:
Code: [Select]
2015-11-15 20:59:07,001 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib.exe]        [dx] '"C:\Program"' is not recognized as an internal or external command,
2015-11-15 20:59:07,001 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib.exe]        [dx] operable program or batch file.
2015-11-15 20:59:07,003 ERROR [Thread-13] stencyl.sw.util.dg.MessageDialog: Encountered errors while building your game. - Check your logs and post them to the forums.
2015-11-15 20:59:07,036 DEBUG [pool-1-thread-1] stencyl.sw.util.Util: Process 'haxelib.exe' exited with code: 1
2015-11-15 20:59:07,036 ERROR [pool-1-thread-1] stencyl.sw.io.write.resource.HXWriter: Failed: Running Android. (Return code: 1)
2015-11-15 20:59:07,037 ERROR [pool-1-thread-1] stencyl.sw.util.dg.MessageDialog: Encountered errors while building your game. - Check your logs and post them to the forums.
2015-11-15 21:01:18,708 ERROR [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib.exe] BUILD FAILED
2015-11-15 21:01:18,709 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib.exe] C:\Users\Buddy\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:885: The following error occurred while executing this line:
2015-11-15 21:01:18,709 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib.exe] C:\Users\Buddy\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:887: The following error occurred while executing this line:
2015-11-15 21:01:18,709 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib.exe] C:\Users\Buddy\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:899: The following error occurred while executing this line:
2015-11-15 21:01:18,710 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: [haxelib.exe] C:\Users\Buddy\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:281: null returned: 1
which helped me find a bug report:
https://code.google.com/p/android/issues/detail?id=65428

Go to your workspace and edit the file android-sdk/android-sdk-windows/build-tools/android-4.4/dx.bat, on the last line add quotes around java_exe
Code: [Select]
call "%java_exe%" %javaOpts% -Djava.ext.dirs="%frameworkdir%" -jar "%jarpath%" %params%

LindsayG20

  • Posts: 60
This file already seemed to have quotations around it? did you mean add another set?

that didnt work (although im not sure if i did it right?).

Here is a screenshot of both before and afterwards, as well as the newest error log

captaincomic

  • *
  • Posts: 6108
Hmmm, okay... then you were not affect by this bug. In the .bat of the bug report the quotes were missing (extra quotes wouldn't work).

Then it's "java_exe" that returns "C:\Program", which probably means there is still something wrong with your Java setup.

Here's the script that tries to detect your JDK java.exe:
Code: [Select]
@echo off
rem Copyright (C) 2007 The Android Open Source Project
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.
rem You may obtain a copy of the License at
rem
rem      http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

rem This script is called by the other batch files to find a suitable Java.exe
rem to use. The script changes the "java_exe" env variable. The variable
rem is left unset if Java.exe was not found.

rem Useful links:
rem Command-line reference:
rem   http://technet.microsoft.com/en-us/library/bb490890.aspx

rem Check we have a valid Java.exe in the path. The return code will
rem be 0 if the command worked or 1 if the exec failed (program not found).
for /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a
if not defined java_exe goto :CheckFailed

:SearchJavaW
rem Check if we can find a javaw.exe at the same location than java.exe.
rem If that doesn't work, just fall back on the java.exe we just found.
for /f %%a in ('%~dps0\find_java.exe -s -w') do set javaw_exe=%%a
if not exist %javaw_exe% set javaw_exe=%java_exe%
goto :EOF


:CheckFailed
echo.
echo ERROR: No suitable Java found. In order to properly use the Android Developer
echo Tools, you need a suitable version of Java JDK installed on your system.
echo We recommend that you install the JDK version of JavaSE, available here:
echo   http://www.oracle.com/technetwork/java/javase/downloads
echo.
echo If you already have Java installed, you can define the JAVA_HOME environment
echo variable in Control Panel / System / Avanced System Settings to point to the
echo JDK folder.
echo.
echo You can find the complete Android SDK requirements here:
echo   http://developer.android.com/sdk/requirements.html
echo.
goto :EOF
As it says, you can try defining a JAVA_HOME environment variable.
http://www.robertsindall.co.uk/blog/setting-java-home-variable-in-windows/
In your case JAVA_HOME should be set to
Code: [Select]
C:\Program Files (x86)\Java\jdk1.8.0_65

You can also try to run SDK Manager.exe in your workspace workspace/android-sdk-windows.

LindsayG20

  • Posts: 60
Ok so neither way works  :(.

I noticed that there is another path that looks very strange, and i'm not sure if this could be causing it as well?. I have posted both paths up anyway for you to check out (Path_Issue01 is the newest path update, and the Part_Issue02 is the suspicious path). I posted the whole path value below:

C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\QuickTime\QTSystem\;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\

also, attempted to open the 'SDK Manager.exe' in my workspace but nothing opens (it flashes up the DOS dialogue box, then disappears, but that's it).

Newest error log is supplied.

captaincomic

  • *
  • Posts: 6108
Hmmmm, I don't get it, and I'm starting to run out of ideas ...

captaincomic

  • *
  • Posts: 6108
You could try some of the answers here:
https://stackoverflow.com/questions/6234403/sdk-manager-exe-doesnt-work

Specifically, you could try hard-coding the path to your Java JDK in the android-sdk/windows/andoird.bat script.
Replace
Code: [Select]
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF
with
Code: [Select]
set java_exe="%JAVA_HOME%\java.exe"
rem call lib\find_java.bat
if not defined java_exe goto :EOF

LindsayG20

  • Posts: 60
I can imagine you guys are getting sick of this thread popping back up all the time haha, my appologies. I just want to update you with the issue:

I have tried those techniques, and yet, no luck (even hard coding like you suggested).

But again, i still seem to get the same issue.

I tried uninstalling everything again, but this time installing the JDKx64 rather than the JDKx86.

But again, no luck.

I noticed that in the Log Viewer, there is a 'null reference' which seems to be coming up more often now, which is directing itself back to the 'Build.xml'. I was wondering if the Build gets uninstalled as well when you uninstall either Stencyl/Java/or the development kit. Because if it doesn't, then i would be worried that there would be something else around those files that needs to be updated.

the message is:
[haxelib.exe] C:\Users\Buddy\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:281: null returned: 1

the images for both Log viewer error, and what the build 'edit' actually looks like.
Not sure if its supposed to be like that or what.

Also, The newest log have been attached as well.
So far these are the things i have changed:

-  JAVA_HOME with the variable changed to 'C:\Program Files\Java\jdk1.8.0_65\bin' (before it was set to
'C:\Program Files\Java\jdk1.8.0_65' - without the bin).

- The Android.bat have been updated (numerous times with no luck). This is where its at currently (image provided).

I know its definitely not my game because it works perfect on other computers, and it seems to be fine for flash, so it has to be something in my file directory or something strange...

Hopefully there is a fix for this :S


captaincomic

  • *
  • Posts: 6108
No, I don't know what the problem could be. build.xml:281 is the line where it executes the "dx" command (if you want to look at the build.xml, try with a different editor, like Notepad++). This matches the error message (it's dx that fails).

With the java_exec and the JAVA_HOME var being set, java_exec should be correct, I don't know what other path dx could be looking for with 'C:\Program'.

What output do you get when you open a command prompt, cd to tools and execute android.bat?

LindsayG20

  • Posts: 60
"What output do you get when you open a command prompt, cd to tools and execute android.bat?"

I'm not sure what you mean by this?
I open command prompt and do what?

rrzl

  • Posts: 242
What captaincomic said is, to execute android.bat from command prompt.
And see what output you get. That file is located here :
..\stencylworks\android-sdk\android-sdk-windows\tools\android.bat

Thats what CD command means. Change Drive.

Alternatively,
go to that folder, and :
hold Shift+Right Click (inside the folder area),
Select "Open command window here",
then type : android.bat
If all goes right, it will open up SDK Manager

LindsayG20

  • Posts: 60
Ok, awesome! So this is what appears: