After upgrade Android SDK my monkey apps crash

Monkey Targets Forums/Android/After upgrade Android SDK my monkey apps crash

Snader(Posted 2013) [#1]
I have upgraded the Android SDK and suddenly all kind of problems popped up:

For instance... this game worked before the update, but now not any more. The HTML5 version works still great! Getting these errors in the output console of Jungle IDE:

I/[Monkey]( 3275): 0

I/[Monkey]( 3275): Monkey Runtime Error : java.lang.NullPointerException

I/[Monkey]( 3275): D:/Programming/Projects/SchapenTellen/SchapenTellen.monkey<686>

I/[Monkey]( 3275): D:/Programming/Projects/SchapenTellen/SchapenTellen.monkey<610>

I/[Monkey]( 3275): D:/Programming/Projects/SchapenTellen/SchapenTellen.monkey<172>

I/[Monkey]( 3275): D:/Programming/monkey/modules/mojo/app.monkey<60>

E/AndroidRuntime( 3275): FATAL EXCEPTION: main

E/AndroidRuntime( 3275): java.lang.NullPointerException

E/AndroidRuntime( 3275): at com.monkey.c_SchapenTellen.p_Deal(MonkeyGame.java:2631)

E/AndroidRuntime( 3275): at com.monkey.c_SchapenTellen.p_switchToState(MonkeyGame.java:2847)

E/AndroidRuntime( 3275): at com.monkey.c_SchapenTellen.p_OnUpdate(MonkeyGame.java:3376)

E/AndroidRuntime( 3275): at com.monkey.c_GameDelegate.UpdateGame(MonkeyGame.java:4077)

E/AndroidRuntime( 3275): at com.monkey.BBGame.UpdateGame(MonkeyGame.java:550)

E/AndroidRuntime( 3275): at com.monkey.BBAndroidGame.UpdateGame(MonkeyGame.java:1196)

E/AndroidRuntime( 3275): at com.monkey.BBAndroidGame$GameTimer.run(MonkeyGame.java:782)

E/AndroidRuntime( 3275): at android.os.Handler.handleCallback(Handler.java:608)

E/AndroidRuntime( 3275): at android.os.Handler.dispatchMessage(Handler.java:92)

E/AndroidRuntime( 3275): at android.os.Looper.loop(Looper.java:156)

E/AndroidRuntime( 3275): at android.app.ActivityThread.main(ActivityThread.java:4977)

E/AndroidRuntime( 3275): at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 3275): at java.lang.reflect.Method.invoke(Method.java:511)

E/AndroidRuntime( 3275): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

E/AndroidRuntime( 3275): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

E/AndroidRuntime( 3275): at dalvik.system.NativeStart.main(Native Method)

E/EmbeddedLogger( 1601): App crashed! Process: com.monkey

E/EmbeddedLogger( 1601): App crashed! Package: com.monkey v1 (1.0)

E/EmbeddedLogger( 1601): App crashed! Application Label: Monkey Game

E/SettingsMobileDataEnabler(24840): The same switchHeader!

E/SettingsMobileDataEnabler(24840): The same switchHeader!

E/ModemLink(24840): read /sys/class/android_usb/f_rmnet/on failed: java.io.FileNotFoundException: /sys/class/android_usb/f_rmnet/on: open failed: ENOENT (No such file or directory)

E/dalvikvm( 3884): Could not find class 'android.app.Notification$BigTextStyle', referenced from method com.android.calendar.alerts.AlertReceiver.makeExpandingNotification

E/ModemLink(24840): read /sys/class/android_usb/f_rmnet/on failed: java.io.FileNotFoundException: /sys/class/android_usb/f_rmnet/on: open failed: ENOENT (No such file or directory)

I have already deleted the android SDK and reinstalled it, but the problems stay.


Ironstorm(Posted 2013) [#2]
Have you deleted your project .build dir?


Snader(Posted 2013) [#3]
I deleted the complete build dir. The game then builds correctly, but crashes both on my HTC one V phone and my Samsung Galaxy Note:

BUILD SUCCESSFUL
Total time: 24 seconds
Starting: Intent { cmp=com.monkey/.MonkeyGame }

--------- beginning of /dev/log/main

--------- beginning of /dev/log/system

E/Icing (31458): Not enough disk space. Will not index.

E/MediaProvider(31384): invalid album art, error creating album thumb file

I/[Monkey](31419): 0

I/[Monkey](31419): Monkey Runtime Error : java.lang.NullPointerException

I/[Monkey](31419): D:/Programming/Projects/SchapenTellen/SchapenTellen.monkey<686>

I/[Monkey](31419): D:/Programming/Projects/SchapenTellen/SchapenTellen.monkey<610>

I/[Monkey](31419): D:/Programming/Projects/SchapenTellen/SchapenTellen.monkey<172>

I/[Monkey](31419): D:/Programming/monkey/modules/mojo/app.monkey<60>

E/AndroidRuntime(31419): FATAL EXCEPTION: main

E/AndroidRuntime(31419): java.lang.NullPointerException

E/AndroidRuntime(31419): at com.monkey.c_SchapenTellen.p_Deal(MonkeyGame.java:2631)

E/AndroidRuntime(31419): at com.monkey.c_SchapenTellen.p_switchToState(MonkeyGame.java:2847)

E/AndroidRuntime(31419): at com.monkey.c_SchapenTellen.p_OnUpdate(MonkeyGame.java:3376)

E/AndroidRuntime(31419): at com.monkey.c_GameDelegate.UpdateGame(MonkeyGame.java:4077)

E/AndroidRuntime(31419): at com.monkey.BBGame.UpdateGame(MonkeyGame.java:550)

E/AndroidRuntime(31419): at com.monkey.BBAndroidGame.UpdateGame(MonkeyGame.java:1196)

E/AndroidRuntime(31419): at com.monkey.BBAndroidGame$GameTimer.run(MonkeyGame.java:782)

E/AndroidRuntime(31419): at android.os.Handler.handleCallback(Handler.java:608)

E/AndroidRuntime(31419): at android.os.Handler.dispatchMessage(Handler.java:92)

E/AndroidRuntime(31419): at android.os.Looper.loop(Looper.java:156)

E/AndroidRuntime(31419): at android.app.ActivityThread.main(ActivityThread.java:4977)

E/AndroidRuntime(31419): at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime(31419): at java.lang.reflect.Method.invoke(Method.java:511)

E/AndroidRuntime(31419): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

E/AndroidRuntime(31419): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

E/AndroidRuntime(31419): at dalvik.system.NativeStart.main(Native Method)

E/EmbeddedLogger( 1601): App crashed! Process: com.monkey

E/EmbeddedLogger( 1601): App crashed! Package: com.monkey v1 (1.0)

E/EmbeddedLogger( 1601): App crashed! Application Label: Monkey Game

E/MediaScannerService(31384): Exception in handleMessage

E/MediaScannerService(31384): android.os.DeadObjectException

E/MediaScannerService(31384): at android.os.BinderProxy.transact(Native Method)

E/MediaScannerService(31384): at android.media.IMediaScannerListener$Stub$Proxy.scanCompleted(IMediaScannerListener.java:100)

E/MediaScannerService(31384): at com.android.providers.media.MediaScannerService$ServiceHandler.handleMessage(MediaScannerService.java:952)

E/MediaScannerService(31384): at android.os.Handler.dispatchMessage(Handler.java:99)

E/MediaScannerService(31384): at android.os.Looper.loop(Looper.java:156)

E/MediaScannerService(31384): at com.android.providers.media.MediaScannerService.run(MediaScannerService.java:656)

E/MediaScannerService(31384): at java.lang.Thread.run(Thread.java:864)

E/HtcLockScreen2.0( 1601): LSState: screen_off onResume

E/dalvikvm(31800): Could not find class 'android.app.Notification$BigTextStyle', referenced from method com.android.calendar.alerts.AlertReceiver.makeExpandingNotification

E/MediaProvider(32032): invalid album art, error creating album thumb file


StoneFaceEXE(Posted 2013) [#4]
I/[Monkey](31419): Monkey Runtime Error : java.lang.NullPointerException

I/[Monkey](31419): D:/Programming/Projects/SchapenTellen/SchapenTellen.monkey<686>

I/[Monkey](31419): D:/Programming/Projects/SchapenTellen/SchapenTellen.monkey<610>

I/[Monkey](31419): D:/Programming/Projects/SchapenTellen/SchapenTellen.monkey<172>

I/[Monkey](31419): D:/Programming/monkey/modules/mojo/app.monkey<60>


check these lines of your project 686, 610, 172
Monkey has some cosmetic changes so pay attention to the commands on these lines

you can post them as well here


Snader(Posted 2013) [#5]
172: switchToState(STATE_NEWGAME)

610: Deal()

686: Deck.Clear()

Just lines calling methods.. And it worked before on all my android devices, but not since the update of the Android SDK.

In the meantime I have reverted back to an older version without a loading screen like used in http://www.monkeycoder.co.nz/Community/posts.php?topic=4306#45957

This has also worked before the SDK update, but now the app only seems to work without it. The app does build correctly but crashes.
It still does work in HTML5.


Snader(Posted 2013) [#6]
Just to get some error I tried good old 66b of monkey again and now the Build fails (also after deleting the BUILD dir):


-pre-compile:

-compile:
[javac] Compiling 3 source files to D:\Programming\Projects\SchapenTellen\SchapenTellen2.build\android\bin\classes
[javac] D:\Programming\Projects\SchapenTellen\SchapenTellen2.build\android\src\com\monkey\MonkeyGame.java:305: error: cannot find symbol
[javac] byte[] bytes=MonkeyData.loadBytes( path );
[javac] ^
[javac] symbol: variable MonkeyData
[javac] location: class BBDataBuffer
[javac] D:\Programming\Projects\SchapenTellen\SchapenTellen2.build\android\src\com\monkey\MonkeyGame.java:580: error: cannot find symbol
[javac] view=(MonkeyView)findViewById( R.id.monkeyview );
[javac] ^
[javac] symbol: variable monkeyview
[javac] location: class id
[javac] D:\Programming\Projects\SchapenTellen\SchapenTellen2.build\android\src\com\monkey\MonkeyGame.java:887: error: cannot find symbol
[javac] return MonkeyData.loadString( path );
[javac] ^
[javac] symbol: variable MonkeyData
[javac] location: class gxtkApp
[javac] D:\Programming\Projects\SchapenTellen\SchapenTellen2.build\android\src\com\monkey\MonkeyGame.java:1134: error: cannot find symbol
[javac] bitmap=MonkeyData.loadBitmap( path );
[javac] ^
[javac] symbol: variable MonkeyData
[javac] location: class gxtkGraphics
[javac] D:\Programming\Projects\SchapenTellen\SchapenTellen2.build\android\src\com\monkey\MonkeyGame.java:1933: error: cannot find symbol
[javac] int sound=MonkeyData.loadSound( path,pool );
[javac] ^
[javac] symbol: variable MonkeyData
[javac] location: class gxtkAudio
[javac] D:\Programming\Projects\SchapenTellen\SchapenTellen2.build\android\src\com\monkey\MonkeyGame.java:2034: error: cannot find symbol
[javac] music=MonkeyData.openMedia( path );
[javac] ^
[javac] symbol: variable MonkeyData
[javac] location: class gxtkAudio
[javac] Note: D:\Programming\Projects\SchapenTellen\SchapenTellen2.build\android\src\com\monkey\MonkeyGame.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 6 errors

BUILD FAILED
d:\android-sdk\tools\ant\build.xml:710: The following error occurred while executing this line:
d:\android-sdk\tools\ant\build.xml:723: Compile failed; see the compiler error output for details.

Total time: 2 secondsTRANS FAILED: Android build failed.

Abnormal program termination. Exit code: -1


Snader(Posted 2013) [#7]
Alright.. I narrowed it down to the loading of resources like sounds in the OnUpdate part instead of the OnCreate part. When I remove any loading of resources out of the onUpdate part, the app doesn't crash on my Android devices.


Wagenheimer(Posted 2013) [#8]
My game works while debugging, but the version from Android Store crashs! =(. Any ideia?

Here is the error report :

DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)

"main" prio=5 tid=1 MONITOR
| group="main" sCount=1 dsCount=0 obj=0x4184db50 self=0x4c8ed020
| sysTid=8344 nice=0 sched=0/0 cgrp=apps handle=1074057536
| schedstat=( 0 0 0 ) utm=4 stm=3 core=0
at com.wagenheimer.rabbitjumpandroid.BBGame.MotionEvent(MonkeyGame.java:~620)
- waiting to lock <0x420a2ec0> (a com.wagenheimer.rabbitjumpandroid.c_GameDelegate) held by tid=11 (GLThread 7170)
at com.wagenheimer.rabbitjumpandroid.BBAndroidGame.onSensorChanged(MonkeyGame.java:1304)
at android.hardware.SystemSensorManager$ListenerDelegate$1.handleMessage(SystemSensorManager.java:230)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5031)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)

"SoundPool" prio=5 tid=14 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x420cfa50 self=0x52f5f670
| sysTid=8366 nice=0 sched=0/0 cgrp=apps handle=1391930032
| schedstat=( 0 0 0 ) utm=0 stm=0 core=1
at dalvik.system.NativeStart.run(Native Method)

"SoundPoolThread" prio=5 tid=13 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x420ce280 self=0x52f89350
| sysTid=8367 nice=0 sched=0/0 cgrp=apps handle=1317731536
| schedstat=( 0 0 0 ) utm=0 stm=0 core=0
at dalvik.system.NativeStart.run(Native Method)

"Binder_3" prio=5 tid=12 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x420a9540 self=0x52f1aa00
| sysTid=8363 nice=0 sched=0/0 cgrp=apps handle=1392030336
| schedstat=( 0 0 0 ) utm=0 stm=0 core=0
#00 pc 000195ac /system/lib/libc.so
at dalvik.system.NativeStart.run(Native Method)

"GLThread 7170" prio=5 tid=11 WAIT
| group="main" sCount=1 dsCount=0 obj=0x420a4cb0 self=0x52f9af90
| sysTid=8362 nice=0 sched=0/0 cgrp=apps handle=1391676976
| schedstat=( 0 0 0 ) utm=1 stm=5 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x420cfa40> (a com.wagenheimer.rabbitjumpandroid.ChartboostGlue$2)
at java.lang.Object.wait(Object.java:364)
at com.wagenheimer.rabbitjumpandroid.ChartboostGlue.StartSession(MonkeyGame.java:2693)
at com.wagenheimer.rabbitjumpandroid.bb_chartboost.g_ChartboostStartSession(MonkeyGame.java:8222)
at com.wagenheimer.rabbitjumpandroid.c_Tgame.p_OnCreate(MonkeyGame.java:2836)
at com.wagenheimer.rabbitjumpandroid.c_GameDelegate.StartGame(MonkeyGame.java:3050)
at com.wagenheimer.rabbitjumpandroid.BBGame.StartGame(MonkeyGame.java:515)
at com.wagenheimer.rabbitjumpandroid.BBAndroidGame.onDrawFrame(MonkeyGame.java:1255)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

"android.hardware.SystemSensorManager$SensorThread" prio=5 tid=10 SUSPENDED
| group="main" sCount=1 dsCount=0 obj=0x420a4380 self=0x52fa6400
| sysTid=8361 nice=-8 sched=0/0 cgrp=apps handle=1391881776
| schedstat=( 0 0 0 ) utm=6 stm=0 core=0
at android.hardware.SystemSensorManager.sensors_data_poll(Native Method)
at android.hardware.SystemSensorManager$SensorThread$SensorThreadRunnable.run(SystemSensorManager.java:132)
at java.lang.Thread.run(Thread.java:856)

"Binder_2" prio=5 tid=9 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x42089860 self=0x52fa3020
| sysTid=8355 nice=0 sched=0/0 cgrp=apps handle=1391729472
| schedstat=( 0 0 0 ) utm=0 stm=0 core=0
#00 pc 000195ac /system/lib/libc.so
at dalvik.system.NativeStart.run(Native Method)

"Binder_1" prio=5 tid=8 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x42089750 self=0x52fa7c00
| sysTid=8354 nice=0 sched=0/0 cgrp=apps handle=1391659472
| schedstat=( 0 0 0 ) utm=0 stm=0 core=1
#00 pc 000195ac /system/lib/libc.so
at dalvik.system.NativeStart.run(Native Method)

"FinalizerWatchdogDaemon" daemon prio=5 tid=7 WAIT
| group="system" sCount=1 dsCount=0 obj=0x42086380 self=0x52fb2ad0
| sysTid=8353 nice=0 sched=0/0 cgrp=apps handle=1391572864
| schedstat=( 0 0 0 ) utm=0 stm=0 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x41855930> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Object.wait(Object.java:364)
at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:214)
at java.lang.Thread.run(Thread.java:856)

"FinalizerDaemon" daemon prio=5 tid=6 WAIT
| group="system" sCount=1 dsCount=0 obj=0x42086200 self=0x52f7d570
| sysTid=8352 nice=0 sched=0/0 cgrp=apps handle=1391739056
| schedstat=( 0 0 0 ) utm=0 stm=0 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x4183ef40> (a java.lang.ref.ReferenceQueue)
at java.lang.Object.wait(Object.java:401)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:169)
at java.lang.Thread.run(Thread.java:856)

"ReferenceQueueDaemon" daemon prio=5 tid=5 WAIT
| group="system" sCount=1 dsCount=0 obj=0x42086080 self=0x52fb1560
| sysTid=8351 nice=0 sched=0/0 cgrp=apps handle=1391882400
| schedstat=( 0 0 0 ) utm=0 stm=0 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x418437c0>
at java.lang.Object.wait(Object.java:364)
at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:129)
at java.lang.Thread.run(Thread.java:856)

"Compiler" daemon prio=5 tid=4 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x42085f70 self=0x52f67a10
| sysTid=8349 nice=0 sched=0/0 cgrp=apps handle=1391663312
| schedstat=( 0 0 0 ) utm=1 stm=0 core=1
at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=3 RUNNABLE
| group="system" sCount=0 dsCount=0 obj=0x42085e60 self=0x52fa1980
| sysTid=8348 nice=0 sched=0/0 cgrp=apps handle=1391731920
| schedstat=( 0 0 0 ) utm=1 stm=0 core=0
at dalvik.system.NativeStart.run(Native Method)

"GC" daemon prio=5 tid=2 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x420858b0 self=0x52f9e1c0
| sysTid=8346 nice=0 sched=0/0 cgrp=apps handle=1306056512
| schedstat=( 0 0 0 ) utm=0 stm=0 core=1
at dalvik.system.NativeStart.run(Native Method)