OK so I tried a few things this morning.
This is the code immediately after the includes and variable declarations:
t# = GetMilliseconds()
repeat
Print(t#)
Sync()
until GetPointerPressed() = 1
SetOrientationAllowed(1,1,0,0)
TimedPauseSync(100)
if GetFileExists(sGAME_DATA_FILE) = 0
SetPrintSize(1.5)
Print("Please wait..." + str(timer())) :Sync()
TimedPause(400)
endif
What happens stinks. On Nexus 7 about 3 out of 5 first runs are OK the first timer shows 1.5 seconds on average. On the failed attempts the first timer does not even show, but when I return to the app it shows all of the elapsed time, so the interpreter is up and running and counting time.
On my HTC running android 2.3.4 things are much worse, but similar. If the app fails to load I can return to it and the timer shows the elapsed time, but it never shows the first timer. If it does load then the first timer shows around 3 seconds. If the phone is plugged in to USB and mounted as a disk drive so that I can run Eclipse debugging then the first run of the app fails about 90% of the time. The logcat reports missing images like crazy and file 0 not exist. This is during the first timer before my app calls any file loads.
While the HTC is plugged in and is not mounted as a USB drive it also fails to load on the first run, but does not complain of missing images or file 0 not exists.
I get a lot of messages like this:
11-06 10:43:27.510: E/Surface(14098): surface (identity=19644) is invalid, err=-19 (No such device)
And then it stops when setting the resolution...
Here;s the log cat of it stopping and then a little later you can see where I exit and return to the app at that point all runs fine.
11-06 10:40:38.725: D/SensorGUI(14098): SensorChannel(const Parcel& data): mSendFd = -1, mReceiveFd = 51
11-06 10:40:38.755: D/ATRecorder(14098): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4052df90
11-06 10:40:38.785: I/native-activity(14098): App Resumed
11-06 10:40:38.845: I/native-activity(14098): Window Init
11-06 10:40:38.915: D/libEGL(14098): loaded /system/lib/egl/libGLES_android.so
11-06 10:40:39.065: D/libEGL(14098): loaded /system/lib/egl/libEGL_adreno200.so
11-06 10:40:39.346: D/libEGL(14098): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
11-06 10:40:39.346: D/libEGL(14098): loaded /system/lib/egl/libGLESv2_adreno200.so
11-06 10:40:39.696: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 16, W: 1511, F: 1, S: 0, R: 7
11-06 10:40:39.696: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 24, W: 1511, F: 1, S: 8, R: 7
11-06 10:40:39.696: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 16, W: 1511, F: 1, S: 0, R: 7
11-06 10:40:39.696: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 24, W: 1511, F: 1, S: 8, R: 7
11-06 10:40:39.726: E/native-activity(14098): vivow
11-06 10:40:39.726: E/native-activity(14098): ADR6350
11-06 10:40:39.746: W/native-activity(14098): Result: 0
11-06 10:40:39.816: W/native-activity(14098): Width: 480 Height: 800
11-06 10:40:39.816: W/native-activity(14098): Initialising
11-06 10:40:39.816: W/dalvikvm(14098): dvmFindClassByName rejecting 'com/thegamecreators/agk_player/AGKHelper'
11-06 10:40:40.697: V/ExtendedExtractor(14098): Failed to open MM_PARSER_LIB, dlerror = Cannot load library: load_library[1105]: Library 'libmmparser.so' not found
11-06 10:40:40.697: V/ExtendedExtractor(14098): Failed to open MM_PARSER_LITE_LIB, dlerror = Cannot load library: load_library[1105]: Library 'libmmparser_lite.so' not found
11-06 10:40:40.697: I/AudioSystem(14098): getting audio flinger
11-06 10:40:40.717: I/AudioSystem(14098): returning new audio session id
11-06 10:40:41.958: I/native-activity(14098): Gained Focus
11-06 10:40:41.968: D/szipinf(14098): Initializing inflate state
11-06 10:40:41.978: D/szipinf(14098): Initializing inflate state
11-06 10:40:41.978: D/szipinf(14098): Initializing zlib to inflate
11-06 10:40:45.432: I/native-activity(14098): Save State
11-06 10:40:45.522: I/native-activity(14098): App Paused
11-06 10:40:45.572: I/native-activity(14098): Lost Focus
11-06 10:40:45.572: I/native-activity(14098): Gained Focus
11-06 10:40:45.592: I/native-activity(14098): App Resumed
11-06 10:40:45.592: E/Surface(14098): surface (identity=19643) is invalid, err=-19 (No such device)
11-06 10:40:45.592: E/Surface(14098): surface (identity=19643) is invalid, err=-19 (No such device)
11-06 10:40:45.592: E/Surface(14098): surface (identity=19643) is invalid, err=-19 (No such device)
11-06 10:40:45.602: E/Surface(14098): surface (identity=19643) is invalid, err=-19 (No such device)
11-06 10:40:45.602: E/Adreno200-EGL(14098): egliSwapWindowSurface: unable to dequeue native buffer
11-06 10:40:45.602: E/Surface(14098): [Surface] using an invalid surface, identity=19643 should be 19644
11-06 10:40:45.602: E/Surface(14098): [Surface] using an invalid surface, identity=19643 should be 19644
11-06 10:40:45.602: E/Adreno200-EGL(14098): egliGetNativeWindowSize: unable to dequeue native buffer
11-06 10:40:45.602: E/Surface(14098): [Surface] using an invalid surface, identity=19643 should be 19644
11-06 10:40:45.602: E/Surface(14098): [Surface] using an invalid surface, identity=19643 should be 19644
11-06 10:40:45.602: E/Adreno200-EGL(14098): eglLockWindowSurface: unable to dequeue native buffer
11-06 10:40:45.602: E/Surface(14098): [Surface] using an invalid surface, identity=19643 should be 19644
11-06 10:40:45.602: E/Surface(14098): [Surface] using an invalid surface, identity=19643 should be 19644
11-06 10:40:45.602: E/Adreno200-EGL(14098): egliGetNativeWindowSize: unable to dequeue native buffer
11-06 10:40:45.602: I/native-activity(14098): Window Terminate
11-06 10:40:45.602: E/Surface(14098): [Surface] using an invalid surface, identity=19643 should be 19644
11-06 10:40:45.602: E/Surface(14098): [Surface] using an invalid surface, identity=19643 should be 19644
11-06 10:40:45.602: E/Adreno200-EGL(14098): eglLockWindowSurface: unable to dequeue native buffer
11-06 10:40:45.672: E/Surface(14098): [Surface] using an invalid surface, identity=19643 should be 19644
11-06 10:40:45.672: I/native-activity(14098): Window Init
11-06 10:40:45.732: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 16, W: 1511, F: 1, S: 0, R: 7
11-06 10:40:45.732: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 24, W: 1511, F: 1, S: 8, R: 7
11-06 10:40:45.732: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 16, W: 1511, F: 1, S: 0, R: 7
11-06 10:40:45.732: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 24, W: 1511, F: 1, S: 8, R: 7
11-06 10:40:45.732: E/native-activity(14098): vivow
11-06 10:40:45.742: E/native-activity(14098): ADR6350
11-06 10:40:45.752: W/native-activity(14098): Result: 0
11-06 10:40:45.772: W/native-activity(14098): Width: 480 Height: 800
11-06 10:40:45.772: W/native-activity(14098): Updating
11-06 10:40:46.092: W/Video(14098): Set Dimensions
11-06 10:40:46.122: E/Video(14098): Set Dimensions X:0 Y:0 Width:480 Height:800
11-06 10:41:08.404: E/NativeActivity(14098): channel '40b0c208 com.naplandgames.wordspionage/android.app.NativeActivity (client)' ~ Failed to receive dispatch signal. status=-11
11-06 10:41:08.474: E/NativeActivity(14098): channel '40b0c208 com.naplandgames.wordspionage/android.app.NativeActivity (client)' ~ Failed to receive dispatch signal. status=-11
11-06 10:43:25.938: E/NativeActivity(14098): channel '40b0c208 com.naplandgames.wordspionage/android.app.NativeActivity (client)' ~ Failed to receive dispatch signal. status=-11
11-06 10:43:25.998: E/NativeActivity(14098): channel '40b0c208 com.naplandgames.wordspionage/android.app.NativeActivity (client)' ~ Failed to receive dispatch signal. status=-11
11-06 10:43:27.149: I/native-activity(14098): Save State
11-06 10:43:27.149: I/native-activity(14098): App Paused
11-06 10:43:27.209: I/native-activity(14098): Lost Focus
11-06 10:43:27.490: I/native-activity(14098): Window Terminate
11-06 10:43:27.490: E/Surface(14098): surface (identity=19644) is invalid, err=-19 (No such device)
11-06 10:43:27.510: E/Surface(14098): surface (identity=19644) is invalid, err=-19 (No such device)
11-06 10:43:27.510: E/Surface(14098): surface (identity=19644) is invalid, err=-19 (No such device)
11-06 10:43:30.883: I/native-activity(14098): App Resumed
11-06 10:43:30.903: I/native-activity(14098): Window Init
11-06 10:43:30.913: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 16, W: 1511, F: 1, S: 0, R: 7
11-06 10:43:30.913: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 24, W: 1511, F: 1, S: 8, R: 7
11-06 10:43:30.913: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 16, W: 1511, F: 1, S: 0, R: 7
11-06 10:43:30.933: W/native-activity(14098): R: 8, G: 8, B: 8, A: 8, D: 24, W: 1511, F: 1, S: 8, R: 7
11-06 10:43:30.933: E/native-activity(14098): vivow
11-06 10:43:30.933: E/native-activity(14098): ADR6350
11-06 10:43:30.943: W/native-activity(14098): Result: 0
11-06 10:43:30.973: W/native-activity(14098): Width: 480 Height: 800
11-06 10:43:30.973: W/native-activity(14098): Updating
11-06 10:43:31.574: W/Video(14098): Set Dimensions
11-06 10:43:31.574: E/Video(14098): Set Dimensions X:0 Y:0 Width:480 Height:800
11-06 10:43:31.574: I/native-activity(14098): Gained Focus
11-06 10:43:34.306: E/NativeActivity(14098): channel '40b0c208 com.naplandgames.wordspionage/android.app.NativeActivity (client)' ~ Failed to receive dispatch signal. status=-11
11-06 10:43:34.336: E/NativeActivity(14098): channel '40b0c208 com.naplandgames.wordspionage/android.app.NativeActivity (client)' ~ Failed to receive dispatch signal. status=-11
11-06 10:43:34.366: E/NativeActivity(14098): channel '40b0c208 com.naplandgames.wordspionage/android.app.NativeActivity (client)' ~ Failed to receive dispatch signal. status=-11
11-06 10:43:38.911: I/native-activity(14098): Save State
11-06 10:43:38.911: I/native-activity(14098): App Paused
11-06 10:43:38.931: I/native-activity(14098): Lost Focus
11-06 10:43:39.081: I/native-activity(14098): Window Terminate
11-06 10:43:39.081: E/Surface(14098): surface (identity=19647) is invalid, err=-19 (No such device)
11-06 10:43:39.091: E/Surface(14098): surface (identity=19647) is invalid, err=-19 (No such device)
11-06 10:43:39.091: E/Surface(14098): surface (identity=19647) is invalid, err=-19 (No such device)
11-06 10:44:05.857: D/dalvikvm(14098): GC_EXPLICIT freed 92K, 47% free 2883K/5379K, external 0K/0K, paused 77ms
I found
this in regards to the failed dispatch signal. Those messages are happening when I tap the screen while it is blank.
The app consistently stops at this message on first load:
E/Video(14098): Set Dimensions X:0 Y:0 Width:480 Height:800
I sent an email to Paul on Friday regarding this and haven't heard back yet. I imagine he's deep into v2. My code to have a timed delay on first load has not helped... this is likely due to the app not initiating correctly even before the "please wait" subroutine is even called.
I noticed that I'm using NDK r9 and the instructions say to use r6.
So I downloaded and attempted to do the cygwin compile with r6 and it says that the file main.o is the wrong format and it cannot make libandroid_player.so
Here's the full log
In file included from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/AGKCommands.h:4,
from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.h:19,
from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/Core.cpp:3:
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/AGKCommandsTable106.h:1:38: warning: backslash-newline at end of file
In file included from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.h:22,
from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/Core.cpp:3:
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/AGKCommandsTable.cpp:1:31: warning: backslash-newline at end of file
In file included from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/Core.cpp:4:
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/CoreForApp.h: In function 'void RuntimError(const char*)':
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/CoreForApp.h:106: warning: deprecated conversion from string constant to 'char*'
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/CoreForApp.h:118: warning: NULL used in arithmetic
In file included from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/AGKCommands.h:4,
from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.h:19,
from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.cpp:3:
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/AGKCommandsTable106.h:1:38: warning: backslash-newline at end of file
In file included from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.h:22,
from C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.cpp:3:
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/AGKCommandsTable.cpp:1:31: warning: backslash-newline at end of file
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.cpp: In member function 'void app::Begin()':
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.cpp:356: warning: NULL used in arithmetic
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.cpp: In member function 'void app::Loop()':
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/jni/../../interpreter/interpreter.cpp:2357: warning: deprecated conversion from string constant to 'char*'
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/android-ndk-r6/toolchains/x86-4.4.3/prebuilt/windows/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld.exe: C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: Relocations in generic ELF (EM: 40)
C:/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/objs/android_player/main.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [/cygdrive/c/@Deployment/android/AGK10819/IDE/apps/interpreter_android_2_r6/obj/local/armeabi/libandroid_player.so] Error 1
So if I can't compile with NDK r6 then I'm out of ideas.