GLBasic forum

Main forum => GLBasic - en => Topic started by: Kyo on 2013-Oct-15

Title: Error compile Android
Post by: Kyo on 2013-Oct-15
I installed GLBasic ver  11.599 and I tried to use Android Extras.

Now I get this error:

Code (glbasic) Select

compile+link:
running glb_build.bat
Using ANDROID_TARGET="android-8"
You can use "C:\Users\User—\Desktop\WorK_Game\Gioco\Game\FX_Game\EX_Fight\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
Added file C:\Users\Userù\Desktop\WorK_Game\Gioco\Game\FX_Game\EX_Fight\distribute\Android\build.xml
Updated file C:\Users\Userù\Desktop\WorK_Game\Gioco\Game\FX_Game\EX_Fight\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: 5 seconds
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:\Users\Userù\Desktop\WorK_Game\Gioco\Game\FX_Game\EX_Fight\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 66.0 sec. Time: 03:55
Build: 1 succeeded.


And I do not compile the APK ...

I tried to uninstall and GLBasic I reinstalled version 10 with web update, but I get the same error...
I tried to restore the system to two days ago, but nothing works ....

What can I do?? PLEASE  :rant: :rant: :rant: :rant:  :nw: :nw: :nw:
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-15
You need the api 16 upgrade. The android extras is not designed with gl basic stock sdk api 8.

There is a 160mb download in the inline forum:
http://www.glbasic.com/forum/index.php?topic=9341.0
Title: Re: Error compile Android
Post by: MrTAToad on 2013-Oct-15
Also make sure an icon has been created in your projects distribute/res/drawable directory.  GLBasic won't re-create it if you cleanup everything - you would then need to copy it from somewhere else.
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-15
It's a manifest XML issue, due using unsupported v2.2 feature.

In v3 download the icon issue have been fixed, also supports tables too (using icon.png or icon128.png).
Title: Re: Error compile Android
Post by: Kyo on 2013-Oct-15
Summing:

- I installed Gl_Basic 11.599
- I delete the ANdroid folder in C:\Program Files (x86)\GLBasic_v11\Compiler\platform
- I copy the new Android folder (Android_Api14+16_glbasic_v3)
- I compile the Android Sample for test

This is the result of compile:

Code (glbasic) Select

compile+link:
running Android build-script...
.
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
Updated project.properties
Updated local.properties
Added file C:\Program Files (x86)\GLBasic_v11\Compiler\platform\Android\AndroidExtras\distribute\Android\build.xml
Updated file C:\Program Files (x86)\GLBasic_v11\Compiler\platform\Android\AndroidExtras\distribute\Android\proguard-project.txt
.
BUILD STAGE 3: Build a debug build
   [subant] No sub-builds to iterate on

BUILD SUCCESSFUL
Total time: 56 seconds
.
BUILD STAGE 4: Build a release build
   [subant] No sub-builds to iterate on

BUILD SUCCESSFUL
Total time: 13 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 5: Install by invoke this command:
"Q:\Compiler\platform\Android\bin\..\android-sdk-windows\platform-tools\adb.exe" install -r "C:\Program Files (x86)\GLBasic_v11\Compiler\platform\Android\AndroidExtras\distribute\Android/bin/glbasic-debug.apk"
.
finished Android build-script.
Android=C:\Program Files (x86)\GLBasic_v11\Compiler\platform\Android\AndroidExtras\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 77.7 sec. Time: 15:36
Build: 1 succeeded.



- GL-Basic not install in my device (Debug mode)
- I copy the glbasic-debug.apk in my smartphone and install it
- when stat the screen it's black  and after some time returns to the menu Android

I change the Android\bin\glb_build.bat form --target "android-16" to --target "android-14" but the resul it's the same ...

where am I wrong?
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-15
can you give me the _Logview.bat Logcat (Compiler\platform\Android\bin)?

Im thinks its a bug im just fixed today and then im reuploade a new version (to bad im cant remember all changes). Im got it work again for 11.556.

Its seen there is a new version, so im need to test its works on that too, before im uploading.
Title: Re: Error compile Android
Post by: Kyo on 2013-Oct-15
mmmm ....
I do not know if I understand correctly ....
but this is the contents of the file _Logview.bat file

Code (glbasic) Select

@ECHO OFF

:: install Android SDK, Android NDK
:: install JDK


set HERE=%~dp0

set ANDROIDSDK=%HERE%..\android-sdk-windows
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_24


set PATH=%JAVA_HOME%\bin;%PATH%

"%ANDROIDSDK%\platform-tools\adb.exe" shell logcat glbasic:I SDL:I DEBUG:I AndroidRuntime:E *:S
::

IF "%NOPAUSE%"=="" PAUSE



my JAVA_HOME it's = C:\Program Files (x86)\Java\jdk1.7.0_05
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-15
just invoke it, and then you would get STOUT outputs. Then its should output which java error it got. Also im have never liked the stock assest system, which see go nowhere with bigger assest files. So im uses my in house system.

Here its crashed once, but worked on a restart.

Im doing some fixes and reupload a v4 with included AndroidExtras, that one worked nice with 11.559.

Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-15
QuoteIm doing some fixes and reupload a v4 with included AndroidExtras, that one worked nice with 11.559.
:)
Title: Re: Error compile Android
Post by: Kyo on 2013-Oct-15
Thanks spacefractal ...  :nw:
so I can fix the problem of latency audio and have the controller OUYA ...  :booze:
Title: Re: Error compile Android
Post by: Kyo on 2013-Oct-15

ooops the result of invoke _Logview.bat
Code (glbasic) Select

C:\Program Files (x86)\GLBasic_v11\Compiler\platform\Android\bin> _Logview.bat
adb server is out of date.  killing...
* daemon started successfully *
error: device not found
Premere un tasto per continuare . . .
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-15
you need apb running and connected to your pc, or its would not log anything at all. Property you need install such a driver for your device.

Then you could install directly with adp, but drivers can been somewhere messy sometimes (and dont forget to enable unknown source as well usb debugger thing on your device).
Title: Re: Error compile Android
Post by: Kyo on 2013-Oct-15
With original android folder the install of apk worked perfectly ... how can I reactivate it manually?

I tested the V4 and  with Android sample v1.5 does not work, but it work fine with the older version of Android sample.

I noticed that the screen goes to sleep (autofade off) how can I fix it?
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-15
im look on the sample again, howover the functions its self should been ready to uses, even the sample might not work correctly.

Edit:
Some sort if assets issues. you should really get logcat to wrk. Big help fixing issues, and I'm ran out of time (so its was too untested, sorry).

I'm fix rest of the issues tomorrow and post a new sample.

Howover if you got a blank screen, then it's have compiled correctly.
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-16
im have just got the example to work. The main reason is a bug in SETCURRENTDIR$() and need doing some workaround about it.

That command do only change the path for glbasic c++ part, but never for java, which was still on the main path. That hence the example to hang, because its waited for the sound, which was never happens.

Also im also added hot my own CheckAssest file work, so you dont need to see the ..... screen anymore.

im update to the full android sdk file as well in the ANDROIDEXTRAS little file as well (so you dont need do a another 160mb download).
Title: Re: Error compile Android
Post by: Kyo on 2013-Oct-16
Thank for great job  :nw:

But you can use them at the same time only 4 audio files (with TSound)?
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-17
load them to the samme buffer. Im have not tested tSound, which was not created by me, but FiveSprites. Its more if you want to play the same sounds more than one me guess.
Title: Re: Error compile Android
Post by: Kitty Hello on 2013-Oct-17
Oh. How would I set the java path for the current dir?

Sent from my GT-N7100 using Tapatalk

Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-22
I've finally had time to try compiling for OUYA and I've had some success. Well "success" is perhaps a bit strong, as my app compiles and runs on OUYA, but is lacking all the media, so I'm left with a basic text message on the screen that should be hidden by graphics). :(

The media seems to be in the .APK due to its size (4.1MB) and the .APK works as expected in BlueStacks. So any ideas as to what I might be doing/have done wrong? I'm using GLB 11.559 and (I think) 1.52 of the Android Extras kit. Thinking about it, it's probably a media path thing. I use "SETCURRENTDIR ("Media") - I'm guessing that this doesn't work properly on OUYA?

Even though the game isn't working, getting the text message displaying on the screen was pretty exciting. :)
Title: Re: Error compile Android
Post by: MrTAToad on 2013-Oct-23
I would use direct access rather than use SETCURRENTDIR, just in case...
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-23
QuoteI would use direct access rather than use SETCURRENTDIR, just in case...

I have considered doing that, but I only had 20 minutes to "play" yesterday, so didn't have chance. I only asked because it worked fine in BlueStacks. Obviously the OUYA is a different beast (not that I am in anyway knowledgable of anything Android-wise!).

I'm sure it will be sorted fairly easily when I get some proper time.
Title: Re: Error compile Android
Post by: Wampus on 2013-Oct-23
Ian I wonder if putting all the media in a shoebox might a quick-ish way to get up and running.
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-23
QuoteIan I wonder if putting all the media in a shoebox might a quick-ish way to get up and running.

My media WAS originally in a shoebox (works on normal Android - not on OUYA), so I removed the shoebox and just used media (works on Android, not on OUYA). When I get chance I shall remove the SETCURRENTDIR and try it with just the media and see.
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-23
in the newest android extras also, im uses my own asset copy version instead that one used by Glbasic. In that version, you need to checkout any files by your self, before doing any LOAD commands etc. That why no of your medias worked.

If you want to do a quick test using the GlBasic copy assest system, just change manualCopyAssest to manualCopyAssest=1 in SDLActivity.java in line around 245.^

Im did that because im have never liked the assest copy function used by internal, which was painfully slow and could crash very easy (if closed down while copying while installing, which could mean its crashed constanly, until deleted the data. Not very good when that happens.

PS. the function im used is Check_Asset(assestfile$). Im have tried to explain that in the readme as well in the sample project.

PPS. Gernot, you need to send a java command to set the path, which is allways in the main attest dir, hence sounds never load.
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-24
I've checked out your sample SpaceFractal and it does indeed work very well :) however I don't understand why you should actually need to check the assets before loading on OUYA - you don't on normal Android (or any other system I've ever worked on). How different is the version of Android on that compared to normal Android?

But anyway, your continuing and excellent work (and FiveSprites) is doing GLB proud. :)
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-24
You dont need doing that, but it's havde prove against crashes on startup on both android and ouya and much much faster when update the app. You can still uses gernot system by change that line I'm wrote about, then it's will uses glbasic original system.
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-24
QuoteYou can still uses gernot system by change that line I'm wrote about, then it's will uses glbasic original system.
Sorry, which line?


BTW I'm more than happy to use your system (seeing as I've tried several different things now without getting any images to load/display at all) :P

I'm just trying to get my head around the difference between GLBasic, the AndroidExtras and why my code worked on Android but not on OUYA. This is all completely new to me as you know and with limited time I've got to catch up fast! :S
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-24
It's would works on both android and ouya, and it's much faster, so you don't see the asset copying on startup in each update.... similar should been done in glbasic really.

This also save a lots of value internal memory. That also why greedy mouse loads faster.

Howover it's manualCopyAssest variable in the file SDLActivity.java in around line 245.
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-24
I wasn't saying your system doesn't work on both systems - it does. And very well.

My AquaVenture game works perfectly on Android devices and in BlueStacks, but not on the OUYA (with normal GLBasic). So obviously something is different on OUYA. That's why I'm using your system :)

I've just built an .APK with help from the Android Extras Sample and still get no images being shown. And the screen is now rotated. LOL :/

[EDIT] D'oh I missed out the loadTextures call. Let's try again, shall we! :P

[EDIT II] And nope. Images are still not being displayed on OUYA (or BlueStacks now!). I'm going to have to cut everything back to basics methinks and start from scratch to see where I'm going wrong. Just need some time to do that :(
Title: Re: Error compile Android
Post by: Marmor on 2013-Oct-24
Hi ian

Ive got the same "error"
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-24
Quote from: Marmor on 2013-Oct-24
Hi ian

Ive got the same "error"

While I'm glad I'm not the only one, it's annoying knowing that it should (and can) work, based on the AndroidExtra Sample. Strange :(
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-24
(EDIT: Deleted previous post to avoid confuction, sorry).

This is untested (tested now), but try change the Check_Asset: function to this one in AndroidExtras.gbas:

Code (glbasic) Select

FUNCTION EXTRASSTARTUP:
        // Fix orientation issue (if "nosensor" is used in manifest, this is NOT required, but does not harm)
        IF PLATFORMINFO$("DEVICE")="TOUCHSCREEN" OR PLATFORMINFO$("DEVICE")="KEYBOARD"
                LOCAL ORIENTATION=getScreenOrientation()
                SETORIENTATION ORIENTATION
        ENDIF
ENDFUNCTION

FUNCTION Check_Asset: File$
STATIC ISMEDIAFOLDERSET=0
IF ISMEDIAFOLDERSET=0
ISMEDIAFOLDERSET=1
LOCAL Path$=GETCURRENTDIR$()
IF INSTR(Path$, "Media/")<5
IF PLATFORMINFO$("DEVICE")="TOUCHSCREEN" OR PLATFORMINFO$("DEVICE")="KEYBOARD"
CREATEDIR("Media")
ENDIF
SETCURRENTDIR(GETCURRENTDIR$()+"Media") // this DONT work in java, so dont change it (except if scanning stuff after bulk coping).
ENDIF
IF PLATFORMINFO$("DEVICE")<>"TOUCHSCREEN" AND PLATFORMINFO$("DEVICE")<>"KEYBOARD"
RETURN
ENDIF
ENDIF

File$=REPLACE$(File$, "\\","/") // sut sure its correct, but \ need to been /
File$=REPLACE$(File$, "Media/","") // java put that one in, which is allways default path.

LOCAL fileapksize=JAVACALL$("size:"+File$)
LOCAL filelocalsize=GETFILESIZE(File$);

IF fileapksize<1 OR fileapksize<>filelocalsize
LOCAL ok=JAVACALL$("copy:"+File$)
IF ok=-1
LOCAL Path$=File$
FOR i=LEN(File$) TO 1 STEP -1
IF RIGHT$(Path$, 1)="/" THEN BREAK
Path$=LEFT$(Path$, LEN(Path$)-1)
NEXT
ok=CREATEDIR(Path$)
ok=JAVACALL$("copy:"+File$)
ENDIF
ENDIF
RETURN filelocalsize
ENDFUNCTION


Im guess you have a idea how it works and creating the folders if copy asset first failed and then try again.

Im guess tha main issues is missing the manual CREATEDIR which is required to uses my own assestcopy system. Java dosent do that, and hence its fails to read them, if you have used subfolders (which im guess you have). This changes try to create the missing subfolders and then try copy asset again.
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-24
subfolders in Media folders seen works correctly now and have updated the sample files. CREATEDIR should do all automatic now in the function. Have tested it from a fresh install (the app, not the OS).
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-24
[QUOET]Im guess tha main issues is missing the manual CREATEDIR which is required to uses my own assestcopy system. [/QUOTE]
Cheer's I'll give it a bash when I get a moment. I tried both with and without subfolders btw.

Anyway, I suspect the problem actually lies somewhere between my chair and my keyboard ;)

:D
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-24
Had a few spare minutes where I could access the tv and... Semi-success! I now have something I can work with :)

(http://www.iprice.remakes.org/my_stuff/OUYA_AquaVenture.jpg)

I don't know if the title and other graphics are off screen (scaling issues?), but the background is undulating nicely :)

Thanks SpaceFractal (and of course FiveSprites)  :good:
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-24
You remember uses the orientation fix (or it's will rotated 90 degree wrong)? Nice to see that background. Yes java and glbasic can been odd due that setcurrentdir bug, which can cause some traps (include my self really). So I'm updated the sample to use a subfolder to test and it's auto created correctly now.

Also surface is fixed to 720p (and scaled by ouya it's self), even shown in 1080p. Fillrate was the issue I'm did that in both games.
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-25
From what I can tell, the screen isn't orientated incorrectly, but it may be scaled at double (or more) than what it should be but that may be down to my own scaling function (I created the app for a much smaller screen and scaled up for Caanoo and Pandora etc.) Thankfully I'm getting the same results in BlueStacks, so I can check a bit quicker with that. Hopefully I'll have some time tomorrow to get AquaVenture to display the screen properly.
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-25
D'oh! I think I've just found out why I had graphics problems before. It's something so obvious, but seemingly irrelevant. Case sensitivity! Yep. My app, which works on EVERY other format without problem appeared to be a victim of case sensitivity in the media dept. since updating GLB and Android. I was searching for ".png" files in my code and all the media was labelled as ".PNG"

While I am aware that case-sensitivity has always been a potential issue, compiling for Android, prior to V11.XX and the new Android versions+Android Extras, was successful - all media loaded fine and my app was playable on BlueStacks.

Anyway, it looks as though my issue has been sorted now (it's running properly on BlueStacks again - not had chance to test on OUYA yet though). So fingers crossed that it was just a simple and obvious thing that we missed.

:)


[EDIT]



:)
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-26
GlBasic might have aware of that case in shoebox, but often it's allways fails on Linux based systems....

I'm thinks 720p should been nice for your game. Also your game might got rejected, if you don't let uses adjust screen overscan. your text is a bit outside that. in greedy mouse I'm diddent do that, but could change that in a option for eventuelly overscan issue.

But Nice too see that screen anyway  :good:

Edit:
Alternative, the option could render a smaller screen.
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-26
Yeah, I'maware of the overscan issue - that screen is only a WIP just to check that it actually works on OUYA and to get an idea of speed. I will be changing it to suit the needs of OUYA and maybe implementing a Purchase option, so thing will need re-arranging.

As for case sensitivity - I never had that problem on Wiz, Caanoo or Pandora - all of which are Linux based.

Until then, I need to sort out the controller crashing/exiting the app... However I'm sure it's just due to my lack of time to spend investigating any of this.
Title: Re: Error compile Android
Post by: spacefractal on 2013-Oct-26
glbasic might have aware of it, which is actuelly a bad idea, because this is how Linux and Unix works and should not try to checking for that. So on Linux, its allways do thing case sensitivity. Also CopyAsset did not checking for case senative for that, nor im wont do that. That is property why its fails. Im wont fix that kind issue.

PS. moved the game controller crash post to androidextras to avoid double post.
Title: Re: Error compile Android
Post by: Ian Price on 2013-Oct-26
I totally understand and it was my mistake at the end of the day - GLBasic has always been case sensitive and I should always try to ensure that I'm consistent with my media. This has just highlighted the need for me to be more careful.

:)