None of the answer brought me to the solution and others similar topics tell us that the probem spread all over the community. I SOLVED THE PROBLEM even if I did not understand the solution, anyway it works and it's stable. Here the way to save picture from canvas and share them with firebase:
The secret is to set a generic label (you can make it non visible) with the saving block of canvas (what sense is this blocking ment to have? [idk]). THEN you load the saved picture in a image component (also this can be non visible) but you have to recall the picture using the "doubled" directory (you will notice that this block setup brings to this wrong directory if you make the label visible [idk 2.0]). So you select the path of the file, in the firebase block, from the image component.
It also works without passing from the image component but sometimes it fails with the 1104 error code (????? [idx. the revenge]). I do not know if it's necessary to use the getASD1 component, conclusion at your try
For a device running Android 10, and using companion, these blocks save a canvas to the Companion "ASD", and using that path upload the file to Firebase Storage.
TIMAI2 your setup does not work and error 1104 occurs every time. Canvas has a sort of saving issue I guess. I tried thousands of combination and technique. The only one that worked is showed in my previous message, and it is the only one that worked with companion and with the installed apk
No I have already tried a clock solution and also to split the action in two buttons but nothing changed. Your solution, in my phone, works with audio files or pictures from other components. When canvas is used the problem arise. Anyway, lot of people are having my same problem and no solution have been provided in many q&a... So that is a further solution and I hope it will help in future
If you save the image as @TIMAI2 suggested, first check whether this image exists. If so (and it will be there), try to set the path for Firebase like this for API ≥ 29 (Android 10+):
Have you tried my approach? @Noemi_C@Fulvio_Cordella
If so, does it work? I think so. If I don't get an answer to this, I'll remove the Solution marker as this might confuse others and it is not a suitable solution.
Hi, I'm sorry but I am not able to try your solution due to technical problems. So, thank you for your time and remove the solution if you mind. I'll try as soon as possible to give you feedback. Thank you again
Hello, I've tried your way but it doesn't work. No error is showed and the savage seems to work. But when I open the firebase storage bucket the picture is not in. I tried with apk only because the companion is having problems recently
Yes I did. Now things changed. I do not know what is happening but there should be a problem in connecting with companion and in the apk builder also. Now it works... (?)
I'll wait a little longer to see if there are any objections or if anyone claims my approach won't work for them until I mark my approach as a solution.
When AI2 has to target API 30 (Aug 2021), this might cause (further) problems. Since directories outside of the ASD require WRITE permission (for devices with API < 29), adjustments must be made in the Manifest, see here:
Will this be automatically declared by AI2 in the Manifest?
If I had published apps on the Play Store, I wouldn't rely on that. In addition when using only ASD no permissions (READ/WRITE) will be required.
In order to avoid the requirement of these permission, one should already now do it as I suggested (although permissions are still incorrectly requested by some components at the moment; but I'm (pretty) sure this will no longer be the case from Aug 2021).