Android - V10 release candidate

Previous topic - Next topic

MrTAToad

All programs seem to have a long time on the black screen - however, all mine are slow machines.

Moebius

If it's possible to use an ImageView, I think that takes care of the scaling automatically.  If method 2 (delaying the copyAssets() call) works, an xml and another setContentView() should do the job.
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

KermEd

Quote from: quangdx on 2011-May-23
Quote from: MrTAToad on 2011-May-23
384 is to do with spaces - do you have any in the project name or path?  Are you using the latest hotfix?

I downloaded and installed the latest fix,
and as you can see by the output text, there are no spaces in the project name
Code (glbasic) Select
Android=C:\Dropbox\GLBasic\8BitBob\android
I wonder if it's because it starts with a number?

Just copied the code into a new project
EightBitBob and it works fine, so it looks like starting your project name with a number will cause a 384 error.


Nice find!  It was failing for me with a number in the name anywhere with that error.

I tried  the number at the start, middle and end.  It seems to be the path containing a number not just the project name.

Cheers!

okee

Having problems myself, keep getting error :


Code (glbasic) Select
BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.

Total time: 1 second
Android=C:\adveng\distribute\Android
success


If i look in the main_rules.xml of glb directory at line 384 it's
classpathref="jar.libs.ref">

no idea what it references to though.


I'm using GLB 10.051, XP SP3, java_home is set.
Project is in  c:\adveng   no spaces etc

Thanks


okee
Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

MrTAToad

Code (glbasic) Select
Yes, Adroid is failing :

[code[
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.7.917 SN:47ccc3f7 - 3D, NET
Wordcount:21 commands
compile+link:
BUILDSRIPT
Buildfile: C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\build.xml
    [setup] Android SDK Tools Revision 10
    [setup] Project Target: Android 2.2
    [setup] API level: 8
    [setup]
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup]
    [setup] ------------------
    [setup]
    [setup]
    [setup] Importing rules file: tools\ant\main_rules.xml

-set-release-mode:
     [echo] *************************************************
     [echo] ****  Android Manifest has debuggable=true   ****
     [echo] **** Doing DEBUG packaging with RELEASE keys ****
     [echo] *************************************************

-release-obfuscation-check:

-pre-build:

-dirs:
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\bin
    [mkdir] Created dir: C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\gen
    [mkdir] Created dir: C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\bin\classes

-aidl:
     [echo] Compiling aidl files into Java classes...

-renderscript:
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...

-resource-src:
     [echo] Generating R.java / Manifest.java from the resources...

-pre-compile:

compile:
    [javac] Q:\Compiler\platform\android\android-sdk-windows\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:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\bin\classes
    [javac] C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\src\com\glbasic\test\SDLActivity.java:84: cannot find symbol
    [javac] symbol  : variable Configuration
    [javac] location: class org.libsdl.app.SDLActivity
    [javac] int keyboardPresent = (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) ? 1:0;
    [javac]                                                                      ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.

Total time: 3 seconds
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
    [javac] Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android\src\com\glbasic\test\SDLActivity.java:84: cannot find symbol
    [javac] symbol  : variable Configuration
    [javac] location: class org.libsdl.app.SDLActivity
    [javac] int keyboardPresent = (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) ? 1:0;
    [javac]                                                                      ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.

Total time: 1 second
Android=C:\Users\Nicholas\Documents\GLBasic\Test Programs\Test2\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 14.1 sec. Time: 11:05
Build: 1 succeeded.

Moebius

#260
Changing that line:
Code (glbasic) Select
int keyboardPresent = (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) ? 1:0;
to this
Code (glbasic) Select
int keyboardPresent = (getResources().getConfiguration().keyboard != android.content.res.Configuration.KEYBOARD_NOKEYS) ? 1:0;
works compiles (edit: ok haven't run it)...
(http://developer.android.com/reference/android/content/res/Configuration.html#KEYBOARD_NOKEYS)

BTW does GLB compile the app twice?
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

MrTAToad

I dont think so - one is a pre-compile, whilst the second part is the actual compilation...

Moebius

That seems right.  Could have sworn I used to see two "BUILDSCRIPT"s in the output...
Anyway it seems Android apps (even Hello World) won't run with 10.051.  It compiles (with the slight addition to SDLActivity.java), installs, and force closes when the app is opening.
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

MrTAToad

Any idea what is in the Log ?

Moebius

#264
Relevant section of the log:
Code (glbasic) Select
I/ActivityManager(  132): Start proc com.jamespayor.generaltesting for activity com.jamespayor.generaltesting/org.libsdl.app.SDLActivity: pid=1821 uid=10110 gids={3003}
I/Launcher(  239): onWindowFocusChanged(false)
W/ResourceType(  132): Skipping entry 0x7f040002 in package table 0 because it is not complex!
D/Launcher(  239): It's image wallpaper. suggestDesiredDimensions(-1,-1)
W/ResourceType(  132): Skipping entry 0x7f040003 in package table 0 because it is not complex!
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libSDL.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libSDL.so 0x40512c88
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libSDL_image.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libSDL_image.so 0x40512c88
D/dalvikvm( 1821): No JNI_OnLoad found in /data/data/com.jamespayor.generaltesting/lib/libSDL_image.so 0x40512c88, skipping init
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libmikmod.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libmikmod.so 0x40512c88
D/dalvikvm( 1821): No JNI_OnLoad found in /data/data/com.jamespayor.generaltesting/lib/libmikmod.so 0x40512c88, skipping init
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libSDL_mixer.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libSDL_mixer.so 0x40512c88
D/dalvikvm( 1821): No JNI_OnLoad found in /data/data/com.jamespayor.generaltesting/lib/libSDL_mixer.so 0x40512c88, skipping init
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libSDL_ttf.so 0x40512c88
D/dalvikvm( 1821): Added shared lib /data/data/com.jamespayor.generaltesting/lib/libSDL_ttf.so 0x40512c88
D/dalvikvm( 1821): No JNI_OnLoad found in /data/data/com.jamespayor.generaltesting/lib/libSDL_ttf.so 0x40512c88, skipping init
D/dalvikvm( 1821): Trying to load lib /data/data/com.jamespayor.generaltesting/lib/libmain.so 0x40512c88
W/dalvikvm( 1821): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/libsdl/app/SDLActivity;
W/dalvikvm( 1821): Class init failed in newInstance call (Lorg/libsdl/app/SDLActivity;)
D/AndroidRuntime( 1821): Shutting down VM
W/dalvikvm( 1821): threadid=1: thread exiting with uncaught exception (group=0x40015578)
E/AndroidRuntime( 1821): FATAL EXCEPTION: main
E/AndroidRuntime( 1821): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 1821):        at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 1821):        at java.lang.Class.newInstance(Class.java:1409)
E/AndroidRuntime( 1821):        at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime( 1821):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1540)
E/AndroidRuntime( 1821):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1642)
E/AndroidRuntime( 1821):        at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 1821):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:932)
E/AndroidRuntime( 1821):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1821):        at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1821):        at android.app.ActivityThread.main(ActivityThread.java:3651)
E/AndroidRuntime( 1821):        at java.lang.reflect.Method.invokeNative(NativeMethod)
E/AndroidRuntime( 1821):        at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 1821):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
E/AndroidRuntime( 1821):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
E/AndroidRuntime( 1821):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1821): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]:    84 cannot locate 'g_androidKeyboard'...
E/AndroidRuntime( 1821):
E/AndroidRuntime( 1821):        at java.lang.Runtime.loadLibrary(Runtime.java:434)
E/AndroidRuntime( 1821):        at java.lang.System.loadLibrary(System.java:554)
E/AndroidRuntime( 1821):        at org.libsdl.app.SDLActivity.<clinit>(SDLActivity.java:50)
E/AndroidRuntime( 1821):        ... 15 more
W/ActivityManager(  132):   Force finishing activity com.jamespayor.generaltesting/org.libsdl.app.SDLActivity
E/        (  132): Dumpstate > /data/log/dumpstate_app_com_jamespayor_generaltesting_error


Extremely relevant bits:
- Class init failed in newInstance call
- Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]:    84 cannot locate 'g_androidKeyboard'...

EDIT: Also, replacing the amended line in SDLActivity.java with "int keyboardPresent = 0;" has no effect on the problem, so it's buried somewhere else.
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

MrTAToad

#265
Sounds like something in the SDL package that should be there isn't :)  Wonder if the minimum Android OS spec. has been updated to 2.3... :blink:

ByteByter

Quote from: Serpent on 2011-Jul-16
Changing that line:
Code (glbasic) Select
int keyboardPresent = (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS) ? 1:0;
to this
Code (glbasic) Select
int keyboardPresent = (getResources().getConfiguration().keyboard != android.content.res.Configuration.KEYBOARD_NOKEYS) ? 1:0;
works compiles (edit: ok haven't run it)...
(http://developer.android.com/reference/android/content/res/Configuration.html#KEYBOARD_NOKEYS)

BTW does GLB compile the app twice?
This does indeed fix the compiling issue, however the app crashes prior to even executing one line of user code. :(
Also, at least with me, there is no longer an icon for the App once installed...either that or it's a completely transparent Icon  ::)
Quote from: Serpent on 2011-Jul-16
That seems right.  Could have sworn I used to see two "BUILDSCRIPT"s in the output...
Anyway it seems Android apps (even Hello World) won't run with 10.051.  It compiles (with the slight addition to SDLActivity.java), installs, and force closes when the app is opening.
Indeed I can confirm this, the app crashes while loading.
...Does anyone know if you can roll back to say 10.004 or whatever the last beta was easily?

MrTAToad

Yes, just download the beta again...

Moebius

Extracting one of the updater's backups seems to work for reverting as well (see the program files folder).
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

ByteByter

Quote from: Serpent on 2011-Jul-17
Extracting one of the updater's backups seems to work for reverting as well (see the program files folder).
Thanks, this is more of what I was looking for, as I knew Glbasic copied a backup somewhere, I just didn't know where. Thanks :)