Bug? Image Picker doesn't work

Hi everyone, let’s see if you can help me one more time hehe

I spent hours trying to make it work but nothing worked so far.
Anyone has any idea on how to solve it or can test image picker to see if it is working in your phones?
image
None of this changes anything at the app, all the labels and images continue as if I didn’t pick an image.
PS: I can’t test image picker or use “Do it” function because if I try to use image picker on companion the app crashes.
The only way is to export the .apk and install on my phone, where it doesn’t crash but don’t work either.

1 Like

This is working for me in companion
image

Can you post an as small as possible aia here that shows your problem?

1 Like

Hi Peter, thanks for helping.
Here is the aia example:
imagepicker.aia (2,2,KB)
I am using Android 6.0, may be that is the problem? The app doesn’t use any special function not supported by android 6

Edit: My friend just tried the apk - of the final app, not this aia based - on a most recent version - not sure what, he doesn’t know how to see it, but I know it is 7+ - and didn’t work either

So it displays the paths and the image ok where it should.

1 Like

I am aware of the image_picker image, but I decided to try that too so I could test all the possibilities.
PS: I just got to test at another phone with android 9.0 and only get selection worked too.


Do you think I can change it from Discussion to Bug category, Peter?

There was an error in your blocks. They were pointing to the same image.

image

This works as it should in my companion.

1 Like

You are right :sweat:
But still, even with the blocks the same way you used companion closes after I pick an image on companion.
Actually even withou “when image picker after picking” block companion will imediately close after I pick an image.

It is not closing my companion. Maybe a memory problem.

Try my simple example and check if it works for you:
grafik
imagepicker2.aia (2.0 KB)

The apk works but if using companion it crashes.
What is your android version?

it’s working on Android 9, 8, 7, 5

1 Like

Are you sure you have updated to the latest companion version? If not, do it, otherwise deinstall it, reinstall and grant all permissions.

1 Like

I did it a thousand times.

1 Like

to find out why it crashes, you could use logcat…

I normally use Eclipse and Logcat there, but if you have installed the App Inventor Software (see also Installing and Running the Emulator in AI2), you already have everything you need to use logcat…

How to use Logcat

  1. connect your device using USB with your computer

  2. in File Manager go to the App Inventor directory, which is C:\Program Files\App Inventor or similar

  3. press Shift and right mouse click the subdirectory commands-for-Appinventor to get the context menu

  4. select " open command window here " and you will get a command window of that subdirectory

  5. enter adb logcat *:E and the logcat will start running and log all errors

  6. start your app to elicit the error

  7. copy the log (see below)

To copy your log, right click, click “select all” and enter to copy the complete log into the clipboard, then open Notepad and paste it using ctrl-v.

Taifun

1 Like

Thanks Taifun, your posts always save my life, but this time it will not work.
I can’t install Emulator at my computer. I believe it is because it is a very old computer and I can’t upgrade to most recent version.

I have opened topics asking for help here at kodular and almost every forum I could find but even doing a lot of corrections nothing could make it work at my PC.

Since it look to be a problem only at android 6.0 - or may be not even that - I will just ignore it. If it work at the apk is what matter.

see also @Hossein’s tips here


Taifun

1 Like

Hello!

I have been having the same problem. Here’s how I managed to solve it:
Image_Utilites

I had a similar issue and this solved it for me.

blocks

Adding the “file://” solved showing it in the gallery (that’s how I’m showing them). The other one is that I’m uploading it to firebase storage and the “file://” breaks that. You also can’t pick something from Google photos that isn’t stored on the device (that’s why I’m checking if it’s a string, apparently the images in the cloud don’t show up in a string).

3 Likes

Thanks a lot! good solution. :clap: