GLBasic forum

Main forum => GLBasic - en => Topic started by: Beginner on 2014-Apr-19

Title: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-19
Hey guys,

yet another android compiler problem thread:

I just installed GLB 12.096. This is what the compiler says when trying to compile for android:

Quote
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:30cee243 - 3D, NET
Wordcount:173 commands
compile+link:
running glb_build.bat
Using ANDROID_TARGET="android-8"
You can use "C:\Projekte\GLBasic\minion_on_the_run\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
%ANDROIDSDK% not set. Using GLBasic's default target-8, Android 2.2



BUILD STAGE 1: Compile and pack RELEASE
Updated and renamed default.properties to project.properties
Updated local.properties
Added file C:\Projekte\GLBasic\minion_on_the_run\distribute\Android\build.xml
Updated file C:\Projekte\GLBasic\minion_on_the_run\distribute\Android\proguard.cfg

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:539: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:568: null returned: 1

Total time: 1 second
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 2: Build DEBUG and install on device
     [echo] Gathering info for glbasic...
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Handling aidl files...
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:539: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:568: null returned: 1

Total time: 1 second
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
finished Android build-script.
Android=C:\Projekte\GLBasic\minion_on_the_run\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 8.4 sek. Zeit: 08:39
Erstellen: 1 erfolgreich.

Any ideas?

Title: Re: can't compile for android on 12.096
Post by: Schranz0r on 2014-Apr-19
did you get the *.apk in the distribute-folder?
Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-19
no. There is no apk in the "\distribute\android\bin" folder
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-19
did you installed Java SDK?

http://www.oracle.com/technetwork/java/javaee/downloads/java-ee-sdk-6u3-jdk-7u1-downloads-523391.html

Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-19
Yes, Java jdk1.7.0_09 was installed and JAVA_HOME was set.

I just updated to jre7 and changed the JAVA_HOME setting. But no result. Still no APK.

Some month ago there was no problem in compiling my apps for android. All worked very well. But then I took a GLB. Some days ago I tried again but it doesn't work anymore. I already removed the android sdk and installed a new one. Tried differend versions.

I guess the problem is somewhere on the android-sdk.

Today I installed GLB 12.096 completely new.

This is the present error I get:
Quote
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:30cee243 - 3D, NET
Wordcount:173 commands
compile+link:
running glb_build.bat
Using ANDROID_TARGET="android-8"
You can use "C:\Projekte\GLBasic\minion_on_the_run\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
%ANDROIDSDK% not set. Using GLBasic's default target-8, Android 2.2



BUILD STAGE 1: Compile and pack RELEASE
Updated project.properties
Updated local.properties
Updated file C:\Projekte\GLBasic\minion_on_the_run\distribute\Android\build.xml
Updated file C:\Projekte\GLBasic\minion_on_the_run\distribute\Android\proguard.cfg

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:539: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:568: null returned: 1

Total time: 1 second
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 2: Build DEBUG and install on device
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre7\lib\tools.jar
     [echo] Gathering info for glbasic...
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Handling aidl files...
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:539: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:568: null returned: 1

Total time: 1 second
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
finished Android build-script.
Android=C:\Projekte\GLBasic\minion_on_the_run\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 6.5 sek. Zeit: 11:42
Erstellen: 1 erfolgreich.
Title: Re: can't compile for android on 12.096
Post by: MrTAToad on 2014-Apr-19
I suspect its to do with a lack of suitable icon in the project directory.  You need at least the icon.png file
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-19
confirmed.

Its a major bug in glbasic 12.096 (here im downloaded the stock glbasic and installed on the default directoy, where that one im uses with AE is in different directory).

even when icon.png is added in the main dir (in C:\Projekte\GLBasic\minion_on_the_run), its dosent create icons correctly and only creating the extra icons in that dir, but is nwer moved into the Android Resources dir and hence the compile fails.

That is a important bug.

This issue is fixed with AndroidExtras, which uses a much newer more modern android SDK (api-18 rather than api-8).
Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-19
so what do I exactly have to do to solve this problem?
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-19
try to add icon.png first to the folder with your source files and eventuelly removes other png icons that might been there (etc im looking on this problem for a workaround).
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-19
Today its confirmed - SDK Android 2.2 (API-8), which is used by stock glbasic is simply out of date, and does not work anymore!!!

Im found its a icon resource issues, and im could not get it fixed and diddent find a sovle at all, which is quite crap. Im guess its due glbasic v12.0 adding quite different size icons, which is NOT supported by API-8, but require around API-10 (Android 3.0) to work. API-8 is also soooo old anyway (its near 4 years old).

Here im have tested with stock glbasic api-8 against glbasic with AndroidExtras with api-18. Karma Miwa did have extractly same compile issues after im deleted all icons except icon.png, and got stock there as well, but only if im tried to do that with api-8, but worked fine with api-18 (today im do fixes other icon issues, so you have more control over your icons, but this is a different issue).

Howover in the end, upgrade SDK to API-18 (which is Android 4.3) is quite easy and only require to replace a folder in glbasic folder (GLBasic_v12\Compiler\platform\android). The upgrade can been found here:
http://www.glbasic.com/forum/index.php?topic=9644.0

please note:
Assests files might fails, but that due missing Android.Check_Asset("yourfile") function, which is require before loading each media file (to skips the ... loading screen, which was unstable). That can been seen how to do that in AndroidSample project. Its not that hard in the end.

PS. Even its compiles with api-18, your app should still works on devices from api-9 and up, but supporting api-8 and below is deprecated.








Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-20
At first I want to thank you for your efforts. This forum is great. HAPPY EASTER!!!  :booze:

Sadly the problem isn't solved yet.  :(

I used your link posted above and downloaded SDK API-18.
Then I took only the "android-sdk-windows" folder and made a copy to "C:\Program Files\GLBasic_v12\Compiler\platform\android".

The old "android-sdk-windows" in the GLB Folder I renamed to "BAK_..." before.

I deleted the distribute folder in my project and also all icons except "icon.png".

Then I tried again to compile (please see my notes in red below):

Quote

_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:30cee243 - 3D, NET
Wordcount:173 commands
compile+link:
running glb_build.bat
Using ANDROID_TARGET="android-8"
You can use "C:\Projekte\GLBasic\minion_on_the_run\distribute\Android\glb_android_build.bat" to change the API level and SDK path. (this file doesn't exist in the mentioned folder)
%ANDROIDSDK% not set. (what does that mean?) Using GLBasic's default target-8, Android 2.2



BUILD STAGE 1: Compile and pack RELEASE
Error: Target id 'android-8' is not valid. Use 'android.bat list targets' to get the target ids. (what is the path to android.bat?)
Build failed
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 2: Build DEBUG and install on device
Buildfile: build.xml does not exist!
Build failed
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
finished Android build-script.
Android=C:\Projekte\GLBasic\minion_on_the_run\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 8.5 sek. Zeit: 08:58
Erstellen: 1 erfolgreich.

Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-20
you need to replace the whole android folder, not just android-sdk-windows. That why im included the full files this time. There is updated to quite many other files outside the sdk folder as well and many new Java code files to supports various things.

That why glbasic compiler is confuction to try to compile with api-8, which dosent exists anymore and then fails.
Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-20
ok.

1st try:
I renamed the old android folder to "BAK_android". Then I put a copy of the new Android folder into place.
When I try to compile now I get a message "cc1plus.exe funktioniert nicht mehr. Es wird nach einer Lösung des Problems gesucht." (cc1plus.exe doesn't work anymore. Searching for a solution of the problem.")

2nd try:
I removed the new android folder and put the old android folder back in place. Then I put a copy of the new android folder into the old android folder and told windows to replace the old files by the new.
In the end the same here -> cc1plus.exe doesn't work anymore. 

I'm completely at a loss.  I just want to compile for android... why is it so hard???  :'(


Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-20
Sorry to delete posts. im did that to avoid various confuction. Sorry about that.

Just now im have updated Android Extras with SDK v4.3 Upgrade by using a InnoSetup installation script, which is being to been uploaded, which should been much better than the manual work, which might fail and get some security warnings (which im thinks that happens with the c++ exe one).

So uninstall and reinstall glbasic v12 (and eventuely make sure the compile fails correctly with the build error), and directly install this file top to your glbasic directory (the main one):
https://www.dropbox.com/s/xxy4ysqfj618f7u/setup-androidextras2-2-withsdk18-glbasic.zip

This only replace files in android/android-sdk-windows, few files in android/bin and android/templateproj. Rest is unchanged and not need updating at all. Android Extras - API 18 do just contain a sample project how to uses AE.

In the future all SDK upgrade will uses the InnoSetup script.

This is also posted in the AE section as well.

Hope that works better to fix the sdk-8 issue, which dosent work anymore with glbasic.
Title: Re: can't compile for android on 12.096
Post by: SnooPI on 2014-Apr-20
I personally have had many problems with jdk 1.7.
Every time I went back to 1.6 and most of the problems were solved.
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-21
It's not that issue here. I'm uses JFK 1.7. The original issue was icon issue incompatible eith API-8 sdk.
Title: Re: can't compile for android on 12.096
Post by: SnooPI on 2014-Apr-21
keep cool spacefractal. it was just related to my personal experience and maybe help Beginner ;)
Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-21
this is no fun anymore... It seems that I'm the dumbest assumable user!

I took the pc of my girlfriend (i5 with win7) and installed GLB 12.096 on it.
Then I used your InnoSetup to update some files.

Then I installed JDK to "C:\Program Files\java\jdk1.8.0_05" and set environment variable (Umgebungsvariable) of JAVA_HOME to "C:\Program Files\java\jdk1.8.0_05\bin\"

this is the result:
Quote
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:682fc331 - 3D, NET
Wordcount:173 commands
compile+link:

running glb_build.bat
Using ANDROID_TARGET="android-18"
You can use "C:\Projekte\glbasic\minion_on_the_run\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
%ANDROIDSDK% not set. Using GLBasic's default target-14, Android 4.0



.
BUILD STAGE 1: Create Icons for various size
icon.png was found in the source dir, but not icon128.png.
icon.png should been 512x512px in size and icon128.png is in 128x128px.
Im will do use icon.png for resizing for tablet support.
ouya_icon.png is missing in source dir (if you use OUYA)
The icon size for OUYA is 732x412 px size.
BUILD STAGE 2: Start compiler (android.bat)
Q:\Compiler\platform\android\bin\..\android-sdk-windows
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Updated project.properties
Updated local.properties
Added file C:\Projekte\glbasic\minion_on_the_run\distribute\Android\build.xml
.
BUILD STAGE 3: Build a debug build
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre8\lib\tools.jar
   [subant] No sub-builds to iterate on

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:720: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:734: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre8"

Total time: 5 seconds
.
BUILD STAGE 4: Build a release build
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre8\lib\tools.jar
   [subant] No sub-builds to iterate on

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:720: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:734: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre8"
THIS IS CRAP!!! I SET JAVA_HOME TO C:\Program Files\java\jdk1.8.0_05\bin\

Total time: 5 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
HOW TO INSTALL? Install by invoke this command:
"Q:\Compiler\platform\android\bin\..\android-sdk-windows\platform-tools\adb.exe" install -r "C:\Projekte\glbasic\minion_on_the_run\distribute\Android/bin/glbasic-debug.apk"
.
HOW TO SIGN? Sign it by invoke this command:
"Q:\Compiler\platform\android\bin\glb_code_sign.bat" "C:\Projekte\glbasic\minion_on_the_run\distribute\Android"
.
Android=C:\Projekte\glbasic\minion_on_the_run\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 22.2 sek. Zeit: 11:05
Erstellen: 1 erfolgreich.


Yesterday I took also a notebook with Win7 and installed GLB and JAVA but also on the notebook I didn't get the compiler to work!!!

This sucks. :'(



Why is it that the compiler says JAVA_HOME is "C:\Program Files\Java\jre8"?
I set JAVA_HOME to "C:\Program Files\java\jdk1.8.0_05\bin\". Is there a file in GLB that sets another JAVA_HOME?

Am I the only person who can't compile for android?
@all other GLB 12 users: did you try to complie for android with success?

Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-21
The document did say it quite well, so the compiler could not find the sdk, due its tried to find it in bin/bin.

So C:\Program Files\java\jdk1.8.0_05\bin should have been C:\Program Files\java\jdk1.8.0_05

etc mine is set to C:\Program Files (x86)\Java\jdk1.7.0_25, and there is no issues with that jdk.

Im did do have similar trouble, but that was with glbasic v10, where jdk1.7 diddent works well, but have not have those kind of trouble with glbasic v12. So that part is fixed.

PS. Im take on a mini vaccation and will been away in few days, so im might been offline (this is nothing due this issue at all, im just away from my computer).

PPS. Make sure to look on the AndroidSample Project, because there is few more code required to get working.
Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-21
I changed JAVA_HOME again.

The good news is that now I get an APK file. But there are still a lot of errors and warnings (see below).

The bad news is that the files doesn't work properly. On Samsung Galaxy S3 the app only shows a white screen.

I wrote a little "hello world" code and this works fine. But loadfont and setfont commands seems to be ignored.

It seems that there are problems on 2d commands.

Quote
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:682fc331 - 3D, NET
Wordcount:9 commands
compile+link:

running glb_build.bat
Using ANDROID_TARGET="android-18"
You can use "C:\Projekte\glbasic\GLBasic\test\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
%ANDROIDSDK% not set. Using GLBasic's default target-14, Android 4.0



.
BUILD STAGE 1: Create Icons for various size
icon.png was found in the source dir, but not icon128.png.
icon.png should been 512x512px in size and icon128.png is in 128x128px.
Im will do use icon.png for resizing for tablet support.
ouya_icon.png is missing in source dir (if you use OUYA)
The icon size for OUYA is 732x412 px size.
BUILD STAGE 2: Start compiler (android.bat)
Q:\Compiler\platform\android\bin\..\android-sdk-windows
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Updated project.properties
Updated local.properties
Added file C:\Projekte\glbasic\GLBasic\test\distribute\Android\build.xml
.
BUILD STAGE 3: Build a debug build
   [subant] No sub-builds to iterate on
    [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] C:\Projekte\glbasic\GLBasic\test\distribute\Android\src\com\glbasic\test\SDLActivity.java:849: warning: [deprecation] getBlockSize() in StatFs has been deprecated
    [javac]          {   int blockSize = stat.getBlockSize();
    [javac]                                  ^
    [javac] C:\Projekte\glbasic\GLBasic\test\distribute\Android\src\com\glbasic\test\SDLActivity.java:850: warning: [deprecation] getAvailableBlocks() in StatFs has been deprecated
    [javac]             int availableBlocks = stat.getAvailableBlocks();
    [javac]                                       ^
    [javac] 5 warnings

BUILD SUCCESSFUL
Total time: 1 minute 40 seconds
.
BUILD STAGE 4: Build a release build
   [subant] No sub-builds to iterate on
    [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: C:\Projekte\glbasic\GLBasic\test\distribute\Android\src\com\glbasic\test\SDLActivity.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 3 warnings
[proguard] Note: there were 2069 duplicate class definitions.
[proguard]       You should check if you need to specify additional program jars.
[proguard] Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [iap_plugin-dev-13.0.0.jar:META-INF/MANIFEST.MF])
[proguard] Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [android-support-v4.jar:META-INF/MANIFEST.MF])
[proguard] Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [google-play-services.jar:META-INF/MANIFEST.MF])
[proguard] Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [gson-2.2.2.jar:META-INF/MANIFEST.MF])
[proguard] Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [ouya-sdk.jar:META-INF/MANIFEST.MF])
[proguard] Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [in-app-purchasing-1.0.3.jar:META-INF/MANIFEST.MF])

BUILD SUCCESSFUL
Total time: 1 minute 4 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
HOW TO INSTALL? Install by invoke this command:
"Q:\Compiler\platform\android\bin\..\android-sdk-windows\platform-tools\adb.exe" install -r "C:\Projekte\glbasic\GLBasic\test\distribute\Android/bin/glbasic-debug.apk"
.
HOW TO SIGN? Sign it by invoke this command:
"Q:\Compiler\platform\android\bin\glb_code_sign.bat" "C:\Projekte\glbasic\GLBasic\test\distribute\Android"
.
Android=C:\Projekte\glbasic\GLBasic\test\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 173.7 sek. Zeit: 12:29
Erstellen: 1 erfolgreich.


Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-21
Yes there is errors, but that normal. Don't worry about them.

Checkout readme.txt for the important about assest files, it's require a bit of integration to get working. This is required to skips the .... Loading screen. You can also checkout android extras sample and see how the checkAssest() function works. That is required now.

The android sample is in th api 18 dir under android folder. Check it out.

But at least the compiler works, now it's time to get AndroidExtras integrated.

I'm out now, but get Ian price to help you. I'm back in few days.
Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-21
Many thanks for your patience and your kind help. Have some nice holidays.
Title: Re: can't compile for android on 12.096
Post by: MrTAToad on 2014-Apr-21
Android does work fine - those errors could be due to how you use AndroidExtras, so I can't help there unfortunately.

You MUST use the 32-bit Java SDK

LoadFont and SetFont work fine - what you need to do is make sure that all graphic files and other stuff are in the Media directory.  Also note that files are case-sensitive.

If your Android device is set to allow unknown sources, could you give this test program a quick try : http://www.gipegu.com/TSetup/Demo_release.apk (http://www.gipegu.com/TSetup/Demo_release.apk)

I tried it on my ICS Tokio Techbook II (apparently Sega Amusements give these out as prizes in Japan), and it zips along at a fair old rate.
Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-Apr-21
the demo_release.apk works fine on my S3. Reminds me to a rollercoaster.  :)
Title: Re: can't compile for android on 12.096
Post by: Ian Price on 2014-Apr-21
Yeah, make sure you use the asset system of Android Extras as that makes loading and using media MUCH easier than GLBasic's own commands (well, you still use them technically, but GLB has major path issues with Android, which AE solves).

The good thing about Android Extras is it also gives you much more flexibility over the Android formats you can compile for (including OUYA and GameStick) and allows different controllers to be used. It also allows In App Payments, so that you can offer a free demo and users can buy the full package in-game.

As SpaceFractal said, if you've got any questions about AE then I can help with that. :)
Title: Re: can't compile for android on 12.096
Post by: MrTAToad on 2014-Apr-21
Quote from: Beginner on 2014-Apr-21
the demo_release.apk works fine on my S3. Reminds me to a rollercoaster.  :)
Its going to be my new game :)
Title: Re: can't compile for android on 12.096
Post by: SnooPI on 2014-Apr-21
Quote from: MrTAToad on 2014-Apr-21
Android does work fine - those errors could be due to how you use AndroidExtras, so I can't help there unfortunately.

it's probably why I have no problem with 12.096 and jdk 1.6 : I don't use AndroidExtra (and probably that's why I could not understand the icon problem of spacefractal)

Quote from: spacefractal on 2014-Apr-19
Today its confirmed - SDK Android 2.2 (API-8), which is used by stock glbasic is simply out of date, and does not work anymore!!!

Im found its a icon resource issues, and im could not get it fixed and diddent find a sovle at all, which is quite crap. Im guess its due glbasic v12.0 adding quite different size icons, which is NOT supported by API-8, but require around API-10 (Android 3.0) to work. API-8 is also soooo old anyway (its near 4 years old).

I don't have this problem. I have different size icon in my .apk and it work fine on kindle fire HD and nexus 7.
Very strange  :(

Quote from: Ian Price on 2014-Apr-21
it (Android Extras) also allows In App Payments, so that you can offer a free demo and users can buy the full package in-game.

hmm very interesting  :good:
Title: Re: can't compile for android on 12.096
Post by: erico on 2014-Apr-21
I´m running jdk1.6 here and everything is fine so far.
I´m glad your troubles are getting fixed, first time android setup is a bit hard, but later all goes fine.
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-21
I'm on mobile away, Etc. Setup can been quite annoying, same with iOS. But when first working, then no problemo.

The first build errors is due icons as I'm checked. Not sure why, but soon I'm compiled with API -18 then it's fixed its self.

Android extras do have extra features and extend glbasic. Etc orientation issue most important fix, then the assest system is faster.
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-Apr-24
im back again.

mightbeen jdk 1.7+ dosent like the near four years old sdk 2.2? of course a newer sdk uses a newer jdk. That above could been why im got those trouble as well in a stock glbasic? So its could like have been a jdk issue in the end. But why uses old sdk? im not see jdk 1.6 on the homepage at all anyway.

But because sdk 4.3 is quite much newer (its just under a years old), its should works with jdk 1.8, but im do not have tested it. Its does works with jdk 1.7 without issues here.

The newest version is sdk 4.4 (KitKat), have chosen not use that yet by now, but chose to wait to upgrade to that.

But for AndroidExtras,  sdk 2.2 is deprecated.

Also when you compile with A, you will see somw warnings as well deprecated warnings, dont worry about this. A few important feature got deprecated in API-18 (a variable require a LONG rather a INT), but want to support API-17 and below as well. So this cant been avoided at all. The warnings you see in Proguard is from few apis, not used by AE.

To get it working with AE, you do need to do few extra code to get Media files working. See AndroidSample.gbap demo, how the files got loaded.

Also some Android devices does not like drawing commands. This is not a limit in glbasic, but in OpenGl implementation.
Title: Re: can't compile for android on 12.096
Post by: MrPlow on 2014-Apr-24
Hi

Something that worked for me in the past...create a new project and copy top level app folder with media etc. into it but not the distribute folder...

For some reason GLB will sometime fail for a project even after you rectify the problem...

Or try completely delete the distribute folder of the current proj and re-compile.

Title: Re: can't compile for android on 12.096
Post by: erico on 2014-May-16
Hello Beginer,

I was getting similar errors as yours, so maybe I can help. What is your current status?
Also, I made this thread here:
http://www.glbasic.com/forum/index.php?topic=9810.0

Let me know how your compiling is going .
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-May-16
did you get it working, its some time ago im have heard you. Im thinks im could not get a easier way to install Android Extras, which fixed many of the compile issues. Im just added a installer to it. Gernot do need to upgrade his SDK to a better version.
Title: Re: can't compile for android on 12.096
Post by: erico on 2014-May-16
Yep I got the compiling to android back working with standard GLBasic.

I will look to add AE and up my sdk as soon as I finish coding the game as it goes for other platforms too and it is all in one code.
Title: Re: can't compile for android on 12.096
Post by: erico on 2014-May-19
Hello Beguinner,

share you current status, I can give you a hand. What is your latest log?
Try a newer project with a hello world just in case. :good:
Title: Re: can't compile for android on 12.096
Post by: Beginner on 2014-May-25
Sorry guys for the late answer.

Many thanks to those who tried to help me. By now I didn't find a solution to this problem. I installed several JDKs (new and old versions) and tried everything else you guys told me and wrote me by PM.

I don't want to spent any more time in searching for a solution. GLB is complete worthless to me as long as I can't compile for android. This is waste of time!

Sorry. I'm out.
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-May-25
im have looked on this issue again by compare sdk-8 (Stock glbasic) to sdk-18 (Android Extras).

Its seen im have found why the stock compiler diddent work:
icon.png was just missing in the glbaisc source dir folder, so no icons was created. Glbasic diddent create a new icon as well.

Read history about this annoying bug:
http://www.glbasic.com/forum/index.php?topic=9831.msg85639#new

Im property sure its was the same issue you have, but just found this bug, when im tried to compile one of the sample project. But its would been so nice if glbasic tool if the icon was missing to avoid confuction. Im do fix this important issue for AndroidExtras throught, which failed telling that too.
Title: Re: can't compile for android on 12.096
Post by: erico on 2014-May-25
Hello Beginner,

we have been talking about that in Pm right?
You really have to take things back here so we can help, a couple private msgs without you giving me feedback won´t help the case.

The problem may be strange to start with but once over it, you will be fine. No reason to drop out. Needs just a bit more perseverance. :good:

Last time we talked I needed this set of info:
1-Which windows are you running and which bits (32 / 64)

2-I don´t know if jdk 1.8x will work, but I´m sure jdk1.7 will as is the one I have going, this file:
Windows x86   123.67 MB ___  jdk-7u55-windows-i586.exe
over this link:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

3- To set system variable, on windows 7, go to->control panel>system>advanced system settings (left tab)> environment variables...(lowest button)
New or edit an old entry at User variables for JAC (my user name here) , it reads as this:
Variable name: JAVA_HOME
Variable value: C:\Program Files (x86)\Java\jdk1.7.0_55

Note that (x86) on my path.
It is because my system is a windows 7 64 bits and my jdk, as a 32 bits, gets installed on that folder.

Create a new HELLO WORLD project and compile
4- Check if any apk was created on Distribute/android/bin folder

5- Check if the folder where you created this new HELLO WORLD project has a set of icons like this:
icon.png
androidiconouya.png
androidicon96.png
androidicon48.png
androidicon36.png
androidicon.png

EDIT:crossed those files as they only appear if I set project to android.

This should be automatic when you first compile to android. [EDIT: if you do so, those crossed files will be created]

6- Report the compiling log here, this will help us help you on the correct path to get it going.
Don´t give up, it will be rewarding. :good: :booze:
Title: Re: can't compile for android on 12.096
Post by: kanonet on 2014-May-25
Hmm maybe it would be a good idea to create a demo project for android. So we know 100% sure that the error is in the software and not the project missing some file etc?
Title: Re: can't compile for android on 12.096
Post by: erico on 2014-May-26
Yep, will look into it Kanonet, I´m sure there are errors for missing files other then icons and they are causing no apk generation.

I hope it helps Gernot into it too.
Android compiling in the current state (even if deprecated on the api) should be a direct thing without troubles.
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-May-26
At me when I'm tested when compile a Random sample project, it'd was missing icon.png as main reason here. Glbasic diddent create it as it's should.

Also 3dmaze won't compile, this is just due java package names can't start with a number. Here it's was a more clean told error througt.
Title: Re: can't compile for android on 12.096
Post by: erico on 2014-May-26
As I created a new ANDROID_BOOT project, I get the following files on project´s root folder:
ANDROID_BOOT.app [folder]
ANDROID_BOOT.gbap
ANDROID_BOOT.gbas
icon.png

The program is a HELLO ANDROID kind.
Press mouse button(or touch screen) and the print moves down.

I did not set android on the project settings, just did a new project here.
On GLB IDE... project>options is as it is, win32 set as platform and everything else default.

I did not even compile to see what happens, pure new project, type a code, save code, nothing else.

The file is appended project zip here:
Title: Re: can't compile for android on 12.096
Post by: erico on 2014-May-26
Now, I just go to(GLB IDE):
Compiler>Build-Multiplatform
Choose Android.

I get this compiler log:
Quote
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:37233beb - 3D, NET
Wordcount:5 commands
compile+link:
running glb_build.bat
Using ANDROID_TARGET="android-8"
You can use "C:\Users\JAC\Desktop\FUED\SNIPET\ANDROID_BOOT\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
%ANDROIDSDK% not set. Using GLBasic's default target-8, Android 2.2



BUILD STAGE 1: Compile and pack RELEASE
Updated and renamed default.properties to project.properties
Updated local.properties
Added file C:\Users\JAC\Desktop\FUED\SNIPET\ANDROID_BOOT\distribute\Android\build.xml
Updated file C:\Users\JAC\Desktop\FUED\SNIPET\ANDROID_BOOT\distribute\Android\proguard.cfg
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 2: Build DEBUG and install on device
     [echo] Gathering info for glbasic...
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Handling aidl files...
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [echo] Debug Package: C:\Users\JAC\Desktop\FUED\SNIPET\ANDROID_BOOT\distribute\Android\bin\glbasic-debug.apk
     [echo] Installing C:\Users\JAC\Desktop\FUED\SNIPET\ANDROID_BOOT\distribute\Android\bin\glbasic-debug.apk onto default emulator or device...

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:1101: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:1115: Execute failed: java.io.IOException: Cannot run program "Q:\Compiler\platform\android\android-sdk-windows\platform-tools\adb.exe": CreateProcess error=2, The system cannot find the file specified
   at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
   at java.lang.Runtime.exec(Runtime.java:617)
   at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
   at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
   at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
   at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631)
   at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
   at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
   at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
   at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
   at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
   at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
   at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
   at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
   at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
   at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
   at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.Target.execute(Target.java:390)
   at org.apache.tools.ant.Target.performTasks(Target.java:411)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
   at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
   at org.apache.tools.ant.Main.runBuild(Main.java:809)
   at org.apache.tools.ant.Main.startAnt(Main.java:217)
   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
   at java.lang.ProcessImpl.create(Native Method)
   at java.lang.ProcessImpl.<init>(ProcessImpl.java:385)
   at java.lang.ProcessImpl.start(ProcessImpl.java:136)
   at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
   ... 61 more

Total time: 4 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
finished Android build-script.
Android=C:\Users\JAC\Desktop\FUED\SNIPET\ANDROID_BOOT\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 15.0 sec. Time: 20:38
Build: 1 succeeded.

The reason for most of that pile of errors is that I changed a file name here:
C:\Program Files (x86)\GLBasic_v12\Compiler\platform\android\android-sdk-windows\platform-tools

adb.exe to adb_rename.exe

The reason I did this change was that ADB was hanging my glbasic compilation at last stage (but did create the apks).
So doing it, the compiler fails this last stage and logs about it, so I don´t have a hanging GLBasic.

No other icons created, I still have root project as the same with the addition of:
distribute [folder]

I have this file...
glbasic-debug.apk

...at...
C:\Users\JAC\Desktop\FUED\SNIPET\BASE_ANDROID\distribute\Android\bin

...that when moved to my android phone by USB cable, then ran,  it installs and runs as expected.

My phone(galaxy note II) is set to:
-run unsigned apps
-USB debug turned on

It works fine.
Title: Re: can't compile for android on 12.096
Post by: erico on 2014-May-26
Now, if I change my project settings to ANDROID instead of the default WIN32, then it adds the following files on project´s root folder:

androidiconouya.png
androidicon96.png
androidicon48.png
androidicon36.png
androidicon.png

Either way, my apk file still works on my android phone.
I hope this all helps somehow :good:
Title: Re: can't compile for android on 12.096
Post by: spacefractal on 2014-May-26
that part works, but does only works if icon.png exists.

Howover its not good idea to rename adb.exe. Instead you can open glb_build.bat and change call "%ANDROIDSDK%\tools\ant\bin\ant.bat" debug install -q to call "%ANDROIDSDK%\tools\ant\bin\ant.bat" debug -q. Now glbasic wont auto install it. Its near bottom in it.