Problem with July 30 2020 Version: nb184 no longer able to write and read files

Problem with July 30 2020 Version: nb184 no longer able to write and read files


Before opening my file with nb184 the app was working, no I am gettting the error the file /yyyyyyy could not be found.

We cannot see enough of your code!

Also, when you get a value from TinyDB, your code does not test if there was a value collected, which is essential.

The code was working perfectly before. The issue is even worse, as it destroys hitherto working Apps as soon as they are opened with the new release.
You don't need code just try to store, retrieve or delete a file form a companion.

The issue pertains sofare file1 not tinydb1 actios. As hitherto working apps are destroyed when opening with the new release I didn't have a chance to test if tinydb1actions are also effected.

@H_K_Buecher What version of Android are you running?

We're investigating reports of file issues.

Works fine here using Companion to store, retrieve and delete.

The attached example contains a csv file in Assets. The app copies the file to the / sdcard and posts its contents to the TextBox. Now, modify the file in the TextBox, then save the modified file (to the / sd card) using the SaveFile. Wait a second and now uUse the LoadFile from sd card / button and it works (the file saved to the sd card loads)
.

Now use the Delete. Delete removes the file. How do I know? LoadFile from sd card button and it elicits an error 2101 (file cannot be found :slight_smile: ).

Regards
Steve

Where is your example?

FileControl.aia (2.6 KB)

Galaxy TAB A with Android 10.
Again: My App loaded on the tablet and built before July7 is perfectly working. When opening the hitherto smoothly working App with the new Version and loading this modified APP to the tablet it falters.
Just tell me how to roll the App Inventor back to the previous version so that I may continue with my development..

Thnaks. The problem in general with the Samsung Tablet Android 10 is that it loads and finds the /files only to the TAB root directory , but thsi has before never been a problem.
I would appreciate to learn how to roll back may APPInventor to the previous version, when all was working smoothly.
Shall a sent the complete APP (the one still working on my tablet) and the newly no longer working APP ?

I am having the exact same problem as @H_K_Buecher reported. I am running android 10. While is true that example provided by SteveJG works, that is the only combination it does(private internal folder). If you want to save in a given public folder of your external storage you can't . Just a few days ago it was possible. The same application that worked now does not. You still can save in the root (/) , but then you cant retrieve the information

Got the same problem with creating .csv files as you guys.

No, it is written to the app-specific directory (ASD):

Companion:

/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files

compiled app (APK):

/storage/emulated/0/Android/data/<packageName>/files

Cause:
The file component (for API level ≥ 29) adds the ASD path to the beginning of each path that you declare.

If I save a text in the ASD

this path is returned (but doesn't exist and cannot be created):

/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/Android/data/edu.mit.appinventor.aicompanion3/files/text.txt.

Therefore you get an error message.

When I create a new directory (/myDir/storage/emulated/0/myDir (using the TaifunFile extension, → WRITE permission granted!): App Inventor Extensions: File | Pura Vida Apps

this directory is created without any problems. However, the file component points to this path:

/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/myDir

However, this path does not exist, which is why you get an error message.

This is a bug (on devices with API level ≥ 29, no issues on Android 9 devices) @ewpatton @Susan_Lane

Solution / workaround (checked): Use the EFile extension from @vknow360:

@Ignacio_Escribano @wojti99

4 Likes

Needs a small correction.
The correct path is:
/storage/emulated/0/AppInventor/data

But that path also exists on my phone :worried:

No, the ASD is:

/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files

Oh...got it.
You are using ASD block which will return path of running app's ASD.

An AppInventor with the a version before nb184 should be made available, to allow working on APP developed before July 7th, until the reported bug issue has been solved. Keep in mind, opening a working APP with the nb184 Versions renders before flawlessly working APP useless.

LC_Abfrage_60.aia (132.5 KB)

There is an offline version of AI2 (nb183c), but it won't help you because it still targets API 28. Since Aug. 3, all new apps must target API 29 (Android 10) (targetSdkVersion = 29).

However, if you want to update an app published before Aug. 3, you can use the offline version. Otherwise you can use the EFile extension (until the bug is fixed), as I said earlier.

Dear Anke,
thanks for the comprehensive reply.
How "soothing" not to receive "a wise crack" answer but a clear statement, that the bug exists and a remedy is promised.
Again thank You.
Hermann Buecher

Thank you. I 'll go with efile until de bug is fixed.

when you say " There is an offline version of AI2 (nb183c), but it won't help you because it still targets API 28. Since Aug. 3, all new apps must target API 29 (Android 10) (targetSdkVersion = 29)." . That is if I pretend to publish in play store, but if I only want to install it myseft with the apk I should by fine with offline version , don't I?