Hi All
I noticed this line on SDL Activity mentioned a lot on my crash reports - which have increased recently especially for 1 app
The line is
254: java.io.File dataDir = getFilesDir();
and it reports nullException error
Has anyone else encountered this issue on a larger scale?
hmm, not me yet.
I have a few other crashes but they are really rare. I haven“t been able to debug them as of yet.
On your case, are you loading all assets as you game boots? Or are you loading stuff as the game goes by?
Once the game boots mostly
I think some objects for some title are loaded every new main menu load.
It's seen happens on oncreate(), which should not been happens.csn can look on that next week.
Ps. Look like it's a common bug on some devices which have set a wrong username, so it's can't get access the required dir. It's might require a unintall and reinstall again due that bug. I'm can alternative only set a empty dir when that happens.
But checks out next week. It's nothing about attest files, since it's happens under boot.
So if it crashes on boot, my suspicious has nothing to do with it.
I was wondering if loading all assets on boot would temporarily solve it, but it seems unlikely.
If the crash happens in oncreate(), that happens under glbasic in it rutine. But it's seen its a known android bug in some systems. It's the APPDATA dir that fails.
Thanks SF
So there's nothing to do about it then?
Also, any info on the NETWEBEND fix ? Currently apps crash with it in version 2.6 of AE
Know you have a lot on at the moment. If you point my in the direction of where the function is I could correct with small edit maybe?
I'm currently still on vacation..... But I'm need to help gernot with android compiler first me thinks. If it's crash due music, stop it before you call it.
The old 2.5.2 was fixed for Netwebend except for if music playing
2.6 Netwebend seems to the 2.5 version and crashes all the time regardless of music.
strange, since im havent changes anything since that. Im look on that tomorrow and recompile it again and also help Gernot to get Android compile again (which is the only "missing" platform). Im home again, but take a break today and need to rechange few devices.
Im property cant do anything about the getfiles getFilesDir(), other than catch the null pointer and then returns a empty string when that happens (which mean you cant save the game at all). This seen to been a bug in some Android systems.
ah damn.
Im see the Ouya issues now, some issues that is very annoying and require some help from the Ouya staff. The purchase option thing example does NOT work at all and still give me errors about classes not found, even its should not do that (howover rest should do have been fixed, but do need testing).
Its due changes on the new SDK im wasent aware of in long time (sorry about that), and thinking the sdk im did have wasent updated in the project foldes, so they was seen working, when they wasent.
Those needs to been fixed first.
About NETWEBEND:
This mightbeen the most anoying command im known in glbasic which is still quite very buggy.
After wasted some hours, im could only get to that point the browser can open nicely, but the app will crash after that. That force me to add glbasicOnPause(-2) in the Java to close the app, when this command is called on Android. Its better to close the app rather than crashing it.
Im thinks its a bug in glb.h in the string handler, which might try to release or access a memory you dont have access too.
That is a bug im can not nothing anything about that and nor will try to fix that, unless im can get a debugger running (which is required to fix a bug like that), like that one you have en xCode.
PS. Im finally got the crash issue fixed too. For some ood reason its crash when im return a ok as variable, but not when im using a number directly. odd.
Thats great news! :booze:
So Netwebend is fixed now? It used to work fine for me for all apps in earlier versions of AE but this great news!
Thanks a lot SF.
its was mainly happens because its was used a bit older version of the source code. But its was also happens in sld main cpp as well in java too. Im update tomorrow. But confirmed its diddent work at all in 2.6.
Im also fix most of the Ouya issues as well with the new Ouya SDK.
you are a code wizard !
Keep it up SpaceFractal, seriously man, change your nick to SpaceMachine :)
Its good to see you on this. I will definately continue using GLBasic. Once you have this working I'd like to have a word with you Space, if that's okay with you ofcourse :)
Thanks
im also not sure why a normal variable crashed it, while returning 1 or 0 manually diddent crash it? But at least it got fixed it, even its was quite strange. Its was nothing in the Java part here about the NETWEBEND crash.
Anyway with little help from Ouya forum, im also got fixed the Ouya SDK issues seen in some of the past AE versions (which im first have seen those issues yesterday for some reasons). Im do need testing the purchases on that console still working after those changes. But here all changes is in Java, so no changes required in the gbas part.
Next part of AE could been fun if im could get the official joy commands got working with Ouya as well, even ist quite easy to uses GameController code, so glbasic can get official Ouya support (as well Mojo and GameStick support). Mojo was the main reason for the sdk upgrade.
PS. Im would still thanks HeadKaze for helping me for iOS64bit :-). Without him, im would not get iOS64 working at all.
Will take few days before release. I'm also plans to remove unknown game controller support, but will add a polling function instead, so remapping can been done easier.
im have dedicated not remove the original remap support for game controllers.
But instead im have just addd analoge support (intepreted as digital for now), so they can been used with KEY() command for unknown controllers.
So in the next version of AE, if you support remap using KEY() command, then you can support most joypads out here by adding a remap feature in your game and save them. Howover some buttons might have two values.
PS. Most ouya issues is fixed again, but need to get purchase part works again. After that I'm release a new version.
Ouya Inapp Shop seens all working again.. phew. There was a lots of small changes in the Java part.
Soon im upload Android Extras v2.7 with those changes:
- NETWEBEND is fixed again.
- KEY() can also uses with most analoge unknown controllers (but only threated them as digital).
- Fixes to the Ouya shop issues (which should have been done a LONG time ago, sorry about that. Im only did seen that few days agao).
- Im have NOT changed to the GameController Api.
But on normal Android Devices im recommered to uses KEY() as well, and also dont forget to let user remap the keys (they can been different from controller to controller). The GameController Api was more designed to run on Ouya, Mojo, GameStick and such console with known controllers.
Looking forward to new version! :good:
Also, any chance of a fix for the Amazon Kindle Hibernation pause?
I have tried
AUTOPAUSE TRUE
but that doesn't fix it and Amazon are reject apps due to this feature.
G.
im have oversigt this one. Im have taken a look what happens...... So Just checked.
The music stops correctly in Greedy Mouse with v2.7 when im press on the power button to hibernation it. So its seen its works correctly here.
Make sure to stop the sound and music in your GLB_ON_PAUSE function. Android Extras does NOT do that automatic, other than send the pause event.
PS. Im uses AUTOPAUSE TRUE and ALLOWESCAPE FALSE.
Just tried the new AE 2.7 with Autopause true and allowescape false (which I usually use) but the Hibernation issue is still occuring and I am pausing music in GLB_ON_PAUSE event
Any ideas what might be wrong? I also started with a new Android distribute folder to be sure.
strange, since its indeeded works here as intended by stopping the music manually.
im do uses a function like this to stop the music:
FUNCTION SoundMusicStop:
LOCAL musicplay=FALSE
IF device$="a" OR device$="ak" // are we on android (PLATFORMINFO$ can eventuelly been used).
MUSIC.stop()
ELSE
STOPMUSIC
ENDIF
ENDFUNCTION
Im also uses HUSH after stopping the music as well.
Im does NOT uses HIBERNATE command at all. That might prevent music to stopping eventuelly. Im can do nothing without a project or logcat.
Hi SF
I think I might have mislead you ... I do not use HIBERNATE command either...
Hibernate is just the state when pressing the power button on Nexus 7 for instance - my screen goes black but I can still here game playing so GLB_ON_PAUSE does not fire at all
However on some older versions of GLB and AE this did work.
Here is my on pause...which works when used with a button event etc.
Actually - is there a thing is KEY() or menu event for the Hibernate power button?? That might fix it
SUB GLB_ON_PAUSE:
appause = 1
music.stop()
IF ISMUSICPLAYING()=TRUE THEN STOPMUSIC
pauseUnPauseAppTime(TRUE)
ENDFUNCTION
you mightbeen right. sometimes its fails. even its invoke the pause in the java. So im checking out what happens. Im thinks its dye conflicting with the ads loading.
Cool thanks SF!
On the other idea is there a key() or menu press event for the Hibernate key?
I'm dont thinks.
The issue happens when ads is loaded then it's skips the pause call as its should not and also not resume correct. If you not using ads then there is no issue. I'm looks on that today.
Thanks SF,
I did notice that ads do fire a pause event but don't resume properly and then when I start my main loop I have to re-enable my timers.
G
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).
Thank you! Thank you!
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]
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.
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
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.
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.
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...
Heres my ToastAdListener file in case this might be involved somehow....
*
* 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;
}
}
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
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?
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.
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
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:
_______________________________________
*** 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:
_______________________________________
*** 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:
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).
Hi Pron3rd
Your issue is the same as I had after 2.7.2 -
1. find GLBasic 12 folder and then >compiler>platform>android>bin
2. edit glb_build.bat
Change target from 19 to 18
e.g.
set ANDROID_TARGET=android-18
Hopefully this should fix it.
he uses stuck glbasic 10, which dosent uses Android Extras. That fine to get it working first. In that state Android Extras is of course not required in that point. R.java is a different issue which might have caused by different glbasic versions. Im guess its not used in api-8, so its confuse the stuck glbasic v10 compiler. So better delete that distribute\Android folder to clean up.
Also Android Extras v2.8. Api-19 will been required, so next AE cant been fixed by changes back to api-18. So uses the full install, where api-19 is included.
Im will uses few KitKat (Api-19) features now:
- Fullscreen on Kitkat using the official variables.
- Using DIRECTORY_DOCUMENTS instead of DIRECTORY_DOWNLOADS for PLATFORMINFO$("DOCUMENT"). PLATFORMINFO$("DOCUMENT") cause pretty much useless in many Jeally Bean devices as well and finally fixed for KitKat.
But of course AE is still backward compatible with a least Android 4.0 (api-14) when running on a device (but only current api used is requried for dev). Im can no longer support Android 2.x, since im have no devices using those versions.
I dunno if we need support for android version before 4.x .
I have an old 2.3 and it sux.
Go for 4.x and kitkat is the best because backwartscompatibility will make
to much work ,or ?
when im see on Google Play, they are now under 10% in uses. Its compared something like iOS4.x or iOS3.x. Im also not support iOS4.x at all too in the 64bit xCode project. They will require iOS5 and up anyway.
Mostly its the gamecontroller support that might interfere with older Android versions. Support for them became really first in Android 4.0. Older Android versions did support them, but they was mostly hacks.
Im do make sure to check which build the device is on for the newer API. But since im have no older devices, im wont support them for eventuelly issues. Im do check build setting if the api support or not from Api-14 and up.