Hi everyone,
been pulling my hair at compiling things for android, had a hard time installing every sdk as should be (got a hellish time figuring what to do since the latest android NDK doesn t have a gcc nor a g++ anymore, had to install previous versions)
and in the end, Blitzmax refuses to build, giving me this message:
QuoteCannot determine SDK target dir. ANDROID_SDK_TARGET or android.sdk.target option is not set, and auto-lookup failed.
While playing a bit with the config file, i understood that it's linked to the #addoption android.sdk.target "23" line of the custom.bmk, but tempering with it (removing the # and changing the number 23, 12... whatever didn t make it successful, and i really don't know what Blizmax expect)
Here is my custom.bmk
# Example options
# ** compiler optimisation **
setccopt optimization -O3
# ** specific architecture **
#setwin32ccopt arch -march=pentium3
#setmacx86ccopt arch -march=nocona
#setmacx86ccopt math -msse3
# ** android configuration **
# ** architecture is determined by build settings **
# ** NOTE : android build requires bmk resources folder at BlitzMax/resources **
addoption android.home "C:\Program Files\Android\Android Studio"
addoption android.sdk "C:\Program Files\Android\Android Studio"
addoption android.ndk "C:\Users\KamaShin\Downloads\android-ndk-r14b"
addoption android.toolchain.version "4.9"
addoption android.platform "12"
addoption ant.home "C:\Users\KamaShin\Downloads\apache-ant-1.9.14-bin\apache-ant-1.9.14"
# ** Optional SDK target **
# Will try to determine valid target to update project.properties, if not set.
#addoption android.sdk.target "23"
# ** optional ant location **
# ** defaults to resources/apache-ant **
addoption ant.home "C:\Users\KamaShin\Downloads\apache-ant-1.9.14-bin\apache-ant-1.9.14"
If anyone has some greater knowledge about this, i would really appreciate it.
Also, there is a line in this custom.bmk: # ** NOTE : android build requires bmk resources folder at BlitzMax/resources **
not sure what those "bmk resources" are?
Thanks for reading me
Found my own mistake, the path for the android sdk was wrong, i put the path or android studio, not ,the sdk installed by it... So it's a bit better, on to the next error message:
QuoteError creating class file 'C:/Games/CasseBrique/android-project-RetroBrik/src/com/blitzmax/app/BlitzMaxApp.java'
any idea?
I m progressing, I managed to figure out i had to ind the required files on the internet, and put them myself in an android-project-gamename folder, next to the gamename.bmx that is currently being compiled
so compiling starts, and then i got this message, and i m starting to get stuck here:
QuoteC:/Games/BlitzMax/mod/brl.mod/blitz.mod/blitz_debug.c:39:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for (int j = low; j <= high- 1; j++) {
^
C:/Games/BlitzMax/mod/brl.mod/blitz.mod/blitz_debug.c:39:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
Any idea here?
I reached out to Brucey in the BlitzMax(NG) discord chat channel here:
https://discord.gg/udSSJkj
if you are a discord user already (or want to join - for free) then do not hesitate to ask questions there too.
@ C99
Seems it needs to set some options
Some modules do it that way:
?win32
ModuleInfo "CC_OPTS: -DLIBCLIPBOARD_BUILD_WIN32"
?linux
ModuleInfo "CC_OPTS: -DLIBCLIPBOARD_BUILD_X11"
?macos
ModuleInfo "CC_OPTS: -DLIBCLIPBOARD_BUILD_COCOA"
?
But I am doubting much that this is what needs to be altered ... I am pretty clueless on these things.
bye
Ron
Does this (https://www.syntaxbomb.com/index.php/topic,3480.0.html) help?
@Derron, thanks for the tip, though i doubt the code can help, reaching Brucey might very much help, i will go there
@markcwm i already followed this tutorial, actually, and after much suffering, i could reach the state of my last message... Sadly, nothing in this tutorial seem to point at compiling error inside blitzmax itself for C99 or C11 issues, thanks anyway :)
it's like the compiler uses C99 or C11 parameter when compiling for windows but not for android though it would need to...
What is the gcc compiler version you're using? It could be if you use the older 5.1 it works, I haven't tested android since I used that. It's easy to change version if using NG, just get the MinGW32 folder in v0.87 and rename MinGW32x64 and x86 folders.
Going to try this, don't really know what version of minGW i'm using, i just downloaded the latest package from the official site
Okay, well make sure you rebuild all your modules (at least brl and pub) or you may get conflicts. Look in Help>About MaxIDE under GCC version, or anywhere in Cmd type "gcc --version".
ok, i tried getting what i think is minGW 5.1.4, tried rebuilding all the modules, i get this error:
Quotecc1plus.exe: error: unrecognized command line option "-std=c++17"
Build Error: failed to compile (1) C:/Games/BlitzMax/mod/audio.mod/libopenmpt.mod/openmpt/common/FileReader.cppcc1plus.exe: error: unrecognized command line option "-std=c++17"
Process complete
if i try to compile my game now, it doesn t work anymore even for windows
QuoteBuilding RetroBrik
[ 22%] Processing:Animation.bmx
[ 22%] Processing:Brique.bmx
[ 22%] Processing:Medias.bmx
[ 23%] Processing:Particles.bmx
[ 23%] Processing:Player.bmx
[ 23%] Processing:Bille.bmx
[ 23%] Processing:Bonus.bmx
[ 23%] Processing:Teleport.bmx
[ 23%] Processing:RetroBrik.bmx
[ 62%] Compiling:Medias.bmx.release.win32.x86.incbin.c
[ 85%] Compiling:Animation.bmx.release.win32.x86.c
[ 85%] Compiling:Brique.bmx.release.win32.x86.c
[ 85%] Compiling:Medias.bmx.release.win32.x86.c
[ 85%] Compiling:Particles.bmx.release.win32.x86.c
[ 85%] Compiling:Player.bmx.release.win32.x86.c
[ 85%] Compiling:Bille.bmx.release.win32.x86.c
[ 86%] Compiling:Bonus.bmx.release.win32.x86.c
[ 86%] Compiling:Teleport.bmx.release.win32.x86.c
[ 86%] Compiling:RetroBrik.bmx.gui.release.win32.x86.c
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:133: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:139: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:145: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:151: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:157: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:163: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:169: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:175: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:181: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:187: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:193: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:199: error: unknown field `var_address' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:205: error: unknown field `var_address' specified in initializer
C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.c:211: error: unknown field `var_address' specified in initializer
Build Error: failed to compile (1) C:/Games/CasseBrique/.bmx/Animation.bmx.release.win32.x86.cC:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:200: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:206: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:212: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:218: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:224: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:230: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:236: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:242: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:248: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:254: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:260: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:266: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:272: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:278: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:284: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:290: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:296: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:302: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:308: error: unknown field `var_address' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:314: error: unknown field `var_address' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:320: error: unknown field `var_address' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:326: error: unknown field `var_address' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:364: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:370: error: unknown field `field_offset' specified in initializer
C:/Games/CasseBrique/.bmx/Brique.bmx.release.win32.x86.c:376: error: unknown field `var_address' specified in initializer
Process complete
I must be doing something wrong, but I'm not sure what
And in blitzmax ide it says GCC Version unavailable
Would you have a link to download minGW 5.1 ready for blitzmax??? cause, google gives me hell, with several version of minGW all over the place, i m kinda lost
Okay, sorry I shouldn't have told you to swap out your MinGW for an older one, it used to work with v0.93 (https://github.com/bmx-ng/bmx-ng/releases/tag/v0.93.3.21.win32), so here's a link to v0.87 (https://github.com/bmx-ng/bmx-ng/releases/tag/v0.87.3.16.win32) with GCC 5.1 as found on the Bmx-NG releases (https://github.com/bmx-ng/bmx-ng/releases). I've been using v0.93 for 2 or 3 years now, I'm only just upgrading to v0.120 now.
No problem, rolling bakc isn't hard, finding what works and how is a lot harder :D
Downloading the 0.87 now, i ll see if it works for android compiling, i don't mind keeping 2 version of BMax if it works ^^
It seems to be working, except for one tiny little detail, I m using SColor8 type, which BMax 0.87 doesn t seem to know
I'll try to work around it, but other than that, compilation both for windows and android went up to 98% so, looking good...
Thanks a lot mate, making progress here ^^
I'm on the verge of something, everything seem to compile fine with the version you gave me, but just at the end, i get a failed to create apk message.
Any idea?
QuoteBuilding RetroBrik
[ 13%] Processing:linkedlist.bmx
[ 36%] Compiling:linkedlist.bmx.release.android.armeabi.c
[ 46%] Archiving:linkedlist.release.android.armeabi.a
[ 81%] Processing:Animation.bmx
[ 82%] Processing:Brique.bmx
[ 83%] Processing:Medias.bmx
[ 84%] Processing:Particles.bmx
[ 85%] Processing:Player.bmx
C:\Users\KamaShin\Downloads\android-ndk-r14b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-ar.exe: creating C:/BlitzMax 0.87/mod/brl.mod/linkedlist.mod/linkedlist.release.android.armeabi.a
[ 86%] Compiling:Animation.bmx.release.android.armeabi.c
[ 87%] Compiling:Brique.bmx.release.android.armeabi.c
[ 88%] Compiling:Medias.bmx.release.android.armeabi.c
[ 89%] Compiling:Particles.bmx.release.android.armeabi.c
[ 90%] Compiling:Player.bmx.release.android.armeabi.c
[ 91%] Processing:Bille.bmx
[ 92%] Compiling:Bille.bmx.release.android.armeabi.c
[ 93%] Processing:Bonus.bmx
[ 94%] Processing:Teleport.bmx
[ 95%] Compiling:Bonus.bmx.release.android.armeabi.c
[ 96%] Compiling:Teleport.bmx.release.android.armeabi.c
[ 97%] Processing:RetroBrik.bmx
[ 98%] Compiling:RetroBrik.bmx.gui.release.android.armeabi.c
[100%] Linking:RetroBrik
Error creating apk
Process complete
Well the only thing to go on there is "Error creating apk" which isn't really enough, I don't know. You need to see what happens with the android firepaint port sample.
You should read the Android developer docs to know what to do in general. For example, you need to set an app package name (https://developer.android.com/studio/build/application-id.html) inside a ".android" file that is used by Google Play store to identify the app when published but is also used to name the resource class.
There's an old BB thread @Android 5.1 error (https://mojolabs.nz/posts.php?topic=106236) which you might want to read.
I will delve into this, but the firepaint port gives me the exact same error, which, as you said, isn t much to try and dig out a solution, it's very vague and i'm not sure where the problem comes from.
Thanks or all the help anyway, it was fun in its own way :)
Well it must be a problem with the Blitzmax setup then, so double check everything.
To check Java is installed okay open Cmd and type "java -version".
Rebuild all modules, using Cmd use -a to force a rebuild "bmk makemods -a -w brl".
Make sure your paths to Android SDK and NDK are correct. You have declared your Apache Ant path twice.
Java version says "1.8.0_20"
i've tried rebuilding all the modules, but from Blitzmax IDE itself, not using your command line, i'll try it
and yes, i ve seen my double pathing to Apache Ant, and deleted it, though it didn t change anything
All I ever hear on this website is BlitzMax of various flavours don't work...It doesn't even compile, I'm getting there though! I'm down from 147 errors to 42. It doesn't work with Android, it does work, but you need to re-compile XYZ Modules, but not ABC Modules...Why do you guys even bother?! A language should always work, out of the box.
Something like AGK works out of the box and allows a code-based approach, rather than a code-based/menu system approach, and runs on Windows OS, Mac OS and Linux perfectly, it runs on mobile platforms too. I haven't tried mobile on AGK, but I hear it also runs as seamlessly. 3D support isn't so great though so you're gonna have to get your hands dirty, but no change if you're picking up after Sibly.
it works on the major three platforms - and it works on raspi. Android target needs to get overhauled as Android stuff changed and so did requirements.
For now nobody complained as nobody was really using that target - this is why it might currently need adjustments or fixes.
And please do not compare commercial software (in which I expect things to work if sold as feature) with FOSS software when it comes to bugs/non-working features. Too few are using to get bug reports for every thing within 48 hours.
People want to use BlitzMax for a reason - maybe the language looks way sweeter than this procedural AGK stuff (yes BMX has this too - if you want). Maybe they like some specific module or the fact it is free or they used it 20 years ago and do not want to change as they are stubborn or or or.
If AGK works with "mobile" out of the box then it provides a runtime and some "your application package". Then it should compare with Godot and unity. If it compiles to native code then it will mostly have to piggypack the android toolchain too - and to integrate it in some way.
I accept the fact that currently NG misses a proper "help" to setup the android tool chain (paths, configs ...). This could be tackled once the current system is overhauled - maybe Hezkores VS Code extension could be extended to provide such stuff too.
bye
Ron
I'll also point out that It's possible for BMax to have more bugs because it has such a larger surface area.
AGK has a very narrow scope and feature set so it can optimize that feature set well. With Bmax, the language can make a game just as easily as it can make a webserver or a audio production software or financial trading apps.
Quote
And please do not compare commercial software (in which I expect things to work if sold as feature) with FOSS software when it comes to bugs/non-working features
So you're saying paid for software works and free software doesn't? I'd rather pay.
BMax can make a game as easily? People here can't even compile a game! So what chance has the average Joe?
What game?
in FOSS (free open source, not just free) it is a matter of having people commiting their time to fix stuff and to code features. In commercial software you pay for stuff and are able to expect things.
Nonetheless: using and supporting FOSS is a personal standing / opinion - some do it, some avoid it. Each one decides on their own.
bye
Ron
This topic was about compiling for android, I got no problem whatsoever compiling and running my game on pc, it actually runs great and smooth even with more than 4000 particles sometime.
No he means you can't compile the game for Android. Actually, you should be able to as I've done it.
Yes AGK would be more sensible but it's the FOSS idea that keeps me with Blitzmax. I would have left if Brucey was not around.
Could you try compiling my project or android then? you wouldn t have the images and sounds and all, but it should compile since i m not using "incbin"
Quote from: markcwm on May 01, 2020, 23:20:42
No he means you can't compile the game for Android. Actually, you should be able to as I've done it.
I made a game for android too with NG, but it was years ago. https://mojolabs.nz/posts.php?topic=106403 (https://mojolabs.nz/posts.php?topic=106403)
Dont give up!
No, I only meant I'd personally compiled successfully for Android, not written a game for it.
Yes, don't give up, you're very close. It's so much better to have your own system running.
I've just spent this evening setting up android to see what you might be missing. You're using Java 1.8_20 whereas I have 1.8_251, I had 1.7_79 but wanted to check 8 works and it does. Are you sure the environment variable for Java is okay?
I installed Blitzmax NG 0.87 (with GCC 5.1) and edited bin/custom.bmk to set correct paths. I installed an older Android Studio SDK Manager (r24.4.1) but I don't think that's available now but you should be okay with commandlinetools-win-xxxxxxx_latest.zip. Then the Android NDK I used was r11c-win-x86_64 (which the SDK Manager doesn't install) the latest is r20b. For Apache Ant I used 1.9.7 their page says you should have 1.10.7 for Java 8 but I was fine with 1.9.7. I installed Android 4.4.2 and 5.1 APIs which took ages.
API installs are pretty fast (1-2minutes) when running on an SSD.
I think newer NDKs did not provide a file needed (ANT or so?) so if I remember correctly it requires a bit of backend work in NG to use latest toolchains' tools :D
(Am not sure if I now mix that up with my last try to compile my first and only monkey-x-game with cerberus-x).
bye
Ron
I m installing the ndk r11c, and i just changed my JAVA_HOME path cause it was pointing to C:\Program Files\Java\jdk-14.0.1, wich is weird since i'm supposed to be in 1.8.20, so i set it to C:\Program Files\Java\jre1.8.0_20 (weird part is i have yet another java folder, a third, name jdk1.8.0_05 and i mnot sur which one i m supposed to used.... what's the difference between jdk and jre....)
well for now, changing my JAVA_HOME doesn t change the message, ill see if if it does when combiend to the r11c ndk
for the rest, my config seems close to yours...
I'm progressing, i think the path i set for java wasn't the right one, because now i got another message
Quote
[ 96%] Compiling:firepaint.bmx.gui.release.android.armeabi.c
[100%] Linking:firepaint
Buildfile: C:\Users\KamaShin\Downloads\firepaintAndroid\firepaintAndroid\android-project-firepaint\build.xml
BUILD FAILED
Target "debug" does not exist in the project "firepaint".
Total time: 0 seconds
Error creating apk
Process complete
i dont know where this "target" is mentionned, i've checked all the files that are supposed to be in the android-project-firepaint, there is only one line mentionning "target", in default.properties:
Quotetarget=android-19
Okay, yes that Java path is wrong, it should be the JDK 1.8 or 1.7. Java 14 is the latest but it doesn't work on older Android versions like 5.1, to be backward compatible Android is stuck on Java 8. The JRE is runtime environment and it's the virtual machine, it's for running apps, the JDK development kit is for building apps. Here's a good Java guide (https://www.marcobehler.com/guides/a-guide-to-java-versions-and-features#_why_are_companies_still_stuck_with_java_8).
The target in default.properties is the Android API target platform, 19 is 4.4.2. I think the error is just saying it couldn't build the file bin/firepaint-debug.apk, it seems that might be a problem with the Android SDK, maybe you have the wrong API installed, I installed 5.1 (api22) and 4.4.2 (api19).
Actually, i've installed them all, using the android studio sdk manager
Oh wait, I think your path to the Android SDK is wrong, you're pointing to "C:\Program Files\Android\Android Studio" which is the IDE, I have an older SDK which looked like "C:\android-sdk-windows" but they changed it so now you need to point to "C:\Users\*username*\AppData\Local\Android\Sdk".
Read section 2 here How to Install Android IDE and SDK and Get Started with Android Programming (https://www.ntu.edu.sg/home/ehchua/programming/android/Android_HowTo.html).
Also your path to Apache Ant is wrong, you have "C:\Users\*username*\Downloads\apache-ant-1.9.14-bin\apache-ant-1.9.14" but it should be "C:\Users\*username*\Downloads\apache-ant-1.9.14".
The android path, i changed a long time ago, and yes it points to the appdata folder, and the apache ant folder is correct as i unzipped the ant folder in a folder i called ant so.... the double folder name is correct :D
here's my recent custom.bmk
Quoteaddoption android.home "C:\Users\KamaShin\AppData\Local\Android\Sdk"
addoption android.sdk "C:\Users\KamaShin\AppData\Local\Android\Sdk"
addoption android.ndk "C:\Users\KamaShin\Downloads\android-ndk-r14b"
addoption android.toolchain.version "4.9"
addoption android.platform "14"
addoption ant.home "C:\Users\KamaShin\Downloads\apache-ant-1.9.14-bin\apache-ant-1.9.14"
Please keep us updated :)
I tried building for Android a while back (~2 years) but gave up because of all the fiddle to do and no success, always stucking at a time or another, whatever the version, the paths etc...
But if BNG evolved and is still an option, I'm still interrested in knowing that it *can* work ;).
It can probably work, but i stopped trying :D
actually i converted my Blitzmax code to AppGameKit, which took me 2 days (I struggled 4 days to try and have BMax make an apk, it took 15 seconds on AGK)
And the game is actually available on the Play Store here:
https://play.google.com/store/apps/details?id=com.kamashin.retrobrik
or can be downloaded for PC, here:
https://kamashin.itch.io/retrobrik
Arghh, too bad ::)
AGK is not an option to me for misc reasons but it is definitivly a good bet for its ease of use. Congrats on the release.
Oh bother, well at least there's AGK. And well done to them for such a great product. Your game has nice artwork and sound. Sadly Blitzmax is poor when it comes to deploying on mobile, it's a shame you couldn't get it working but you're better off with AGK.
Blitzmax has something AGK doesn t that i dearly miss: OOP
everything in agk is procedural, and, though it doesn work perfectly fine, the code is a tad more messy
other than that, it is indeed really simple to get your game in apk with no change whatsoever in the source