Unable to run Monkey Game on android

Monkey Targets Forums/Android/Unable to run Monkey Game on android

Shagwana(Posted 2015) [#1]
Well I am having some problem getting the android app running on the emulator..

My example is;
Strict
Import mojo


Function Main:Int()
  New SublimeGame_c
  Return 0
End Function


Class SublimeGame_c Extends App

	Method OnCreate:Int()
		SetUpdateRate 30
		Return 0
	End Method

	Method OnUpdate:Int()
		Return 0
	End Method

	Method OnRender:Int()
		Cls
		DrawText "Hello",100,100
		Return 0
	End Method	

End Class


after building and running, the emulator shows a 'Unfortunately, Monkey Game has stopped." message.

The full debug log is

"D:/Users/SGreener/SkyDrive/Tools/MonkeyPro/bin/transcc_winnt" -target=Android_Game_(Api_10) -config=Debug -run "D:/Users/SGreener/SkyDrive/Projects/Monkey/Game Systems/Sandbox/plaything5.monkey"
TRANS monkey compiler V1.84
Parsing...
Semanting...
Translating...
Building...
Buildfile: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\build.xml

-check-env:
 [checkenv] Android SDK Tools Revision 24.1.2
 [checkenv] Installed at D:\SDK\AndriodSDK

-setup:
     [echo] Project Name: MonkeyGame
  [gettype] Project Type: Application

-pre-clean:

clean:
   [delete] Deleting directory D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin
   [delete] Deleting directory D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\gen
[getlibpath] Library dependencies:
[getlibpath] No Libraries
   [subant] No sub-builds to iterate on

BUILD SUCCESSFUL
Total time: 0 seconds
Buildfile: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 24.1.2
 [checkenv] Installed at D:\SDK\AndriodSDK

-setup:
     [echo] Project Name: MonkeyGame
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 22.0.1
     [echo] Resolving Build Target for MonkeyGame...
[gettarget] Project Target:   Android 4.4.2
[gettarget] API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin
    [mkdir] Created dir: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\res
    [mkdir] Created dir: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\rsObj
    [mkdir] Created dir: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\rsLibs
    [mkdir] Created dir: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\gen
    [mkdir] Created dir: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\classes
    [mkdir] Created dir: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for MonkeyGame...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency] 
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 3 source files to D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] Note: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\src\com\monkeycoder\monkeygame\MonkeyGame.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\src\com\monkeycoder\monkeygame\MonkeyGame.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 3 warnings

-post-compile:

-obfuscate:

-dex:
      [dex] input: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\classes
      [dex] Converting compiled files and external libraries into D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\classes.dex...

-crunch:
   [crunch] Crunching PNG Files in source dir: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\res
   [crunch] To destination dir: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\res
   [crunch] Processing image to cache: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\res\drawable-hdpi\icon.png => D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\res\drawable-hdpi\icon.png
   [crunch]   (processed image to cache entry D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\res\drawable-hdpi\icon.png: 0% size of source)
   [crunch] Processing image to cache: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\res\drawable-ldpi\icon.png => D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\res\drawable-ldpi\icon.png
   [crunch]   (processed image to cache entry D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\res\drawable-ldpi\icon.png: 0% size of source)
   [crunch] Processing image to cache: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\res\drawable-mdpi\icon.png => D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\res\drawable-mdpi\icon.png
   [crunch]   (processed image to cache entry D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\res\drawable-mdpi\icon.png: 0% size of source)
   [crunch] Crunched 3 PNG files to update cache

-package-resources:
     [aapt] Creating full resource package...

-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating MonkeyGame-debug-unaligned.apk and signing it with a debug key...

-post-package:

-do-debug:
 [zipalign] Running zip align on final apk...
     [echo] Debug Package: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\MonkeyGame-debug.apk
[propertyfile] Creating new property file: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\build.prop
[propertyfile] Updating property file: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\build.prop
[propertyfile] Updating property file: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\build.prop
[propertyfile] Updating property file: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\build.prop

-post-build:

debug:

install:
     [echo] Installing D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\Sandbox\plaything5.buildv83c\android_new\bin\MonkeyGame-debug.apk onto default emulator or device...
     [exec] WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
     [exec] 	pkg: /data/local/tmp/MonkeyGame-debug.apk
     [exec] Success
     [exec] 1911 KB/s (58735 bytes in 0.030s)

BUILD SUCCESSFUL
Total time: 2 seconds
WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
Starting: Intent { cmp=com.monkeycoder.monkeygame/.MonkeyGame }
--------- beginning of /dev/log/main
E/memtrack( 1980): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug( 1980): failed to load memtrack module: -2
E/gralloc_goldfish(  940): gralloc_alloc: Mismatched usage flags: 173 x 138, usage 333
E/        (  940): GraphicBufferAlloc::createGraphicBuffer(w=173, h=138) failed (Invalid argument), handle=0x0
E/BufferQueue( 1228): [ScreenshotClient] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed
--------- beginning of /dev/log/system
E/AndroidRuntime( 1990): FATAL EXCEPTION: GLThread 90
E/AndroidRuntime( 1990): Process: com.monkeycoder.monkeygame, PID: 1990
E/AndroidRuntime( 1990): java.lang.IllegalArgumentException: No config chosen
E/AndroidRuntime( 1990): 	at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:874)
E/AndroidRuntime( 1990): 	at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1024)
E/AndroidRuntime( 1990): 	at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
E/AndroidRuntime( 1990): 	at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
E/gralloc_goldfish(  940): gralloc_alloc: Mismatched usage flags: 173 x 138, usage 333
E/        (  940): GraphicBufferAlloc::createGraphicBuffer(w=173, h=138) failed (Invalid argument), handle=0x0
E/BufferQueue( 1228): [ScreenshotClient] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed



Any ideas what the problem can be?


Amon(Posted 2015) [#2]
First can you try building this again but removing the space in this directory.

Game Systems
input: D:\Users\SGreener\SkyDrive\Projects\Monkey\Game Systems\


Also have you allocated enough resources: ram, space and graphics emulated memory to the virtual device in the AVD?


Shagwana(Posted 2015) [#3]
Removed a spaces from the path of the source file, this did not fix the issue (same issue).

I am sure the AVD has enough resources.


Shagwana(Posted 2015) [#4]
Figured it out, was using the option 'Use Host GPU', when ticked it failed to work. When not ticked it worked!.