Can't compile to Android Target (windows 7 x64)

Monkey Targets Forums/Android/Can't compile to Android Target (windows 7 x64)

pipo-kun(Posted 2011) [#1]
Hi all!

I get this:
http://pastebin.com/R8tb3JhN

_________The error compilation______________
compile:
[javac] C:\Android\android-sdk\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 2 source files to C:\MonkeyPro38\bananas\warpy\monkeypuzzle\monkeypuzzle.build\android\bin\classes
[javac] C:\MonkeyPro38\bananas\warpy\monkeypuzzle\monkeypuzzle.build\android\src\com\monkey\MonkeyGame.java:250: cannot find symbol
[javac] symbol : variable layout
[javac] location: class com.monkey.R
[javac] setContentView( R.layout.main );
[javac] ^
[javac] C:\MonkeyPro38\bananas\warpy\monkeypuzzle\monkeypuzzle.build\android\src\com\monkey\MonkeyGame.java:252: cannot find symbol
[javac] symbol : variable id
[javac] location: class com.monkey.R
[javac] view=(MonkeyView)findViewById( R.id.monkeyview );
[javac] ^
[javac] Note: C:\MonkeyPro38\bananas\warpy\monkeypuzzle\monkeypuzzle.build\android\src\com\monkey\MonkeyGame.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors
BUILD FAILED
C:\Android\android-sdk\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.
Total time: 2 seconds
Android build failed.

Process Complete
______________________________________________


I Checked all env variables and the trans config to point to the correct path.

My config.winnt.txt is:
----------------------------
ANT_PATH="C:\apache-ant-1.8.2"
JDK_PATH="C:\Java\jdk1.6.0_25"
ANDROID_PATH="C:\Android\android-sdk"


I know something is missing, but what?? Help please! :)


Loofadawg(Posted 2011) [#2]
Hopefully somebody much smarter than myself will tell you what's going on, but I do know this...

from your pastebin link, the build process hits it's first snag at line 9:

FOPEN 'wb' for CopyFile(C:/MonkeyPro38/modules/mojo/data/mojo_font.png,C:/MonkeyPro38/bananas/warpy/monkeypuzzle/monkeypuzzle.build/android/assets/monkey/mojo_font.png) failed
FOPEN 'wb' for SaveString 'res/layout/main.xml' failed



If mojo_font.png is not in the located, the complie process would end right there. So maybe it has something to do with the destination?

If you navigate to C:/MonkeyPro38/bananas/warpy/monkeypuzzle:

Do you see the "monkeypuzzle.build" folder?
Is there an "android" folder inside that?
Can you successfully build a HTML5 target?

Things to try. Close out Monkey and restart it. Heck reboot the computer.
Make sure you are not editing anything in the build folder. (I tried to recreate the error, and I found if I had the monkeypuzzle.build/android/assets/monkey/mojo_font.png opened I would get a similar error. Funny, though, I cannot re-recreate it since then).


pipo-kun(Posted 2011) [#3]
Thx, but it seems pretty normal to me.

There's no error in that folder , unless:

a) Maybe my Windows7x64 is confused about the use of "C:\" and "C:/" CopyFile arguments...
b) There could be only-read access to that folder (don't know why..).
c) It has something to do with the 'thumbs.db' thing.. (don't think so).


I didn't change nor modiy anything from that folder, I just load the sample and press F5.

HTML5 target compiles fine without errors, and pretty fast.



I'm starting to think about where I put the ANT folder... Was it supposed to be located somewhere inside the Android SDK folder?


Loofadawg(Posted 2011) [#4]
My ANT file is located in the exact same place:
ANT_PATH="C:\apache-ant-1.8.2"
So it isn't that.

I am using a Win7x64 machine too. Other than that Java and Android are in my Programs folder, everything else appears identical.

My only other suggestions would be to uninstall everything (Java SDK, Android SDK, ANT, Monkey) and then reinstall it all.

Completely at a loss, surely somebody here can figure it out. Really hate it that you are having problems still.


Good luck.


xMystik(Posted 2011) [#5]
Are you using the 32bit or 64bit version of Java?

I had problems until I changed to the 32bit version. The file I downloaded is called:-

jdk-6u25-windows-i586.exe

Steve.


Xaron(Posted 2011) [#6]
Yep you have to use the 32bit Java version. This isn't a Monkey problem but an Android SDK one...


pipo-kun(Posted 2011) [#7]
I've reinstalled all from scratch.

Java u25 32bit, Eclipse 32bit, Android SDK and ADT.

I also delete the .build folder, to prevent from overwritting errors , whatever..

I keep getting the first error (which result in the next two), so there's clearly a problem with the Fopen CopyFile thing...


Could it be a problem with read-only permissions for this folder? .. Ill try to reinstall Monkey, but don't think it helps..


Do I need Apache binaries or some extra software? I'm completely lost


Xaron(Posted 2011) [#8]
Ok, here's what I've done (Windows 7 64Bit):

Download and install Java JDK 32 Bit:
http://download.oracle.com/otn-pub/java/jdk/6u25-b06/jdk-6u25-windows-i586.exe

Download and install Android SDK:
http://dl.google.com/android/installer_r10-windows.exe

Download and install Apache ANT:
http://apache.mirror.clusters.cc//ant/binaries/apache-ant-1.8.2-bin.zip

That's all you need.

Then you must edit the config file for Monkey: MonkeyPro/bin/config.winnt.txt

For Ant
'--------------------
'Ant build tool path
'
'Must be set to a valid dir for ANDROID target support
'
ANT_PATH="C:\apache-ant-1.8.2"


For Jdk
'--------------------
'Java dev kit path
'
'Must be set to a valid dir for ANDROID and FLASH target support
'
JDK_PATH="C:\Java\jdk1.6.0_25"


For Android SDK
'--------------------
'Android SDK and tool paths.
'
'Must be set to a valid for for ANDROID target support
'
ANDROID_PATH="C:\Android\android-sdk"


Of course you must adapt the pathes to your needs. That's all and should do it.


pipo-kun(Posted 2011) [#9]
My fault. It's working now! :)


I downloaded Monkey and modified the winnt.config once again.


The file was probably wrong in some line, or I overwrote a variable.. Sorry for that.


Anyways, we have prove Monkey is stable also on 64bit, hehe..


Loofadawg(Posted 2011) [#10]
Great, glad to hear you got it up and running.