Android Crashes

Previous topic - Next topic

spacefractal

#30
that resume is also fixed soo. Its all due when Interstitial was loaded.

If a Intersitial was loaded, then either glbasicOnPause(1) or glbasicOnPause(0) was called in Java (which calls the SUB in glbasic). You might could pause before the ads was loaded, then its got the pause event. But when its so got loaded while its in pause mode, then resume was newer called (glbasicOnPause(0)) and then the game freeze.

The reason im do that is those pause/resume calls must NOT been happens while the ads is showing. If im do that, then the app might crash out instead.

None of the bugs happens if Intersitial was not used.

They are all hopefully fixed and upload a 2.7.2 later today (is just uploaded).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Thank you! Thank you!
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

#32
SF,

Just tried compile - my compiles now default to api-19 where prev I have using api-18

Error: Target id 'android-19' is not valid. Use 'android.bat list targets' to get the target ids.


[Edit: Think I'm okay now - I have edited the glb_build.bat in my main GLB Codebase]
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#33
im is beginning update the api-18 (Jelly Bean) to api-19 (KitKat) for testing with compatible with that sdk. Its does. The full install uses sdk-19, but for 2.7.x you can still uses api-18 in glb_build.bat:

Either you can uses the full install, or doing this:
http://www.glbasic.com/forum/index.php?topic=9166.msg90174#msg90174

Also Google does no longer support api-18 anyway for updates, so we should do the same here.

Also im will no longer support and fix any Android 2.x issues anymore (im have no such devices anymore my self). They are today under 10% in Google Play market now.


Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

No worries SF

I compiled a clean bin Android distrib folder and am still not getting pause firing for Hibernate - did you say it works for you even with Ads?

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

spacefractal

#35
They does here otherwise im diddent update it. Im only tested it with Greedy Mouse.

Im then so need a project so im can testing for eventuelly more issues.

Please checkout SDLActivity.java, you did got 2.7.2 (in line 122) from the small update (the big update is still 2.7.0).

The fixes was in SDLActivity.java and in GoogleAdmobListener.java.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

#36
Yep both had modified dates for today.

Having Wakelock permission doesn't affect it does it?
   <uses-permission android:name="android.permission.WAKE_LOCK" />



Quote from: spacefractal on 2015-Feb-05
They does here otherwise im diddent update it. Im only tested it with Greedy Mouse.

Im then so need a project so im can testing for eventuelly more issues.

Please checkout SDLActivity.java, you did got 2.7.2 (in line 122) from the small update (the big update is still 2.7.0).

The fixes was in SDLActivity.java and in GoogleAdmobListener.java.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

Might been? I'm meant I'm don't use it. But if you pm me the project I'm can check it out. It's strange...
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Heres my ToastAdListener file in case this might be involved somehow....

Code (glbasic) Select
*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.libsdl.app;

import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;

import android.content.Context;
import android.widget.Toast;
import android.util.Log;

/**
* An ad listener that toasts all ad events.
*/
public class ToastAdListener extends AdListener {
    public Context mContext;
public static String error;
public static int state=0;

    public ToastAdListener(Context context) {
this.mContext = context;
    }

    @Override
    public void onAdLoaded() {
//Log.i("glbasic", "************************* onAdLoaded *************************");
state=1;
    }

    @Override
    public void onAdFailedToLoad(int errorCode) {
//Log.i("glbasic", "onAdFailedToLoad");
state=-1;
        switch(errorCode) {
            case AdRequest.ERROR_CODE_INTERNAL_ERROR:
                error = "Internal error";
state=-1;
                break;
            case AdRequest.ERROR_CODE_INVALID_REQUEST:
                error = "Invalid request";
state=-2;
                break;
            case AdRequest.ERROR_CODE_NETWORK_ERROR:
                error = "Network Error";
state=-3;
                break;
            case AdRequest.ERROR_CODE_NO_FILL:
                error = "No fill";
state=-4;
                break;
        }
    }

    @Override
    public void onAdOpened() {
state=2;
    }

    @Override
    public void onAdClosed() {
if (state!=4) state=3;
    }

    @Override
    public void onAdLeftApplication() {
state=4;
    }
}
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#39
hm its the old one.

Im thinks in the future im dropping using the same link for the download to avoid confuction about the version number. Its not first time that happens (the full download is still the same link throught).

https://www.dropbox.com/s/091vfv9zpkzhdhu/2.7.2-changes.zip?dl=0 is the changes from 2.7 to 2.7.2
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Hi SF

templateproj folder:
So the GoogleAdmob and SDLActivity are dated 5-Feb-2015

Do the dates of the file updates look okay to you?




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

spacefractal

Please make sure the you actuelly uses 2.7.2, and not a older version. This can very well comon issue, when you have more than one glbasic instance.

So im have changed AndroidIcons.exe (now included in small update) exe, so its now tells which Android Extras version the target project really do uses to avoid that issue (by checking SDLActivity.java in the target project):
https://www.dropbox.com/s/h2t4q36tvnli2qm/AndroidIcons.zip?dl=0

This is not first time update can have fails, which im have been a little bit tired about it (sorry if im previous was offensive, was not meant). Sometimes its even can been happens here, if the EDITOR have compiled from a different folder.....

PS. This have sometimes also happens by my self, so im thinks telling the version now would been easier to verify which version its uses.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Thanks SF!

I will try out the new AndroidIcon.exe - also not sure if juts me but noticed that if I cannot get Wifi and advert does not load as result and then try to hibernate - then I get a crash "This application has stopped"

Might be me or might be some a problem with advert not loading.

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

ProN3rd

#43
Quote from: spacefractal on 2015-Feb-08
Property ant might been missing as Various required Builds tools?

Im Thinks you should remove ANDROIDSDK from the Path, so glBasic uses that one that is include.

Also im also uses Java JDK 1.7, not Java JDK 1.8.

Also make sure to restart after removing ANDROIDSDK var.

Ps. I'm checkout the none wifi crash in the few days.

ANT_HOME is set to C:\Program Files (x86)\Java\apache-ant-1.9.4
JAVA_HOME is set to C:\Program Files (x86)\Java\jdk1.7.0_75 (installed version 7 32Bit now)
PATH: %ANT_HOME%\bin;  %JAVA_HOME%\bin

i tested with and without the variable: ANDROIDSDK C:\Android\android-sdk
and always deinstalled and restarted everything for each try

with gl Basic 12:

Code (glbasic) Select


_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:bdf43d6f - 3D, NET
Wordcount:4 commands
compile+link:

running glb_build.bat
Using ANDROID_TARGET="android-19"
You can use "C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android\glb_android_build.bat" to change the API level and SDK path.

Checking Icons (uses 'AndroidExtras_icons_X.png' For changes)....
C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android
C:/Users/Gans/Documents/GLBasic/8feb/icon_36_AndroidExtras.png is missing (36x36 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_36_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_36_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-ldpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_48_AndroidExtras.png is missing (48x48 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_48_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_48_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-mdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_72_AndroidExtras.png is missing (72x72 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_72_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_72_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-hdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_96_AndroidExtras.png is missing (96x96 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_96_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_96_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xhdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_180_AndroidExtras.png is missing (180x180 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_180_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_180_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xxhdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_192_AndroidExtras.png is missing (192x192 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_192_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_192_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xxxhdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/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/Gans/Documents/GLBasic/8feb/icon_ouya_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xhdpi/ouya_icon.png
Checking Icons Finished...

BUILD STAGE 2: Start compiler (android.bat)
Q:\Compiler\platform\android\bin\..\android-sdk-windows
Error: Target id 'android-19' is not valid. Use 'android.bat list targets' to get the target ids.
.
BUILD STAGE 3: Build a debug build
Buildfile: build.xml does not exist!
Build failed
.
BUILD STAGE 4: Build a release build
Buildfile: build.xml does not exist!
Build failed
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\Gans\Documents\GLBasic\8feb\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\Gans\Documents\GLBasic\8feb\distribute\Android"
.
Android=C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 5.4 sek. Zeit: 18:07
Erstellen: 1 erfolgreich.







with GLBASIC 10:
Code (glbasic) Select


_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.104 SN:bdf43d6f - 3D, NET
Wordcount:4 commands
compile+link:
running Android build-script...
BUILD STAGE 1: Compile and pack RELEASE
     [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...
    [javac] C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android\gen\com\yourcompany\8feb\R.java:8: error: ';' expected
    [javac] package com.yourcompany.8feb;
    [javac]                        ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:580: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:602: Compile failed; see the compiler error output for details.

Total time: 0 seconds
.
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...
    [javac] C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android\gen\com\yourcompany\8feb\R.java:8: error: ';' expected
    [javac] package com.yourcompany.8feb;
    [javac]                        ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:580: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:602: Compile failed; see the compiler error output for details.

Total time: 0 seconds
finished Android build-script.
Android=C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 4.7 sek. Zeit: 18:06
Erstellen: 1 erfolgreich.



is there somewhere I guide about this? I am just an amateur programmer who is very confused. After reinstalling and testing, also GLBASIC 10 wont compile anymore now for android, but it did yesterday. Is there a known configuration which works easy and has a guide?

EDit: I just tested the glbasic-debug-unaligned.apk from the C:\Program Files (x86)\GLBasic_v12\Compiler\platform\android\Android Extras\AndroidSample.app folder via CMD installation on API 17, the app installes, but when I open it the message "Unfortunately <APP Name > has stopped appears". I have seen this message yesterday as well when installing glbasic content on virtual devices either via CMD or with GLBasic10 (which installed yesterday, but not today any more.) I dont have the installer of GLBasic 11, can i find it somewhere? Hopefully I can make this work soon, trying for a few days desperatly now  :giveup:


spacefractal

#44
Look like the compiling seens work. So thinks all required is delete the distribute\Android folder in your game folder, and then try again. That can happens if you have tried to uses various version of glbasic, so its can been confuction about the correct one. By deleting the folder let glbasic recreate the project again.

v12.312 is newest version:
http://www.glbasic.com/main.php?site=download

The stuck version from that should works as well (even its only uses api-8). Eventuelly you can install AE as well (only checked with v12.312).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/