Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Inventor emulator issues #35

Closed
adjei7 opened this issue Jan 27, 2020 · 13 comments
Closed

App Inventor emulator issues #35

adjei7 opened this issue Jan 27, 2020 · 13 comments

Comments

@adjei7
Copy link

adjei7 commented Jan 27, 2020

Unable to use this extension on App inventor with the Emulator. I can get it working as a regular .apk but receive error messages when trying to test with the emulator.

When using the example app CirclesAndRectangles

When emulator starts, receive error message:

'Runtime Error: Error from Companion: java.lang.NoSuchMethod.Error: com.google.appinventor.components.runtime.Form.openAssetForExtension'

When running the app through the emulator, receive error message:

'Runtime Error: invoke: no method named `ClassifyImage' in class java.lang.Boolean
Note: You will not see another error reported for 5 seconds.'

Any possible resolution?

@MrMazzone
Copy link
Contributor

Hello @adjei7 , are you using the App Inventor emulator on Mac or Windows? They are different.

I am not receiving that error on Windows, however, I am receiving an error in regards to the size of the image file that is temporarily stored to sent to ML for Kids to be classified.
image

@kylecorry31 We could possibly work on reducing the size of this image to work better on the emulator.

@adjei7
Copy link
Author

adjei7 commented Feb 3, 2020

Hellow @MrMazzone,

Thanks for getting back to me. I am using the emulator on Windows 10. I initially tried with the offline version of app inventor, when I got the message. However, I have also tried with the regular online version. I am using companion 2.56.

I don't seem to have the file size issue you mentioned. Do you know what the NoSuchMethod.Error refers to?

Thanks, again.

@kylecorry31
Copy link
Owner

@adjei7 I will look into this issue this week. Where did you get the ML4K extension that you are using - from GitHub or from the Machine Learning For Kids website?

@kylecorry31
Copy link
Owner

Hello @adjei7 , are you using the App Inventor emulator on Mac or Windows? They are different.

I am not receiving that error on Windows, however, I am receiving an error in regards to the size of the image file that is temporarily stored to sent to ML for Kids to be classified.
image

@kylecorry31 We could possibly work on reducing the size of this image to work better on the emulator.

@MrMazzone I am already reducing the image size before sending it to the ML4K API - does this issue you see appear anytime an image is taken in the emulator (regardless of whether you use ML4K)? Also, does anything crash when that warning is thrown?

@adjei7
Copy link
Author

adjei7 commented Feb 4, 2020

@adjei7 I will look into this issue this week. Where did you get the ML4K extension that you are using - from GitHub or from the Machine Learning For Kids website?

I got the extension from the ML4K website when I first saw the error. After that I tried with one of the examples on Github and got the same issue.

@adjei7
Copy link
Author

adjei7 commented Feb 4, 2020

Hello @adjei7 , are you using the App Inventor emulator on Mac or Windows? They are different.
I am not receiving that error on Windows, however, I am receiving an error in regards to the size of the image file that is temporarily stored to sent to ML for Kids to be classified.
image
@kylecorry31 We could possibly work on reducing the size of this image to work better on the emulator.

@MrMazzone I am already reducing the image size before sending it to the ML4K API - does this issue you see appear anytime an image is taken in the emulator (regardless of whether you use ML4K)? Also, does anything crash when that warning is thrown?

No. The first warning is thrown whenever the emulator runs. The second error is thrown when you try and use the emulator. Nothing seems to crash. It seems to be an issue with or without images. I'm still running tests, however. App inventor have just released nb182 with a new companion so will check that out, and let you know if anything changes.

Thank you,

@adjei7
Copy link
Author

adjei7 commented Feb 4, 2020

@MrMazzone @kylecorry31 I managed to test it out a bit further and it seems my main problem was using an old ai2starter. I have since tested it the ML4K extension on the latest I could get which was 4.3. I am no longer getting the above error messages, but when I try and run the programs, the app on the emulator crashes.

Could you please let me know the ideal emulator setup. Is there a newer one than aistarter 4.3. It had companion 2.57. Any guidance would help.

Thanks,

@MrMazzone
Copy link
Contributor

Great to hear @adjei7 ! It looks like you have the most up-to-date versions.

My suggestion would be to completely uninstall the emulator/aistarter and reinstall it.

Another suggestion would be to try another emulator if you cannot use/have a device. Maybe Bluestacks?

@MrMazzone
Copy link
Contributor

MrMazzone commented Feb 4, 2020

Hello @adjei7 , are you using the App Inventor emulator on Mac or Windows? They are different.
I am not receiving that error on Windows, however, I am receiving an error in regards to the size of the image file that is temporarily stored to sent to ML for Kids to be classified.
image
@kylecorry31 We could possibly work on reducing the size of this image to work better on the emulator.

@MrMazzone I am already reducing the image size before sending it to the ML4K API - does this issue you see appear anytime an image is taken in the emulator (regardless of whether you use ML4K)? Also, does anything crash when that warning is thrown?

@kylecorry31 This error appears and crashes the app when the app has to locally save the file to upload to ML for Kids server. This is because of the way you must retrieve the canvas drawing where the method saves the image of the canvas before upload/classification.
image
It happens even if you save an image with canvas not ML4K related, so just worth noting another issue with using emulator. Not one we will most likely fix as it is not extension related.

@adjei7
Copy link
Author

adjei7 commented Feb 9, 2020

Hi @MrMazzone and @kylecorry31,

Just an update on my efforts. First of all, thanks so much for your assistance.
I realised my initial issue was related to the emulator not being the most uptodate. I was using 2.46, which AI2Offline comes with, and doesn't allow updating. After using the emulator with the regular companion app from the app inventor website, the issue goes away (just a heads-up for anyone in the same situation).

I took your advice and tried other emulators, Bluestacks, Nox and Memu and they seemed to work much better.

Another query. Are the apps intended to stop working after a while? Is the API time limited? Apps I created previously via the ML4K website extension, no longer render a result when they used to.

Thanks, again.

@dalelane
Copy link
Collaborator

dalelane commented Feb 9, 2020

Are the apps intended to stop working after a while? Is the API time limited? Apps I created previously via the ML4K website extension, no longer render a result when they used to.

Machine learning models you create in Machine Learning for Kids will expire (after a time period that you can configure).

For more information about this, please see my reply at https://groups.google.com/forum/#!topic/mlforkids/AGFw9NF8Bf4

@adjei7
Copy link
Author

adjei7 commented Feb 9, 2020

Are the apps intended to stop working after a while? Is the API time limited? Apps I created previously via the ML4K website extension, no longer render a result when they used to.

Machine learning models you create in Machine Learning for Kids will expire (after a time period that you can configure).

For more information about this, please see my reply at https://groups.google.com/forum/#!topic/mlforkids/AGFw9NF8Bf4

Thank you for your swift reply.

@kylecorry31
Copy link
Owner

@adjei7 Glad to see that you were able to resolve this issue. I put the link to this thread in the README in case anyone else experiences this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants