Compile error with picpuzzle

Monkey Targets Forums/Android/Compile error with picpuzzle

animeshk(Posted 2012) [#1]
I have set up the Android Windows developer kit, ant, and 32-bit Java. These appear to be set up correctly, as it appears to translate and the compile is initiated . . . but the compile fails. I have tried both Java 1.7 and 1.6, and I see the same error. Since I'm just testing this, I am compiling the picpuzzle sample app, which runs fine for both HTML5 and Flash. When I try to compile this for Android, the compile fails. When i look at the compile logs, I see:

[javac] Compiling 3 source files to C:\Users\akarna\MonkeyCoder\MonkeyPro66\bananas\gerryq\picpuzzle\picpuzzle.build\android\bin\classes
[javac] C:\Users\akarna\MonkeyCoder\MonkeyPro66\bananas\gerryq\picpuzzle\picpuzzle.build\android\src\com\monkey\MonkeyGame.java:748: cannot find symbol
[javac] symbol : variable layout
[javac] location: class com.monkey.R
[javac] setContentView( R.layout.main );
[javac] ^
[javac] C:\Users\akarna\MonkeyCoder\MonkeyPro66\bananas\gerryq\picpuzzle\picpuzzle.build\android\src\com\monkey\MonkeyGame.java:750: cannot find symbol
[javac] symbol : variable id
[javac] location: class com.monkey.R
[javac] view=(MonkeyView)findViewById( R.id.monkeyview );
[javac] ^
[javac] Note: C:\Users\akarna\MonkeyCoder\MonkeyPro66\bananas\gerryq\picpuzzle\picpuzzle.build\android\src\com\monkey\MonkeyGame.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors

Does anyone have any ideas as to what I'm doing wrong? Thanks!


golomp(Posted 2012) [#2]
Hello,

Ii is probably a problem of configuration because normally all example works perfectly on each plateform.


Samah(Posted 2012) [#3]
What version of the Android SDK do you have? Have you downloaded the right APIs for your device?


animeshk(Posted 2012) [#4]
I installed the Android SDK in C:\android-sdk-windows, and then used the Android SDK Manager to install Android 3.2 (API 13). Note that I installed the SDK Platform, Samples, and Google APIs, but not "XOOM2ME" and "XOOM2". Also, I have ant installed in c:\ant\apache-ant-1.8.1. My config.winnt.txt is:


'--------------------
'HTML player path.
'
'Must be set for HTML5 target support.
'
'for opening .html files...
'
HTML_PLAYER="${TRANSDIR}\mserver_winnt.exe"
'--------------------

'--------------------
'Ant build tool path
'
'Must be set to a valid dir for ANDROID target support
'
'Ant is currently available here:
' http://ant.apache.org/bindownload.cgi
'
ANT_PATH="${SYSTEMDRIVE}\ant\apache-ant-1.8.1"
'ANT_PATH="${SYSTEMDRIVE}\ant"
'--------------------

'--------------------
'MinGW path.
'
'Must be set to a valid dir for STDCPP target support.
'
'MinGW is currently available here:
' http://tdm-gcc.tdragon.net/download
'
MINGW_PATH="${SYSTEMDRIVE}\MinGW32"
MINGW_PATH="${SYSTEMDRIVE}\MinGW"
'--------------------

'--------------------
'Java dev kit path
'
'Must be set to a valid dir for ANDROID and FLASH target support
'
'Make sure to install the 32 bit JDK, even on 64 bit Windows!
'
'The Java JDK is currently available here:
' http://www.oracle.com/technetwork/java/javase/downloads/index.html
'
JDK_PATH="${PROGRAMFILES}\Java\jdk1.6.0_34"
'JDK_PATH="${PROGRAMFILES}\Java\jdk1.7.0_02"
'JDK_PATH="${PROGRAMFILES}\Java\jdk1.6.0_23"
'JDK_PATH="${PROGRAMFILES}\Java\jdk1.6.0_21"
'JDK_PATH="${PROGRAMFILES}\Java\jdk1.6.0_19"
'--------------------

'--------------------
'Android SDK and tool paths.
'
'Must be set to a valid for for ANDROID target support
'
'The Android SDK is currently available here:
' http://developer.android.com/sdk/index.html
'
ANDROID_PATH="${SYSTEMDRIVE}\android-sdk-windows"
'--------------------

'--------------------
'Flex SDK and flash player path.
'
'FLEX_PATH Must be set for FLASH target support.
'
'Either HTML_PLAYER or FLASH_PLAYER must be set for FLASH target support.
'
'The Flex SDK is currently available here:
' http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK
'
FLEX_PATH="${SYSTEMDRIVE}\flex_sdk_4.6"
'FLEX_PATH="${SYSTEMDRIVE}\flex_sdk_4.5"
'FLEX_PATH="${SYSTEMDRIVE}\flex_sdk_4.1.0.16076"
'FLEX_PATH="${SYSTEMDRIVE}\flex_sdk_4.1"
'FLEX_PATH="${SYSTEMDRIVE}\flex_sdk_4.0.0.14159"
'FLEX_PATH="${SYSTEMDRIVE}\flex_sdk_4.0"
'FLEX_PATH="${SYSTEMDRIVE}\flex_sdk_4"
'FLEX_PATH="${SYSTEMDRIVE}\flex_sdk"
'
'for opening .swf files...monkey will use HTML_PLAYER if this is not set.
'FLASH_PLAYER="${SYSTEMDRIVE}flex_sdk_4.6\runtimes\player\11.1\win\FlashPlayerDebugger.exe"
'
'--------------------

'--------------------
'Play Station Suite SDK path.
'
'PSS_PATH must be set for PSS target support.
'
'Note: This will soon be replaced by the Play Station Mobile target - use that instead!
'
PSS_PATH="${PROGRAMFILES}\SCE\Pss"

'--------------------
'Play Station Mobile SDK path.
'
'PSM_PATH must be set for PSM target support.
'
'Note: This will soon replace the Play Station Suite target - use this instead!!!!!
'
PSM_PATH="${PROGRAMFILES}\SCE\PSM"

'--------------------
'MSBUILD path.
'
'Must be set for XNA and GLFW target support.
'
'Visual C++ 2010 Express is required for GLFW target support and is currently available here:
' http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
'
'Visual C# 2010 Express and XNA 4.0 are requred for XNA target support and are currently available here:
' http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express
' http://www.microsoft.com/download/en/details.aspx?id=23714
'
MSBUILD_PATH="${WINDIR}\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
'--------------------

Thanks for any help!


Gerry Quinn(Posted 2012) [#5]
I downloaded V66 to test this (for the honour of picpuzzle!), and it runs fine for me. Here's the output:



It stops at the end as I didn't have the emulator running, don't think that's an issue as your problem is that it's not compiling.

Lines 746-754 of MonkeyGame.java in my compile are:
	System.setOut( new PrintStream( new LogTool() ) );

		activity=this;

		setContentView( R.layout.main );

		view=(MonkeyView)findViewById( R.id.monkeyview );
		view.setFocusableInTouchMode( true );
		view.requestFocus();


...some of which looks like what your compiler is kicking at.

Could it be that your java compiler is misconfigured? Alas, I don't know anything about the compiler in question...

Anyway, it looks like that's where the difference lies. The lines are in translated mojo stuff, not picpuzzle, so I guess if they are relevant, nothing will compile.


animeshk(Posted 2012) [#6]
This is definitely something with my configuration. I set up Monkey, Java, ant, and the Android SDK on another computer and it is building fine. Thanks!


muddy_shoes(Posted 2012) [#7]
I've just had this same symptom when installing Monkey on Windows 8. I've no idea if it's actually the same problem as my install is non-standard but the problem was that some file writes were failing during the target build directory construction.

The trans.exe was one built on my Windows 7 laptop. Rebuilding trans on Windows 8 fixed the issue.