can't compile for android on 12.096

Previous topic - Next topic

MrPlow

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.

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

erico

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 .

spacefractal

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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

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.

erico

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:

Beginner

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.

spacefractal

#36
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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

#37
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:

kanonet

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?
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

erico

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.

spacefractal

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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

#41
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:

erico

#42
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.

erico

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:

spacefractal

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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/