Can't download my project to old android version devices September 2023

I fixed a bug in my app, but after I build it, I can't download the .apk to my old tablets (Android versions 4.1.1 and 4.2.2).
After scanning the bar code, it indicates download in progress, but the file name is not even listed.
Last time I tried downloading (and succeeded) was at begining of summer.
Download to a new tablet (Android 11) works fine.
Has a new version of AppInventor been released that could address this?
Thanks
Martin.

The old code server doesn't seem to be updated to nb194 yet. Does it work there?

1 Like

Yes.
In this server it gives you a warning about different versions, but download works fine.
Thanks

App Inventor on ai2 is now mostly using HTTPS for everything, and it's possible that older devices may not be able to establish secure connections correctly with Google's servers. A test you could try is, after scanning the QR code, change the URL from HTTPS to HTTP and then click "connect with code" to restart the download process. This will revert to an insecure connection for downloading the APK.

1 Like

Thanks Ewan
You are right. I checked that, changing HTTPS by HTTP, I can download the project in my old tablets again.

But, unfortunatelly another problems arised:

.- After installing the app, I cant find the app folder where it should be (where the folders of other apps are, at /storage/emulated/0/Androd/data). So I can`t copy there the configuration file needed for the app to start properly.
.- May be because of the latter, a couple of run time error appears at start of the app.

Neither of this happened when I installed the app after downloading it from the old code server (so it must not be a problem of the app itselt).

EDIT:
Yesterday the download from old code server worked fine.
I retried today, and happens the same with both servers: After install, I can no longer find the app folder using the device's file manager.

This is an Android restriction
Use a good file manager like total commander

Taifun

Thanks Taifun
I followed your suggestion, installed and tried Total Commander, but it shows me the same folders (the ones of the apps I had installed before, not the new one).

I also tried to connect the tablet and the pc with a USB cable (It works on my new tablet Android11), but it's just good for charging batery. The old tablets doesn't appear on the pc file manager.

When swapping from one code server to another, I had to uninstall the app.
Now I can't use neither the old version of my app, nor the new one with the bug fixed.

If I'm the only one with this problem, I'm considering to spend 300€ to buy a couple of new tablets (Android 11), just for testing.
The nightmare of the new Android SDKs doesn't seem like it will ever end! Could it be planned obsolescence?

Why do you manually require copying a configuration file into the app's private data directory as part of your installation process? If anything, I would consider storing it in the project Assets and then reading it from there.

My guess is that Android is not creating this directory by default but when the app first requests access to it. You might be able to manually create it via adb, but if it doesn't have the right permissions the problem will only get worse. I'd strongly encourage you to rethink this workflow.

You have to enable USB debugging in the developer options on the tablet

Alternatively in case the file changes from time to time, download it from your Google Drive

Taifun

The app is a prototype of a software that can be used in a series of regional servers. The configuration file just tells each server who it is.
Where else could I save the configuration file but in the app`s directory, for the app to read it on start?
Any suggestions about a better way to do it?

Again you are right.
The app saves some log files in such a directory, creating it if it doesn't exist.
Now I remember that usually the app gave an error on the first start after installation (due to the lack of the configuration file), but just then saved a error log file, creating the directory. Then I manually copied the config file corresponding to the site. And everythig worked fine from the next start on.
I almost forgot it, because the app is years old, and in the last times I only updated new versions fixing bugs, They were not real new instalations (so the directory already existed, and with the config file on it).

But now, I seems that the saving of the log file fails, and I can't find the directory.
Is there any other change in the new release (permissions or something) that could explain this?
Or some way I can force the creation of the directory?

Add some functionality into the app, which asks the user on first run of the app and store that information in TinyDB

Taifun

1 Like

Thanks a lot Taifun.
I think I did it in another tablet with Android 11. But I don't know how to do it in Android 4.2.2 (or if it can be done at all)

Will do.
Despite I'm afraid it's a behaviour that could be hard to replicate, if the software is finally to run in a server with other than Android OS.

https://www.google.com/search?q=how+to+enable+developer+options+android

Taifun

1 Like

Thanks for all your help, gentelmen.
Fortunatelly I discovered that my tablet with Android 11 is writing some logs, and in them I saw something strange.
I will report when the problem is found and solved.

Every thing is fine now.
I just found my problem was some unexpected reading from a data base created an error that prevented the app writing subsequent log files.

All I need is remember to delete the "s" from HTTPS in the URL when downloading the project to old devices (Android<10).

Thanks a lot for your help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.