How do you create an APK?

Hello,

I am new to the platform and I was able to complete this tutorial Firebase Authentication in App Inventor Using Javascript as shown below screenshot with the help of @Ria_Das:

But I do not know how and where to add/or configure these files:
image

However, the tutorial does not explain or give steps to compile the app all the way to download as an APK for Android.
Can someone please guide me on how to have an APK from this screenshot?
Thank you.

http://ai2.appinventor.mit.edu/reference/other/appstoplay.html

Taifun

This is only 1 file called FirebaseAutenticator.html
You will have to upload it in the Media section into the assets of your app

You also can replace the if then else block and just write

http://localhost/FirebaseAutenticator.html

as HomeUrl

Taifun

Thank you @Taifun.
I am having this error:


Please any idea on how to fix it?
Thank you.

Try to test it with phone and companion not an emulator.

Thank you @Ria_Das
I have an Android and I just tried it with AI Companion also built as apk and I am having the same error.
I suspect the FirebaseAuthenticator.html path... but don't really know where to start troubleshooting.

Maybe the credentials:


I am confused as I don't really know coding and just wanted to follow the tutorial to complete my school assignment.

Have you tried ?

Also did you set debugMode to false before building apk ?

I replaced the if if-then block with http://localhost/FirebaseAutenticator.html, now on the Android and emulator it is changed to 404 Not Found

Please any idea?

This should work with Companion & the APK. Did you check it? If so, and you still get an error message, post the relevant block(s).

Maybe the specific quide is outdated ? I tried to follow it and got the same error, 404 not Found. Tested with companion and as apk. Html is in assets and use local host to load it

Try this:

GetASD.aix (5.3 KB)

1 Like

Now, with your extension html part is loaded perfect but doesn't run the script part even though my firebase's credentials are correct.

Managed to make it work, changes made...

image

Blocks are dragable

Aia to test

firebase_javascript.aia (16.5 KB)

1 Like

Is this necessary?

http://localhost/FirebaseAuthenticator.html

should work in all Android versions and in Companion and compiled ?

Tested with android 9, with companion and as apk and didn't work for me. See #post10

Btw, READ permission is incorrectly requestet on Android 9 (Companion).

You are absolutely right, tested again with localhost and works. Don't know why I got that error...

As for @Martial_Dong 's problem I noticed a missing not block

instead of

and maybe he has to check again that html file loaded in assets is named FirebaseAuthenticator.html and his credentials

Test aia

firebase_javascript_1.aia (11.9 KB)

1 Like

@Taifun @TIMAI2 @Ria_Das @Anke @ I just download the aia file from Ria_Das and it is working on AI Companion, Emulator and apk.
I don't know how to say thank you for taking the time and troubleshoot this. :slight_smile: :raised_hands: :raised_hands: :raised_hands:


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.