Computersmith64 Well-Known Member Licensed User Longtime User May 17, 2018 #1 Must be my day for weird crap... I have the following sub that checks whether an options file exists, then if it doesn't (so it's a new install) it does one thing & if it does (it's an update) it does something else. Code: Public Sub Read_Options() As Boolean If File.Exists(File.DirInternal, "options.dat") Then mOptions = File.ReadMap2(File.DirInternal, "options.dat", mOptions) Return True Else Return False End If End Sub I have used this sub in virtually every app I've written & it has worked fine, however today I came across a strange behavior on a device running Android 8.1... If I uninstall the app from the device (including for all users), then reinstall it from B4A, the first time it runs File.Exists returns true - & the version data in the options file shows the previously installed version (proving that the file is actually there). If I then completely kill the app, then run it again, File.Exists returns false! I don't understand. Is there something weird with Android 8.1 where the app isn't fully uninstalled? - Colin.
Must be my day for weird crap... I have the following sub that checks whether an options file exists, then if it doesn't (so it's a new install) it does one thing & if it does (it's an update) it does something else. Code: Public Sub Read_Options() As Boolean If File.Exists(File.DirInternal, "options.dat") Then mOptions = File.ReadMap2(File.DirInternal, "options.dat", mOptions) Return True Else Return False End If End Sub I have used this sub in virtually every app I've written & it has worked fine, however today I came across a strange behavior on a device running Android 8.1... If I uninstall the app from the device (including for all users), then reinstall it from B4A, the first time it runs File.Exists returns true - & the version data in the options file shows the previously installed version (proving that the file is actually there). If I then completely kill the app, then run it again, File.Exists returns false! I don't understand. Is there something weird with Android 8.1 where the app isn't fully uninstalled? - Colin.
Erel B4X founder Staff member Licensed User Longtime User May 17, 2018 #2 Are you using a real device? Upvote 0
Computersmith64 Well-Known Member Licensed User Longtime User May 17, 2018 #3 Erel said: Are you using a real device? Click to expand... Yes. A Nexus 5X running 8.1 - Colin. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User May 17, 2018 #4 I never encountered such issue. File.Exists returns the correct value. Maybe the app is not immediately uninstalled to allow the user to undo the removal. Upvote 0
I never encountered such issue. File.Exists returns the correct value. Maybe the app is not immediately uninstalled to allow the user to undo the removal.
Computersmith64 Well-Known Member Licensed User Longtime User May 17, 2018 #5 It's very strange. What's even weirder is that if I install v1.4 of the app from Play Store, then uninstall it, then install a debug version (still v1.4) from B4A, the "options.dat" file that gets loaded says that the previous installed version was 1.3. Looks like I'll have to keep digging... - Colin. Upvote 0
It's very strange. What's even weirder is that if I install v1.4 of the app from Play Store, then uninstall it, then install a debug version (still v1.4) from B4A, the "options.dat" file that gets loaded says that the previous installed version was 1.3. Looks like I'll have to keep digging... - Colin.
Cableguy Expert Licensed User Longtime User May 17, 2018 #6 Can it be that fileexists is returning true for something like "options.dat.old" or even "options.dat.bak"? Upvote 0
Can it be that fileexists is returning true for something like "options.dat.old" or even "options.dat.bak"?
Cableguy Expert Licensed User Longtime User May 17, 2018 #7 Computersmith64 said: It's very strange. What's even weirder is that if I install v1.4 of the app from Play Store, then uninstall it, then install a debug version (still v1.4) from B4A, the "options.dat" file that gets loaded says that the previous installed version was 1.3. Looks like I'll have to keep digging... - Colin. Click to expand... Did you run the Google play installed version at least one time before uninstalling? Upvote 0
Computersmith64 said: It's very strange. What's even weirder is that if I install v1.4 of the app from Play Store, then uninstall it, then install a debug version (still v1.4) from B4A, the "options.dat" file that gets loaded says that the previous installed version was 1.3. Looks like I'll have to keep digging... - Colin. Click to expand... Did you run the Google play installed version at least one time before uninstalling?
Computersmith64 Well-Known Member Licensed User Longtime User May 17, 2018 #8 Cableguy said: Can it be that fileexists is returning true for something like "options.dat.old" or even "options.dat.bak"? Click to expand... No - I just ran a File.ListFiles(File.DirInternal) & then logged the resulting list & "options.dat" is there even after an uninstall... - Colin. Upvote 0
Cableguy said: Can it be that fileexists is returning true for something like "options.dat.old" or even "options.dat.bak"? Click to expand... No - I just ran a File.ListFiles(File.DirInternal) & then logged the resulting list & "options.dat" is there even after an uninstall... - Colin.
Computersmith64 Well-Known Member Licensed User Longtime User May 17, 2018 #9 Cableguy said: Did you run the Google play installed version at least one time before uninstalling? Click to expand... Yes - didn't make any difference. It's like it has cached the previous install files & then is somehow using them instead of the new install. - Colin. Upvote 0
Cableguy said: Did you run the Google play installed version at least one time before uninstalling? Click to expand... Yes - didn't make any difference. It's like it has cached the previous install files & then is somehow using them instead of the new install. - Colin.
Cableguy Expert Licensed User Longtime User May 17, 2018 #10 Have you tried another writable folder just for testing? It may be related to those new "enforced" permissions Upvote 0
Have you tried another writable folder just for testing? It may be related to those new "enforced" permissions
Computersmith64 Well-Known Member Licensed User Longtime User May 17, 2018 #11 This is what I get on the first run after a fresh install: (ArrayList) [firebase_inter_process_mutex-lock_send_report_to_server.lock, firebase_inter_process_mutex-lock_write_report_to_sqlite.lock, .Fabric, options.dat, virtual_assets] Click to expand... Upvote 0
This is what I get on the first run after a fresh install: (ArrayList) [firebase_inter_process_mutex-lock_send_report_to_server.lock, firebase_inter_process_mutex-lock_write_report_to_sqlite.lock, .Fabric, options.dat, virtual_assets] Click to expand...
Cableguy Expert Licensed User Longtime User May 17, 2018 #12 Can you reproduce it on a small project? Your logs show firebase related stuff, can that be the base issue? Upvote 0
Can you reproduce it on a small project? Your logs show firebase related stuff, can that be the base issue?
Computersmith64 Well-Known Member Licensed User Longtime User May 17, 2018 #13 Cableguy said: Can you reproduce it on a small project? Your logs show firebase related stuff, can that be the base issue? Click to expand... I haven't been able to reproduce it, so it appears to be related to this particular app (I think). I'll try one of my other older apps that uses the same setup & see if I have the issue. - Colin. Upvote 0
Cableguy said: Can you reproduce it on a small project? Your logs show firebase related stuff, can that be the base issue? Click to expand... I haven't been able to reproduce it, so it appears to be related to this particular app (I think). I'll try one of my other older apps that uses the same setup & see if I have the issue. - Colin.
Pendrush Well-Known Member Licensed User Longtime User May 17, 2018 #14 Having same issue with Android 8.1. Try this: Uninstall app, turn off internet connection and then install it again without internet connection. It's look like google make Internal folder backup (cloud probably), when you install app again, all files in internal folder are on their place (restored from backup). You can also change package name. Upvote 0
Having same issue with Android 8.1. Try this: Uninstall app, turn off internet connection and then install it again without internet connection. It's look like google make Internal folder backup (cloud probably), when you install app again, all files in internal folder are on their place (restored from backup). You can also change package name.
Computersmith64 Well-Known Member Licensed User Longtime User May 17, 2018 #15 Pendrush said: Having same issue with Android 8.1. Try this: Uninstall app, turn off internet connection and then install it again without internet connection. It's look like google make Internal folder backup (cloud probably), when you install app again, all files in internal folder are on their place (restored from backup). You can also change package name. Click to expand... Yep - that was the problem. Spent half of last night trying to figure it out, but had forgotten about Android cloud backup - DOH! Thanks Pendrush! - Colin. Upvote 0
Pendrush said: Having same issue with Android 8.1. Try this: Uninstall app, turn off internet connection and then install it again without internet connection. It's look like google make Internal folder backup (cloud probably), when you install app again, all files in internal folder are on their place (restored from backup). You can also change package name. Click to expand... Yep - that was the problem. Spent half of last night trying to figure it out, but had forgotten about Android cloud backup - DOH! Thanks Pendrush! - Colin.