File corrupted when downloading it to the phone

I don't know of a specific extension for your task.

Edit: What would be good is an extension that invokes CallLog.calls, as per: CallLog.Calls  |  Android Developers

So, the worst case scenario would be to add this as a Suggested Extension and see if it tickles the interest of one of the regular Extension Developers. Or you could try coding an extension yourself.

I removed the calls to the two extensions in my project (even if the .aix files are still included in the project) and the error message is still displayed at loading.

I also removed all incomplete blocks and checked the existing code but did not find any problem.

Take a screenshot and post it.
Which device & Android version?

You'll find the screenshot (in French). My device is LG G7 ThinQ and the system is Android version 9. Everything was working well yesterday.
I have a large amount of global variables. Is there a limit on how many global variables we can use ? I will try to remove some of them.

I do not speeak French but when I download apk with Chrome's latest update I get below image and I simply ignore it and click download anyway

2 Likes

I do the same when I get a message about "The file can be harmful" because this message is displayed for any program file. But the message I get now is different, and says "The file may be corrupted" ... But well, I must admit that the MessageBox is very similar to yours, except for the message itself.

1 Like

No. Uninstall the app. Restart your device and try again.

They could still be included in the APK.

Is this App only for your own personal use or is it going to be distributed? If it's on Android 9 and isn't going to be on Android 10+, you may be able to access the log with the File functions (need to know the file path of course).

2 Likes

I made some cleaning, changed global variables to locals, uninstalled the app, restarted the phone and reinstalled the application but got the same message. At the end, the application is running correctly; but I still have the message when downloading it to the phone.

If you upload your Project File (.aia) I can take a look at the underlying files to see if there is anything obviously untoward.

Before you started making changes (global to local), did you make a Backup? Ideally need to see the Project as it was when the warning first appeared.

Also - what happens when you run the App via the Companion?

1 Like

Sorry, I don't have a backup. Here is the aia file. I have to say the software architecture is not so good but I am new at using this platform, and did not had a lot of time to spend on this project.
According to the websites where I downloaded the extensions I use, using them via the Companion is not possible.
DernierAppel (1).aia (42.4 KB)

Download aia, compiled it as apk and when I download I only get .. Note that I test it in Xiaomi MI A1 android 9

3 Likes

Thank you for trying it. So may be the "Corrupted" message in french is just a bad traduction from the english "File might be harmful" ?

Temporarily change phone's lanquage from French to English (Unites States) in order to check it

1 Like

Well, you know how to export your Project, so please get into the habit of saving backups frequently - it will save your hair from going gray :upside_down_face:

1 Like

As suggested, I turned my phone to US English, and got only the "file might be harmful" message when downloading the application. So it seems that the problem only comes from a bad translation of messages. Thank you to anybody that helped me on this point.

1 Like

For a newbie to the software you have done well - if you continue to use App Inventor, there are some very good guides on the forum and three of the Power Users have websites with tons of handy stuff.

Tip: Set the Screen Orientation.

Tip: The number of Blocks in Screen Initialize should be kept to a minimum. Most can be put in a Procedure and called from Screen Initialize (last task in the Initialize Block).

2 Likes

That is indeed sometimes the case (The Companion is an App in itself) but often extensions do work with the Companion. On the other side of the coin, extensions often do not work in the Emulator.

Thank you. In fact, I am a computer engineer and I work with C#, but in App Inventor I did not find immediatly how to use local variables. That's why I mostly used globals which is not recommended. I am something new at App Inventor but I like it, and try to create useful programs.