android compile errors, where to start?

Previous topic - Next topic

nabz32

Well, I tried to compile for android, but I get errors:

Code (glbasic) Select

_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:ea2d5b8f - 3D, NET
Wordcount:21984 commands
compile+link:

running glb_build.bat
Using ANDROID_TARGET="android-22"
You can use "C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
%ANDROIDSDK% not set. Using GLBasic's default target-22, Android 5.1 (Lollipop
ECHO ist ausgeschaltet (OFF).
androidmanifest.xml:
Make sure to check do a manual check for those.
android:minSdkVersion="10" android:targetSdkVersion="22"
ECHO ist ausgeschaltet (OFF).

AndroidIcons.exe [v21-3-2015] running...
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_36_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-ldpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_48_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-mdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_72_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_72_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-hdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_96_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xhdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_180_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xxhdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_192_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xxxhdpi/icon.png
C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_ouya_AndroidExtras.png is missing (732x412 size)
the Ouya icon is not important, if you dont want to support the console
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_ouya_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xhdpi/ouya_icon.png

Checked AdActivity (intersititals):
Does not uses a AdActivity

Android Extras version (SDLActivity.java):
* 2.11.2

Checking Icons Finished...

BUILD STAGE 2: Start compiler (android.bat)
SDK=Q:\Compiler\platform\android\bin\..\android-sdk-windows
Updated project.properties
Updated local.properties
Updated file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\build.xml
Updated file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\proguard-project.txt
Updated and renamed default.properties to project.properties
Updated local.properties
Added file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\build.xml
Added file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\proguard-project.txt
.
BUILD STAGE 3: Build a debug build
Buildfile: C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
[checkenv] Android SDK Tools Revision 24.2.0
[checkenv] Installed at Q:\Compiler\platform\android\android-sdk-windows

-setup:
     [echo] Project Name: glbasic
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 21.1.2
     [echo] Resolving Build Target for glbasic...
[gettarget] Project Target:   Android 5.1.1
[gettarget] API level:        22
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\rsObj
    [mkdir] Created dir: C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\rsLibs
     [echo] ----------
     [echo] Resolving Dependencies for glbasic...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 30 source files to C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\classes
    [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:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\.reggieworld\R.java:8: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\reggieworld\BuildConfig.java:2: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] 2 errors
    [javac] 3 warnings

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: Compile failed; see the compiler error output for details.

Total time: 6 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] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\.reggieworld\R.java:8: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\reggieworld\BuildConfig.java:2: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] 2 errors
    [javac] 3 warnings

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: Compile failed; see the compiler error output for details.

Total time: 1 second
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:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\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:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android"
.
Android=C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 107.7 sek. Zeit: 20:07
Erstellen: 1 erfolgreich.



Could it be, that there a problems when usìng java 64bit SDK?


spacefractal

32bit java should been go.

also there is a issue in androidmanifest.com

com..reggieworld is illigal.

you should using something like com.nabz32.reggieworld (line 3).

Etc a company name are missing.

This might have been created illigal R.Java with the same issue (which means you should delete reggieWorldMRewrite\distribute and try again after the fix.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

nabz32

thx Spacefractal, I try this.

nabz32

#3
Now I only get the 3 warnings I got before, but no errors anymore.

Do I need to sign the apk or can I just copy the release .apk over to my phone and test it?


Ian Price

For testing you don't need to sign the .apk
I came. I saw. I played.

nabz32

I could install the glbasic debug apk,
but it wont load any media. Can I just go to the media directory ( setcurrentdir("media") ) on Android?

Ian Price

You can, but it's not always successful on certain devices with stock GLB. My devices work OK with stock GLB however.

Android Extras guarantees that your media will load, no matter what device you are using.
I came. I saw. I played.

nabz32

So I should use the bundled loadspriteZ etc. functions provided in Android extras instead?
The only thing they seem to do is checking for the existance of the directory and checking the Android memory, which will result in a removal of the file from memory, if memory usage is greater than 100mB.

There are also functions for playsound and music integrated, are those mandatory for android to play sound / music or are they just recommended?

Btw. Thanks for the insights Ian

spacefractal

#8
Those z functions is no longer needed for newer Android Extras as I'm integrated those in glbasic source it's self.

You should use  SETCURRENTDIR$("Media") and keep it. If you want to use subdirectory and want to scan it, you might need to do a DOESFILEEXISTS() as well DOESDIREXISTS() first.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

nabz32

hmm looks like my proble is with subdirectories then. As i kept the Media directory with setcurrentdir("Media") and media$ = getcurrentdir$(),
I will try it now by adding the proper checks ( DOESFILEEXISTS() as well DOESDIREXISTS() ) before loading files or accessing directories.

erico

Your problem is probably directory names, use the full name.
glbasic-debug.apk installs fine on my android.
You just need to set the device to accept non-signed apk (apk out of google play) and probably set it to dev mode.

nabz32

#11
one dumb question, is it "ANDROID" which is returned by platforminfo$("") on android or is it "SMARTPHONE"?

Edit: Even when using the full filepath, it still won´t load any media files,,
my phone seems to install the game, but there is nothing inside the "files" folder in the package folder.


erico

#12
Did you check the non-signed thing on your phone? and probably the DEVELOPER options?
Did you use asset´s full names? like:    LOADANIM "Media/PLAYERS.bmp"      ,0,76,42      ;// Players
Drop the set directory and use it like that.

edit: I made a few android examples around the forum which are unsigned apks with media files...maybe check one of those just to make sure. Maybe it could be something else.

Ian Price

Android is case sensitive. Ensure that ALL media is portrayed EXACTLY as the code states and expects. Ensure that the format of each file is correct too (sensitivity-wise) - eg ".bmp" and ".BMP" are not the same on Android. They don't matter in Windows or Pandora, but they do on Android.
I came. I saw. I played.

erico

#14
Look into this thread:
http://www.glbasic.com/forum/index.php?topic=9834.15

Go down till a post that starts with:
"FINALLY, here is a zipped APK."

Install that, it should load and display its one image.
ANDROTEST.zip

edit:keep in mind that code is for <v14...the latest handles that way better, but the apk should still work fine.