Setup freeCodeCamp Mobile App Test Environment

i need some help/explanation to setup a correct enviroinment to compile and run correctly the freeCodeCamp Android Mobile App with linux and flutter. I think i setup all correctly because i’ve compiled in Flutter the mobile app without error but a blank screen appear when i run it. I suppose i have to run a docker app because the presence of the source code in that project but i don’t know how do it. I think i know flutter (because i developed an app) but i do not know how to run docker app on linux. I need some help to set the correct environment to test the app. Thank you and appreciate everyone could help. Massimo

Hey Massimo,

I am glad to hear you want to contribute to the mobile app.

Have you downloaded an emulator from Android Studio? If not, I recommend you do.

Good! I’ve Android Studio installed and the Emulator is OK. When i run the app from VSCode either in the emulator or in a real Android 8.0.0 Phone the result is the same: The app hang at a black screen and nothing happend. No error appear. I suppose ineed to start another piece of software that is in conjunction with the mobile app and in vscode is called “mobile-api”, but i do not know how to do it. Please help!
freeCodeCamp_Mobile_App_ 23-06-2022 23-36

That seems a bit weird to me, I have never experienced that myself before.

You should be able to run the app without the api being run locally.

Have you tried running debug instead of just installing the app and trying to open it?
You can do this by doing the following:

  1. Go to the mobile app directory
    cd mobile-app

  2. Run the app with flutter
    flutter run

There might be some issues with your flutter installation, or you need to download some of the packages.

You can do this by running flutter pub get this will install any missing packages that are needed to run the application.

If that does not work, you can always run flutter doctor, this will give some information on potential problems.

i cloned the reposirtoy, commented the .env file in pubspec.yaml and instructed the suggested command but the result was the same as you may see… any idea?
fCC App 27-06-2022 09-33

Does everything seem “OK” when running flutter doctor ?

Also have you tried waiting a while?

if i wait 5 minutes after

flutter run

nothing happend.
If i run

flutter doctor

everything work fine.

is the correct github project i use?

what’s the flutter version you use? is your version an older version (2.10) ?
can you post your “flutter doctor” output?

P.S. i saw this in code:
String baseUrl = (await _testservice.developmentMode()) ? '' : '';

does the accesso to need a developer key?

I run the project in debugging mode and i found this:

[ERROR:flutter/lib/ui/] Unhandled Exception: Instance of 'FileNotFoundError'
E/flutter ( 3755): #0      DotEnv._getEntriesFromFile
E/flutter ( 3755): <asynchronous suspension>
E/flutter ( 3755): #1      DotEnv.load
E/flutter ( 3755): <asynchronous suspension>
E/flutter ( 3755): #2      AuthenticationService.setCurrentClientMode
E/flutter ( 3755): <asynchronous suspension>
E/flutter ( 3755): #3      AuthenticationService.init
E/flutter ( 3755): <asynchronous suspension>
E/flutter ( 3755): #4      main
E/flutter ( 3755): <asynchronous suspension>
E/flutter ( 3755):

i suppose could be and authentication problem (need a key) or a different version of flutter.

OHHH!!! OK i solved the problem! I renemed the file




and everithing gone well. The app started correctly in the emulator.
Mainly was not so clear to me that, in principle i was wrong doing the opposite renaming in the pubspecl.yaml where i renamed .env reference in sample.env (wrong) but the oposite is correct!
Thanks SemBauke for your support and patience with me…

Good to hear you solved the problem!

I forgot to ask if you ran cp sample.env .env, Sorry!

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