Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Setting up your development environment for the Moodle App: Difference between revisions

From MoodleDocs
(Add troubleshooting guide for XCode build error)
(Update migration status and path)
 
(42 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Moodle Mobile}}
{{Template:Migrated|newDocId=/general/app/development/setup}}
{{Moodle Mobile 3.5}}
{{Moodle App (Ionic 5)}}
The structure of this page is the following:
* The first part, up to the point where you get the <code>npm start</code> command to work, includes the basics of what you need to work on the app.
* The second part indicates how to build the app to run it on a native device (or emulator).
* The third part includes a list of troubleshooting advice. If you encounter a problem that is not already listed, please consider adding it.


Note: These instructions do work (give or take) for the current 3.5.x version of the Moodle Mobile app.


== Overview ==
Most of your development can happen on a browser, you only need to use an emulator if you have to work on native functionality.
 
The structure of this page is
* the first part, up to the point where you get the 'ionic serve' command to work is what you need to be able to do development on the app and test it in a browser.
* the second part is about how to buld a version of the app that can be run on a device.
* then at the end is a list of troubleshooting advice. If you encouter a problem that is not already listed, please consider adding it.
 
The majority of your development will be done using a browser. You will probably on begin to use an emulator once you need to simulate a real mobile device.
 
If you are just [[Mobile support for plugins|adding mobile support to plugins]], remember that most of your development can be done using the online pre-built version at https://mobileapp.moodledemo.net/ (with Chrome or Chromium). However, if you want to be able to to write [[Acceptance_testing_for_the_mobile_app|automated acceptance tests for the app]] then you need to follow this page at least as far as getting the ionic serve command to work on this page.


If you are just [[Moodle App Plugins Development Guide|adding mobile support to plugins]], you probably don't need to build the app yourself and you can skip reading this page.
== Requirements ==
== Requirements ==
Windows tip: ingore any use of the sudo command below. Just use the command without it. Most things work that way, and if they don't try in a Powershell window that you have opened with 'Run as administrator ...'.
===Install a browser for development===
===Install a browser for development===
Most of the time we recommend that you use a browser for development; the app will work in any Chromium-based browser. We recommend using the Chromium browser (an open source alternative to Google Chrome). You can get it from the [https://www.chromium.org/getting-involved/download-chromium official download page].


We recommend Chromium browser (Google Chrome open source version) https://download-chromium.appspot.com/
To learn more about using a browser for development, and why it needs to be Chromium-based, read the [[Using the Moodle App in a browser]] page.
Please, read [[Moodle_Mobile_development_using_Chrome_or_Chromium]] for more information
 
===Install git===
===Install git===
You will need to install Git in order to get the source code and upload your changes. If you are not familiar with it, we recommend that you get started reading the following guide: [https://git-scm.com/book/en/v2/Getting-Started-Installing-Git Installing Git].
===Install Node.js and Npm===
We recommend using a version manager like [https://github.com/nvm-sh/nvm nvm] to make this easier, you can prepare the correct environment running <code>nvm install</code> in the project root. Remember to run this every time you work with the app, or if you’re not working on any other node projects in your computer you can run <code>nvm alias default `node -v`</code> to make it the default.


https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
It may seem simpler and easier to install directly from [http://nodejs.org nodejs.org], but actually it is more tricky to get that to work. If you have previously installed Node directly, and want to switch to nvm, you need to uninstall node completely before installing nvm - or search for trouble-shooting instructions online.
 
===Install native SDKs===
===Install Node.js===
If you intend to run the application in a native device, you will need to install that platform's native SDKs. You can learn how to set up your environment by reading Ionic’s documentation for [https://ionicframework.com/docs/developing/android Android] and [https://ionicframework.com/docs/developing/ios iOS].
 
On Linux we recommend you use [https://github.com/creationix/nvm nvm] - this lets you switch Node versions, and makes the install a bit easier than the official installation route.
 
nvm install latest
nvm use 11.12.0 # Or whatever number nvm install reported.
 
(Exact version is probably not critical. Moodle HQ devs report using both 8.12.x and 11.12.0 as of 2019-03-25.)
 
On Windows we recommend you use https://github.com/coreybutler/nvm-windows. Same nvm commands as for Linux.
 
On Mac users we recommend to install NodeJS via Macports.
 
(It may seem simpler and easier to install directly from http://nodejs.org, but actually it seems to me more tricky to get that to work. If you have previously installed Node directly, and want to switch to nvm, you need to un-install node completely before installing nvm - or Google for trouble-shooting instructions, for example https://github.com/coreybutler/nvm-windows/issues/58#issuecomment-272608696.)
 
===Install ionic===
npm cache clean
npm install -g cordova@8.1.2 ionic    # (If it throws an EACCESS error, run it again with sudo)
 
===Install the npm required packages===
sudo npm install -g gulp                      # (This will install gulp in a folder that should be in the PATH)
 
===Windows only: Native build dependencies===
===Windows only: Native build dependencies===
 
<code>node-gyp</code> requires native build tools for your platform. If you're developing on Mac or Linux, you'll probably have these already ([https://github.com/nodejs/node-gyp/blob/master/README.md refer to the docs if you don't]). On Windows, run the following command as administrator (in cmd or Powershell):
node-gyp requires native build tools for your platform. If you're developing on Mac or Linux, you'll probably have these already ([https://github.com/nodejs/node-gyp/blob/master/README.md refer to the docs if not]), on Windows, run the following command as administrator (in cmd or Powershell):
<syntaxhighlight lang="bash">
 
npm install --global --production windows-build-tools
npm install --global --production windows-build-tools
</syntaxhighlight>
 
Warning! This installer can take a very, very long time to run. We were seeing it take hours. Literally. Be prepared to be very patient. Don't just make the natural assumption that it has crashed.
Warning! this installer can take a very, very long time to run. We were seeing it take hours. Literally. Be prepared to be very patient. Don't just make the natural assumption that it has crashed.
 
===Mac only: Push notifications===
===Mac only: Push notifications===
This is only be necessary if you intend to compile the native iOS application. The push notifications plugin requires CocoaPods to work on a Mac; you can find the complete installation instructions in [https://cocoapods.org/ the official documentation], but it should work by running the following commands:
<syntaxhighlight lang="bash">
sudo gem install cocoapods
pod setup
</syntaxhighlight>
Please note that for compiling the app in Mac you need to open the '''Moodle.xcworkspace''' file, more information here: MOBILE-1970.
===Linux only: libsecret===
If you are using [[Moodle App scripts: gulp push|the gulp push script]], you need to have <code>libsecret</code> installed before running <code>npm install</code>. Depending on your distribution, you will need to run one of the following commands:
<syntaxhighlight lang="bash">
# Debian/Ubuntu
sudo apt-get install libsecret-1-dev


Phonegap plugin push 1.9.0 requires CocoaPods to work on a Mac. The installation steps can be found in https://cocoapods.org/
# Red Hat
sudo yum install libsecret-devel


sudo gem install cocoapods
# Arch Linux
pod setup
sudo pacman -S libsecret
</syntaxhighlight>
== Running the app in a browser ==
You can obtain a copy of the source code by cloning the public repository. If you want to work on the latest development version, you should check out the <code>integration</code> branch:
<syntaxhighlight lang="bash">
git clone git@github.com:moodlehq/moodleapp.git
cd moodleapp
git checkout integration
</syntaxhighlight>
Once you have the correct environment set up, you can run the application with the following two commands:
<syntaxhighlight lang="bash">
npm install
npm start
</syntaxhighlight>
This will launch the application in a browser and you should be ready to start coding (you may also want to [[Using the Moodle App in a browser#Configuring_the_default_browser|configure the default browser]] for future runs). This compiles the entire application and can take a while, so don't worry if it doesn't open the browser instantly. Keep in mind that this command may open the browser before the dev server is ready, and you could get a network error. If that happens, just wait until the dev server is ready and launch the application again. It should be ready when you see a "Compiled successfully" message in the console.


Please note that for compiling the app in Mac you need to open the .xcworkspace file, more information here: MOBILE-1970
Congratulations, you have just completed the basics to become a Moodle App developer!


== Clone the app base code ==
If you need to work with native features or build packaged versions of the app, you can read the rest of this page.


Clone the code base into a local directory in your computer.
== Running the app in Android and iOS ==
It may be an idea to work from the integration branch rather than master.
The first time you want to run the application in a native device, this process will take a bit longer than usual because it needs to create the native projects and install native plugins. These will be created under the <code>platforms/</code> and <code>plugins/</code> folders respectively. If you ever run into issues during this process, try deleting both of these folders to get a clean start.
git clone https://github.com/moodlehq/moodlemobile2.git moodlemobiledirectory
cd moodlemobiledirectory
git checkout integration


== Setup the environment ==
In order to run the application on a native device, you can use one of the following commands:
<syntaxhighlight lang="bash">
npm run dev:android  # Uses Live Reload, read below
npm run dev:ios      # Does NOT use Live Reload, read below
npm run prod:android # Uses AOT compilation, read below
npm run prod:ios    # Uses AOT compilation, read below
</syntaxhighlight>
If you get any errors while building, please see the [[#Troubleshooting|Troubleshooting]] section below.


Please, note that if you are creating a custom app with a custom URL scheme, you should edit the /package.json and /config.xml files and specify there your custom URL_SCHEME (replacing the existing value) and your [https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md GCMPN SENDER_ID].
You can also inspect the HTML and look at the console logs by using [https://developer.chrome.com/docs/devtools/remote-debugging/ Chrome's Remote Debugging for Android] and [https://support.apple.com/guide/safari/use-the-developer-tools-in-the-develop-menu-sfri20948/15.1/mac/12.0 Safari's Develop menu for iOS]. This will only work with emulators or devices connected to your computer running with the development environment.


The following command must be run in the project's root folder:
=== Developing using Live Reload ===
npm run setup
Most of the time, it is recommended to develop using the <code>npm start</code> command. Working in a browser is faster, easier, and doesn't have as much overhead. However, in some situations you may want to run the application in a native device. If you want a similar development experience, you'll want to enable [https://ionicframework.com/docs/cli/livereload Live Reload].


If this fails, you can see what it is doing by looking at the 'scripts' section in package.json. At the moment it is doing <tt>npm install && cordova prepare && gulp</tt>. That is, running three commands back-to-back, but only carrying on if the previous one succeeds completely. You can try running the three commands separately. If you do, <tt>ionic serve</tt> (see below) may work, even if <tt>cordova prepare</tt> gives errors. You only really need <tt>cordova prepare</tt> to work if you are going to go on and build the app.
In Android, you can use the <code>npm run dev:android</code> command and the application will launch on a device or emulator. Whenever you make any changes to your code, the application will reload automatically. Keep in mind that this command may launch the application before the dev server is ready, and you could get a network error. If that happens, just wait until the dev server is ready and launch the application again (you should see "Compiled successfully" in the console).


== Open the app in the browser ==
In iOS, there are some limitations using live reload and that's why the <code>npm run dev:ios</code> command doesn't enable it by default. You can still use it by running <code>npx ionic cordova run ios --livereload --external</code>, but keep in mind that this will serve your application on an IP and will expose it to anyone connected to the same Wi-Fi network. Other than privacy concerns, this may cause some problems if you are working with iframes or local files. If you have any problems with that, you'll have to use the <code>npm run dev:ios</code> command to recompile the application every time you change the code.
First start Chromium via the command line using the custom parameters as is mentioned here: [[Moodle Mobile development using Chrome or Chromium]]
=== Compiling using AOT ===
Angular has 2 ways of compiling: [https://angular.io/guide/glossary#jit JIT] and [https://angular.io/guide/glossary#aot AOT].


and then, start the Ionic server:
Running <code>npm start</code>, <code>npm run dev:android</code> or <code>npm run dev:ios</code> compiles using JIT, which is faster to compile but the app takes longer to start. This is acceptable during development because it allows you to use Live Reload.


ionic serve --browser chromium        # or chrome or whatever browser.
The <code>npm run prod:android</code> and <code>npm run prod:ios</code> commands use AOT compilation because they generate production bundles.
=== Using Android emulators ===
Most of the time, you should be using an emulator running recent versions of Android, and it should work fine. But sometimes, you may want to use an older version to test a specific behaviour.


If you don't want to open any browser you should run:
If you want to run the application in an Android 5 emulator, you’ll need to upgrade the system webview because emulators come with version 37 preinstalled. Your first idea may be to upgrade the webview using the Google Play store, but it will not work because the webview served by Google Play is <code>com.google.android.webview</code> whilst the system webview used in emulators is <code>com.android.webview</code>. You can do the following instead.


ionic serve -b
Once you have [https://developer.android.com/studio/run/managing-avds created your Android 5 virtual device], you’ll need to do download [https://android.googlesource.com/platform/external/chromium-webview/+/refs/heads/oreo-m3-release/prebuilt/x86_64/ the apk for Webview 61] and run the following commands:
<syntaxhighlight lang="bash">
# Open the folder where the “emulator” script is installed
cd $(dirname `which emulator`)


Congratulations! Now that you have got to the piont where the 'ionic serve' command works, you can start doing development on the app. You only need to read the rest of the page if you want to build packaged versions of the app.
# Boot the emulator in write mode
# (you can get a list of device names running “emulator -list-avds”)
emulator @DeviceName -writable-system


== Updating ionic and cordova ==
# In a different shell, make /system writable
adb remount


sudo npm update -g cordova
# Uninstall the webview app manually and reboot the device
sudo npm update -g ionic
adb shell
rm -rf /data/data/com.android.webview
rm -rf /system/app/webview
reboot


Update project platforms:
# Install the new version
adb install webview.apk
</syntaxhighlight>
After doing this, remember to run the emulator in write mode for subsequent sessions, but you don’t need to call the <code>remount</code> command every time.


ionic cordova platform remove android
== Troubleshooting ==
ionic cordova platform remove ios
This section contains a list of common errors that have been found and how to solve them. However, keep in mind that these may be platform-dependent and could not fix the problem in your machine, even if you are seeing the same error message.
ionic cordova platform add android
=== General advice ===
ionic cordova platform add ios
If you are stuck with an error and you can't find a way to continue, here's a list of things you can do:
 
* Using git, look at the changes you have in your working directory and make sure that they aren't causing the problem. Be specially careful with changes in <code>package.json</code> and <code>package-lock.json</code>. You can see a list of the files you have modified running <code>git status</code>.
== Updating plugins ==
* Make sure that you are using the proper node and npm versions. You can see it looking at the <code>engines</code> key in <code>package.json</code>. If you are using [https://github.com/nvm-sh/nvm nvm], just run <code>nvm install</code>.
 
* Make sure that all dependencies have been installed properly. To be extra sure, run <code>npm ci</code>; this will remove the <code>node_modules/</code> folder and install all dependencies again exactly as described in your <code>package-lock.json</code>.
cordova plugin remove your_plugin_id
* If you are having issues trying to build for Android or iOS, try removing the <code>www/</code>, <code>platforms/</code> and <code>plugins/</code> folders and try again.
cordova plugin add your_plugin_id
* If you are using a development version, maybe the repository is broken and it's not your fault. Try checking out the <code>master</code> branch and see if you're getting the same error.
 
* Try cloning the repository in a new folder and run through the instructions in this page again. If you can, try doing it on a different computer to make sure that you're doing everything properly and it's not a problem in your machine.
== Building for Android and iOS ==
* Try creating [https://ionicframework.com/docs/cli/commands/start a blank Ionic application] and see if you're having the same problems. Make sure that you are using the same version of the main dependencies (Angular, Cordova, Ionic CLI, etc.).
 
* If you are searching for help online, maybe your problem has nothing to do with the Moodle App in particular an it's related with Ionic, Cordova, Angular, etc. Searching using the proper context will give you better solutions.
Please see the guides below to be able to build for Android and iOS using the command line:
=== I get a blank page when launching the app ===
 
This error can happen when the application is launched properly but there is a runtime error. If you get a network connection error, this may be the expected behaviour. Wait until you see "Compiled successfully" in the console and reload.
Android: https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html
 
iOS: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/index.html
 
If the build fails, please run <code>cordova requirements</code> to check that you fulfilled all requirements for the platform.
 
If you get errors while building, please see the Troubleshooting section below.
 
If using '''Ubuntu''' you should install the packages: gradle and libgradle-android-plugin-java (and all its dependencies) to build.
 
== Compiling using AOT ==
 
Angular has 2 ways of compiling: JIT and AOT. Running "ionic serve" or "ionic build" compiles using JIT by default, which is faster to compile but the app takes longer to start.
 
When building for release you should always compile using AOT, otherwise the app can take too long to start in some devices. The default AOT compiling causes some issues with the database activity and the [[Mobile support for plugins]], so you have to modify a couple of files in order to make this work.
 
First you need to open the file: ''node_modules/@angular/platform-browser-dynamic/esm5/platform-browser-dynamic.js''. Search the variable called "''_NO_RESOURCE_LOADER''", you'll see it has a function named "''get''" with this line:
 
<code javascript>
throw new Error("No ResourceLoader implementation has been provided. Can't read the url \"" + url + "\"");</code>
 
Remove that line and put this code instead:
 
<code javascript>
        url = 'templates/' + url;
 
        var resolve;
        var reject;
        var promise = new Promise(function (res, rej) {
            resolve = res;
            reject = rej;
        });
        var xhr = new XMLHttpRequest();
        xhr.open('GET', url, true);
        xhr.responseType = 'text';
        xhr.onload = function () {
            // responseText is the old-school way of retrieving response (supported by IE8 & 9)
            // response/responseType properties were introduced in ResourceLoader Level2 spec (supported by IE10)
            var response = xhr.response || xhr.responseText;
            // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
            var status = xhr.status === 1223 ? 204 : xhr.status;
            // fix status code when it is 0 (0 status is undocumented).
            // Occurs when accessing file resources or on Android 4.1 stock browser
            // while retrieving files from application cache.
            if (status === 0) {
                status = response ? 200 : 0;
            }
            if (200 <= status && status <= 300) {
                resolve(response);
            }
            else {
                reject("Failed to load " + url);
            }
        };
        xhr.onerror = function () { reject("Failed to load " + url); };
        xhr.send();
        return promise;
</code>
 
We tried to replace the default loader with our own implementation, but we weren't able to make the compiler work so the only solution left was to modify the default one.
 
Now you need to open the file: ''node_modules/@ionic/app-scripts/dist/util/config.js''. In that file you need to remove the ''context.isProd'' condition from the options ''runMinifyJs'' and ''optimizeJs''. So the final code for that part should be like this:
 
<code javascript>
    context.runMinifyJs = [
        context.runMinifyJs,
        hasArg('--minifyJs')
    ].find(function (val) { return typeof val === 'boolean'; });
    context.runMinifyCss = [
        context.runMinifyCss,
        context.isProd || hasArg('--minifyCss')
    ].find(function (val) { return typeof val === 'boolean'; });
    context.optimizeJs = [
        context.optimizeJs,
        hasArg('--optimizeJs')
    ].find(function (val) { return typeof val === 'boolean'; });
</code>
 
We want to compile in production mode but without optimizing and minifying Javascript because that breaks our plugins support. However, Ionic doesn't let you do that, so the only option is to do this change.
 
With these changes done you can now compile using production mode:
 
<code php>
npm run ionic:build -- --prod</code>
 
This command will generate the app files and put them inside ''www'' folder. If you now want to install that app in a real device you can run "''cordova run android''" or "''cordova build ios''" (please don't use "''ionic cordova ...''" or "''ionic serve''" because it will override your build files!).


== Troubleshooting ==
If that's not the case and you really are getting a blank page, look at the console and you should see some error indicating why the application is not rendering properly. Keep in mind that at the moment the application is already logging some errors and warnings, so make sure that you're not stuck trying to fix something that isn't causing the problem. You can follow any updates about this on MOBILE-3854.


If you are not seeing any relevant logs, check out what to do on the [[#General_advice|General advice]] section.
=== Strange NPM errors ===
=== Strange NPM errors ===
To get more debug output from npm commands, see [https://docs.npmjs.com/cli/v7/using-npm/config the available configuration flags]. In particular try adding <code>--loglevel verbose</code>, <code>--loglevel info</code> or <code>--loglevel silly</code> to the command-line.
=== I can't change the language ===
If you're getting a network error for a url like <code><nowiki>http://localhost:8100/assets/lang/es.json</nowiki></code>, this probably means that you haven't installed the language packs.


To get more debug output from npm commands, see https://docs.npmjs.com/misc/config#shorthands-and-other-cli-niceties. In particular try adding <tt>--loglevel verbose</tt> (or <tt>--loglevel info</tt> or <tt>--loglevel silly</tt>) to the command-line.
Currently, you can install them in your machine running the <code>scripts/update_lang.sh</code> script, but it may not work in your system if you don't have php installed. For future improvements, you can subscribe to MOBILE-3864.
 
=== Error: libsass bindings not found. Try reinstalling node-sass? ===
=== Error: libsass bindings not found. Try reinstalling node-sass? ===
 
Most of the time, running the following command will fix the problem:
Please read: http://fettblog.eu/gulp-and-node4-first-aid/, alternatively you must be sure that you installed Node v0.12
<syntaxhighlight lang="bash">
 
npm rebuild node-sass
=== node-gyp\src\win_delay_load_hook.c(34): error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers ===
</syntaxhighlight>
 
Try updating npm to the latest version using:  
 
  npm install -g npm@latest
 
 
=== com.android.dex.DexException: Multiple dex files define XXX ===
=== com.android.dex.DexException: Multiple dex files define XXX ===
Open the file ''platforms/android/build.gradle'' and add this code at the end:
Open the file <code>platforms/android/build.gradle</code> and add this code at the end:
 
<syntaxhighlight lang="groovy">
  configurations {
configurations {
      all*.exclude group: 'com.android.support', module: 'support-v4'
    all*.exclude group: 'com.android.support', module: 'support-v4'
  }
}
 
</syntaxhighlight>
=== Could not resolve all dependencies for configuration ':_debugCompile'. ===
=== Could not resolve all dependencies for configuration ':_debugCompile'. ===
Open the Android SDK Manager and make sure you have installed: Android Support Repository, Android Support Library, Google Play Services and Google Repository.
Open the Android SDK Manager and make sure you have installed: Android Support Repository, Android Support Library, Google Play Services and Google Repository.
=== Could not find com.android.support:support-v4:XXX ===
=== Could not find com.android.support:support-v4:XXX ===
Open the file ''platforms/android/build.gradle'' and add this code at the end:
Open the file <code>platforms/android/build.gradle</code> and add this code at the end:
 
<syntaxhighlight lang="groovy">
  configurations.all {
configurations.all {
      resolutionStrategy.force 'com.android.support:support-v4:24.0.0'
    resolutionStrategy.force 'com.android.support:support-v4:24.0.0'
  }
}
 
</syntaxhighlight>
=== ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font ===
=== ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font ===
 
Open the file <code>platforms/android/build.gradle</code> and add this code at the end:
Open the file ''platforms/android/build.gradle'' and add this code at the end:
<syntaxhighlight lang="groovy">
 
android {
android {
  compileSdkVersion 26
    compileSdkVersion 26
  buildToolsVersion "26.0.1"
    buildToolsVersion "26.0.1"
}
}
</syntaxhighlight>
 
=== Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK. ===
=== Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK. ===
Download [https://developer.android.com/studio/ Android Studio] and copy the folder <code>android-studio/plugins/android/lib/templates</code> into <code>android-sdk-folder/Sdk/tools</code>.
 
1. Download Android studio - https://developer.android.com/studio/
 
2. Copy the folder android-studio/plugins/android/lib/templates
 
3. Paste in the folder android-sdk-folder/Sdk/tools
 
=== Could not find com.android.support:support-v4:27.1.0 ===
=== Could not find com.android.support:support-v4:27.1.0 ===
 
Open the file <code>platforms/android/build.gradle</code> and configure like this:
Open the file ''platforms/android/build.gradle'' and configure like this:
<syntaxhighlight lang="groovy">
 
allprojects {
  allprojects {
    repositories {
      repositories {
        jcenter()
          jcenter()
        maven {
          maven {
            url "https://maven.google.com"
              url "https://maven.google.com"
        }
          }
    }
      }
}
  }
</syntaxhighlight>
 
=== Error: not found: make ===
=== Error: not found: make ===
 
If you see this error in Ubuntu, run <code>sudo apt-get install build-essential</code> and retry.
If you see this error in Ubuntu, run <tt>sudo apt-get install build-essential</tt> and retry.
 
=== Current working directory is not a Cordova-based project. ===
=== Current working directory is not a Cordova-based project. ===
 
If you see this error during <code>npm start</code>, run <code>mkdir www</code> and retry.
If you see this error during <tt>npm setup</tt>, run <tt>mkdir www</tt> and retry.
 
=== ReferenceError: internalBinding is not defined ===
=== ReferenceError: internalBinding is not defined ===
 
This [https://stackoverflow.com/questions/53146394/node-app-fails-to-run-on-mojave-referenceerror-internalbinding-is-not-defined seems to be] an error with <code>natives</code> prior to 1.1.6. It can be fixed by running <code>npm install natives@1.1.6</code>.
This [https://stackoverflow.com/questions/53146394/node-app-fails-to-run-on-mojave-referenceerror-internalbinding-is-not-defined seems to be] an error with 'natives' prior to 1.1.6. I fixed it using <tt>npm install natives@1.1.6</tt>.
=== npm update check failed ===
 
You may get the following error on Windows:
=== ReferenceError: internalBinding is not defined ===
<syntaxhighlight lang="bash">
 
This [https://stackoverflow.com/questions/53146394/node-app-fails-to-run-on-mojave-referenceerror-internalbinding-is-not-defined seems to be] an error with 'natives' prior to 1.1.6. I fixed it using <tt>npm install natives@1.1.6</tt>.
 
=== npm update check failed===
 
I got the error
 
  │                  npm update check failed                  │
  │                  npm update check failed                  │
  │            Try running with sudo or get access            │  
  │            Try running with sudo or get access            │  
  │            to the local update config store via            │
  │            to the local update config store via            │
  │ sudo chown -R $USER:$(id -gn $USER) C:\Users\username\.config │
  │ sudo chown -R $USER:$(id -gn $USER) C:\Users\username\.config │
</syntaxhighlight>
The suggested command does not work on Windows, so the solution is to manually check the ownership of all the files in <code>C:\Users\{username}\.config\configstore</code>. In some cases, it can be <code>update-notifier-npm.json</code> that got changed to be owned by Administrator.
=== Unhandled rejection Error: Command failed: C:\cygwin64\bin\git.EXE ... ===
This is a common issue for Cygwin user running Node. However, you just need to ensure that Msysgit is on your windows path and that the cygwin bin folder is not. Then always use another shell like Powershell for your Moodle App development.


on Windows because I installed too much as admin, and the suggested command does not work on Windows. The is to manually check the ownership of all the files in C:\Users\username\.config\configstore. In my case it was update-notifier-npm.json which got changed to be owned by Administrator.
You don't need your Cygwin bin folder on the Windows path because it automatically gets added to the path when you lauch Cygwin bash.
=== The product name change (<name> tag) in config.xml is not supported dynamically ===
This happens when you create the iOS platform with a certain <name> and then you change that name in config.xml. The solution seems to be removing and adding the iOS platform again:
<syntaxhighlight lang="bash">
npx ionic platform remove ios
npx ionic platform add ios
</syntaxhighlight>
===Failed to install 'cordova-plugin-x' ===
Sometimes, you may see an error message similar to this:
<syntaxhighlight lang="bash">
CordovaError: Version of installed plugin: "cordova-plugin-x@x.x.x" does not satisfy dependency plugin requirement "cordova-plugin-x@>=x.x.x".
</syntaxhighlight>
This can happen when a cordova plugin (let's call it "X") is installed with an incorrect version. You can find this by removing the plugin and adding it again with the correct version:
<syntaxhighlight lang="bash">
npx cordova plugin remove cordova-plugin-x
npx cordova plugin add cordova-plugin-x@x.x.x # Make sure to use the proper version here
</syntaxhighlight>
Please notice that if there is any plugin installed that depends on <code>cordova-plugin-x</code> you'll have to remove and re-add them too.
=== doc.find is not a function ===
This happens in some environments, the solution is to run <code>npx cordova platform add ios</code> before running the failing command. You should do this in a clean environment, once you've seen the error running the command may not work. Try deleting <code>www/</code>, <code>platforms/</code> and <code>plugins/</code> before trying again.


===Unhandled rejection Error: Command failed: C:\cygwin64\bin\git.EXE ...===
[https://stackoverflow.com/questions/47404622/edit-config-for-ios-usage-descriptions-doc-find-is-not-a-function Find more about this in StackOverflow]
===Mac: linker code failed with exit code 1===
If you get this error when trying to build the Moodle app with XCode, some dependencies might not have installed correctly.


You need to heed the advice at https://www.npmjs.com/package/npm#installing-on-cygwin. Cygwin users are not welcome in the Node world. However, you just need to ensure that Msysgit is on your windows path and that the cygwin bin folder is not. Then always use another shell like Powershell for your Moodle mobile development. (You don't need your Cygwin bin folder on the Windows path. It automatically gets added to the path when you lauch Cygwin bash.)
Ensure you have followed the [#Mac_only:_Push_notifications Mac only: Push notifications] steps above (particularly opening the .xcworkspace file rather than the .xcodeproj file). Then run the following:
<syntaxhighlight lang="bash">
cd platforms/ios
pod install
</syntaxhighlight>
Now try running the build again in XCode.
===Windows: <code>npm start</code> hangs after "Starting 'watch'"===


===The product name change (<name> tag) in config.xml is not supported dynamically===
If you follow the above procedure to run the app on a Windows system and get repeated 'Waiting for connectivity with NPM' like this:


According to Google, this happens when you create the iOS platform with a certain <name> and then you change that name in config.xml. It's weird that the installation process does that, it should create the platform with the right name unless it was changed manually.
<pre>
$ npm start


The solution seems to be removing and adding the iOS platform again:
> moodlemobile@3.9.5 start C:\Users\xxx\workspace\moodlemobile2
> ionic serve


ionic platform remove ios
> npm.cmd run ionic:serve:before
ionic platform add ios


Note that this does not seem to prevent <tt>ionic --serve</tt> from serving a working app if you run gulp after <tt>npm run setup</tt> has failed with this error.
> moodlemobile@3.9.5 ionic:serve:before C:\Users\xxx\workspace\moodlemobile2
> gulp


===Failed to install 'cordova-plugin-file-transfer': CordovaError: Version of installed plugin: "cordova-plugin-file@4.3.3" does not satisfy dependency plugin requirement "cordova-plugin-file@>=5.0.0".===
[13:59:24] Using gulpfile ~\workspace\moodlemobile2\gulpfile.js
[13:59:24] Starting 'default'...
[13:59:24] Starting 'lang'...
[13:59:24] Starting 'env'...
[13:59:25] Finished 'env' after 802 ms
[13:59:27] Finished 'lang' after 3.4 s
[13:59:27] Finished 'default' after 3.4 s
> npm.cmd run ionic:serve -- --host=localhost --port=8100 --project=app
[npm] > moodlemobile@3.9.5 ionic:serve C:\Users\xxx\workspace\moodlemobile2
[npm] > gulp watch & NODE_OPTIONS=--max-old-space-size=4096 ng serve "--host=localhost" "--port=8100" "--project=app"
[INFO] Waiting for connectivity with npm...
[npm] [13:59:46] Using gulpfile ~\workspace\moodlemobile2\gulpfile.js
[npm] [13:59:46] Starting 'watch'...
[INFO] Waiting for connectivity with npm...
[INFO] Waiting for connectivity with npm...
[INFO] Waiting for connectivity with npm...
[INFO] Waiting for connectivity with npm...
</pre>


The ''cordova-plugin-file'' version specified in config.xml is 6.0.1, for some reason the installation process installed a wrong version for that plugin. You can manually install the ''cordova-plugin-file'' plugin like this:
You can resolve the problem (sort of) by pressing ctrl-c to get out of it, then rerun the last command displayed, but this time with 'npx' before each of the 2 commands. (This assumes you are using a bash shell.)


cordova plugin remove cordova-plugin-file
<syntaxhighlight lang="bash">
cordova plugin add cordova-plugin-file@6.0.1
npx gulp watch & NODE_OPTIONS=--max-old-space-size=4096 npx ng serve "--host=localhost" "--port=8100" "--project=app"
</syntaxhighlight>


Please notice that if there is any plugin installed that depends on ''cordova-plugin-file'' you'll have to remove and re-add them too.
There will be a pause (a few minutes) while building everything. It should finish with the line:


Note that this does not seem to prevent <tt>ionic --serve</tt> from serving a working app if you run gulp after <tt>npm run setup</tt> has failed with this error.
<tt>
: Compiled successfully.
</tt>


===Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node"===
Then you can access it by running Chrome and connecting to localhost:8100.
Force using node 11, since node-sass for node 12 is not yet avalaible. See [https://tracker.moodle.org/browse/MOBILE-2999|MOBILE-2999] for more info.
 
===Mac: linker code failed with exit code 1===
If you get this error when trying to build the Moodle app with XCode, some dependencies might not have installed correctly.
 
Ensure you have followed the [https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2#Mac_only:_Push_notifications|Mac only: Push notifications] steps above. Then run the following:
 
  npm setup
  cd platforms/ios
  pod install
 
Now try running the build again in XCode.


== See also ==
== See also ==
 
* [[Moodle App Coding Style]]
http://ionicframework.com/docs/cli/
* [[Debugging network requests in the Moodle_App]]
* [https://github.com/moodlehq/moodle-docker Moodle Docker]
* [http://ionicframework.com/docs/cli/ Ionic CLI docs]

Latest revision as of 13:04, 14 July 2022

Important:

This content of this page has been updated and migrated to the new Moodle Developer Resources. The information contained on the page should no longer be seen up-to-date.

Why not view this page on the new site and help us to migrate more content to the new site!


The structure of this page is the following:

  • The first part, up to the point where you get the npm start command to work, includes the basics of what you need to work on the app.
  • The second part indicates how to build the app to run it on a native device (or emulator).
  • The third part includes a list of troubleshooting advice. If you encounter a problem that is not already listed, please consider adding it.


Most of your development can happen on a browser, you only need to use an emulator if you have to work on native functionality.

If you are just adding mobile support to plugins, you probably don't need to build the app yourself and you can skip reading this page.

Requirements

Install a browser for development

Most of the time we recommend that you use a browser for development; the app will work in any Chromium-based browser. We recommend using the Chromium browser (an open source alternative to Google Chrome). You can get it from the official download page.

To learn more about using a browser for development, and why it needs to be Chromium-based, read the Using the Moodle App in a browser page.

Install git

You will need to install Git in order to get the source code and upload your changes. If you are not familiar with it, we recommend that you get started reading the following guide: Installing Git.

Install Node.js and Npm

We recommend using a version manager like nvm to make this easier, you can prepare the correct environment running nvm install in the project root. Remember to run this every time you work with the app, or if you’re not working on any other node projects in your computer you can run nvm alias default `node -v` to make it the default.

It may seem simpler and easier to install directly from nodejs.org, but actually it is more tricky to get that to work. If you have previously installed Node directly, and want to switch to nvm, you need to uninstall node completely before installing nvm - or search for trouble-shooting instructions online.

Install native SDKs

If you intend to run the application in a native device, you will need to install that platform's native SDKs. You can learn how to set up your environment by reading Ionic’s documentation for Android and iOS.

Windows only: Native build dependencies

node-gyp requires native build tools for your platform. If you're developing on Mac or Linux, you'll probably have these already (refer to the docs if you don't). On Windows, run the following command as administrator (in cmd or Powershell):

npm install --global --production windows-build-tools

Warning! This installer can take a very, very long time to run. We were seeing it take hours. Literally. Be prepared to be very patient. Don't just make the natural assumption that it has crashed.

Mac only: Push notifications

This is only be necessary if you intend to compile the native iOS application. The push notifications plugin requires CocoaPods to work on a Mac; you can find the complete installation instructions in the official documentation, but it should work by running the following commands:

sudo gem install cocoapods
pod setup

Please note that for compiling the app in Mac you need to open the Moodle.xcworkspace file, more information here: MOBILE-1970.

Linux only: libsecret

If you are using the gulp push script, you need to have libsecret installed before running npm install. Depending on your distribution, you will need to run one of the following commands:

# Debian/Ubuntu
sudo apt-get install libsecret-1-dev

# Red Hat
sudo yum install libsecret-devel

# Arch Linux
sudo pacman -S libsecret

Running the app in a browser

You can obtain a copy of the source code by cloning the public repository. If you want to work on the latest development version, you should check out the integration branch:

git clone git@github.com:moodlehq/moodleapp.git
cd moodleapp
git checkout integration

Once you have the correct environment set up, you can run the application with the following two commands:

npm install
npm start

This will launch the application in a browser and you should be ready to start coding (you may also want to configure the default browser for future runs). This compiles the entire application and can take a while, so don't worry if it doesn't open the browser instantly. Keep in mind that this command may open the browser before the dev server is ready, and you could get a network error. If that happens, just wait until the dev server is ready and launch the application again. It should be ready when you see a "Compiled successfully" message in the console.

Congratulations, you have just completed the basics to become a Moodle App developer!

If you need to work with native features or build packaged versions of the app, you can read the rest of this page.

Running the app in Android and iOS

The first time you want to run the application in a native device, this process will take a bit longer than usual because it needs to create the native projects and install native plugins. These will be created under the platforms/ and plugins/ folders respectively. If you ever run into issues during this process, try deleting both of these folders to get a clean start.

In order to run the application on a native device, you can use one of the following commands:

npm run dev:android  # Uses Live Reload, read below
npm run dev:ios      # Does NOT use Live Reload, read below
npm run prod:android # Uses AOT compilation, read below
npm run prod:ios     # Uses AOT compilation, read below

If you get any errors while building, please see the Troubleshooting section below.

You can also inspect the HTML and look at the console logs by using Chrome's Remote Debugging for Android and Safari's Develop menu for iOS. This will only work with emulators or devices connected to your computer running with the development environment.

Developing using Live Reload

Most of the time, it is recommended to develop using the npm start command. Working in a browser is faster, easier, and doesn't have as much overhead. However, in some situations you may want to run the application in a native device. If you want a similar development experience, you'll want to enable Live Reload.

In Android, you can use the npm run dev:android command and the application will launch on a device or emulator. Whenever you make any changes to your code, the application will reload automatically. Keep in mind that this command may launch the application before the dev server is ready, and you could get a network error. If that happens, just wait until the dev server is ready and launch the application again (you should see "Compiled successfully" in the console).

In iOS, there are some limitations using live reload and that's why the npm run dev:ios command doesn't enable it by default. You can still use it by running npx ionic cordova run ios --livereload --external, but keep in mind that this will serve your application on an IP and will expose it to anyone connected to the same Wi-Fi network. Other than privacy concerns, this may cause some problems if you are working with iframes or local files. If you have any problems with that, you'll have to use the npm run dev:ios command to recompile the application every time you change the code.

Compiling using AOT

Angular has 2 ways of compiling: JIT and AOT.

Running npm start, npm run dev:android or npm run dev:ios compiles using JIT, which is faster to compile but the app takes longer to start. This is acceptable during development because it allows you to use Live Reload.

The npm run prod:android and npm run prod:ios commands use AOT compilation because they generate production bundles.

Using Android emulators

Most of the time, you should be using an emulator running recent versions of Android, and it should work fine. But sometimes, you may want to use an older version to test a specific behaviour.

If you want to run the application in an Android 5 emulator, you’ll need to upgrade the system webview because emulators come with version 37 preinstalled. Your first idea may be to upgrade the webview using the Google Play store, but it will not work because the webview served by Google Play is com.google.android.webview whilst the system webview used in emulators is com.android.webview. You can do the following instead.

Once you have created your Android 5 virtual device, you’ll need to do download the apk for Webview 61 and run the following commands:

# Open the folder where the “emulator” script is installed
cd $(dirname `which emulator`)

# Boot the emulator in write mode
# (you can get a list of device names running “emulator -list-avds”)
emulator @DeviceName -writable-system

# In a different shell, make /system writable
adb remount

# Uninstall the webview app manually and reboot the device
adb shell
rm -rf /data/data/com.android.webview
rm -rf /system/app/webview
reboot

# Install the new version
adb install webview.apk

After doing this, remember to run the emulator in write mode for subsequent sessions, but you don’t need to call the remount command every time.

Troubleshooting

This section contains a list of common errors that have been found and how to solve them. However, keep in mind that these may be platform-dependent and could not fix the problem in your machine, even if you are seeing the same error message.

General advice

If you are stuck with an error and you can't find a way to continue, here's a list of things you can do:

  • Using git, look at the changes you have in your working directory and make sure that they aren't causing the problem. Be specially careful with changes in package.json and package-lock.json. You can see a list of the files you have modified running git status.
  • Make sure that you are using the proper node and npm versions. You can see it looking at the engines key in package.json. If you are using nvm, just run nvm install.
  • Make sure that all dependencies have been installed properly. To be extra sure, run npm ci; this will remove the node_modules/ folder and install all dependencies again exactly as described in your package-lock.json.
  • If you are having issues trying to build for Android or iOS, try removing the www/, platforms/ and plugins/ folders and try again.
  • If you are using a development version, maybe the repository is broken and it's not your fault. Try checking out the master branch and see if you're getting the same error.
  • Try cloning the repository in a new folder and run through the instructions in this page again. If you can, try doing it on a different computer to make sure that you're doing everything properly and it's not a problem in your machine.
  • Try creating a blank Ionic application and see if you're having the same problems. Make sure that you are using the same version of the main dependencies (Angular, Cordova, Ionic CLI, etc.).
  • If you are searching for help online, maybe your problem has nothing to do with the Moodle App in particular an it's related with Ionic, Cordova, Angular, etc. Searching using the proper context will give you better solutions.

I get a blank page when launching the app

This error can happen when the application is launched properly but there is a runtime error. If you get a network connection error, this may be the expected behaviour. Wait until you see "Compiled successfully" in the console and reload.

If that's not the case and you really are getting a blank page, look at the console and you should see some error indicating why the application is not rendering properly. Keep in mind that at the moment the application is already logging some errors and warnings, so make sure that you're not stuck trying to fix something that isn't causing the problem. You can follow any updates about this on MOBILE-3854.

If you are not seeing any relevant logs, check out what to do on the General advice section.

Strange NPM errors

To get more debug output from npm commands, see the available configuration flags. In particular try adding --loglevel verbose, --loglevel info or --loglevel silly to the command-line.

I can't change the language

If you're getting a network error for a url like http://localhost:8100/assets/lang/es.json, this probably means that you haven't installed the language packs.

Currently, you can install them in your machine running the scripts/update_lang.sh script, but it may not work in your system if you don't have php installed. For future improvements, you can subscribe to MOBILE-3864.

Error: libsass bindings not found. Try reinstalling node-sass?

Most of the time, running the following command will fix the problem:

npm rebuild node-sass

com.android.dex.DexException: Multiple dex files define XXX

Open the file platforms/android/build.gradle and add this code at the end:

configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
}

Could not resolve all dependencies for configuration ':_debugCompile'.

Open the Android SDK Manager and make sure you have installed: Android Support Repository, Android Support Library, Google Play Services and Google Repository.

Could not find com.android.support:support-v4:XXX

Open the file platforms/android/build.gradle and add this code at the end:

configurations.all {
    resolutionStrategy.force 'com.android.support:support-v4:24.0.0'
}

ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font

Open the file platforms/android/build.gradle and add this code at the end:

android {
   compileSdkVersion 26
   buildToolsVersion "26.0.1"
}

Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.

Download Android Studio and copy the folder android-studio/plugins/android/lib/templates into android-sdk-folder/Sdk/tools.

Could not find com.android.support:support-v4:27.1.0

Open the file platforms/android/build.gradle and configure like this:

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

Error: not found: make

If you see this error in Ubuntu, run sudo apt-get install build-essential and retry.

Current working directory is not a Cordova-based project.

If you see this error during npm start, run mkdir www and retry.

ReferenceError: internalBinding is not defined

This seems to be an error with natives prior to 1.1.6. It can be fixed by running npm install natives@1.1.6.

npm update check failed

You may get the following error on Windows:

 │                   npm update check failed                   │
 │             Try running with sudo or get access             │ 
 │            to the local update config store via             │
 │ sudo chown -R $USER:$(id -gn $USER) C:\Users\username\.config │

The suggested command does not work on Windows, so the solution is to manually check the ownership of all the files in C:\Users\{username}\.config\configstore. In some cases, it can be update-notifier-npm.json that got changed to be owned by Administrator.

Unhandled rejection Error: Command failed: C:\cygwin64\bin\git.EXE ...

This is a common issue for Cygwin user running Node. However, you just need to ensure that Msysgit is on your windows path and that the cygwin bin folder is not. Then always use another shell like Powershell for your Moodle App development.

You don't need your Cygwin bin folder on the Windows path because it automatically gets added to the path when you lauch Cygwin bash.

The product name change (<name> tag) in config.xml is not supported dynamically

This happens when you create the iOS platform with a certain <name> and then you change that name in config.xml. The solution seems to be removing and adding the iOS platform again:

npx ionic platform remove ios
npx ionic platform add ios

Failed to install 'cordova-plugin-x'

Sometimes, you may see an error message similar to this:

CordovaError: Version of installed plugin: "cordova-plugin-x@x.x.x" does not satisfy dependency plugin requirement "cordova-plugin-x@>=x.x.x".

This can happen when a cordova plugin (let's call it "X") is installed with an incorrect version. You can find this by removing the plugin and adding it again with the correct version:

npx cordova plugin remove cordova-plugin-x
npx cordova plugin add cordova-plugin-x@x.x.x # Make sure to use the proper version here

Please notice that if there is any plugin installed that depends on cordova-plugin-x you'll have to remove and re-add them too.

doc.find is not a function

This happens in some environments, the solution is to run npx cordova platform add ios before running the failing command. You should do this in a clean environment, once you've seen the error running the command may not work. Try deleting www/, platforms/ and plugins/ before trying again.

Find more about this in StackOverflow

Mac: linker code failed with exit code 1

If you get this error when trying to build the Moodle app with XCode, some dependencies might not have installed correctly.

Ensure you have followed the [#Mac_only:_Push_notifications Mac only: Push notifications] steps above (particularly opening the .xcworkspace file rather than the .xcodeproj file). Then run the following:

cd platforms/ios
pod install

Now try running the build again in XCode.

Windows: npm start hangs after "Starting 'watch'"

If you follow the above procedure to run the app on a Windows system and get repeated 'Waiting for connectivity with NPM' like this:

$ npm start

> moodlemobile@3.9.5 start C:\Users\xxx\workspace\moodlemobile2
> ionic serve

> npm.cmd run ionic:serve:before

> moodlemobile@3.9.5 ionic:serve:before C:\Users\xxx\workspace\moodlemobile2
> gulp

[13:59:24] Using gulpfile ~\workspace\moodlemobile2\gulpfile.js
[13:59:24] Starting 'default'...
[13:59:24] Starting 'lang'...
[13:59:24] Starting 'env'...
[13:59:25] Finished 'env' after 802 ms
[13:59:27] Finished 'lang' after 3.4 s
[13:59:27] Finished 'default' after 3.4 s
> npm.cmd run ionic:serve -- --host=localhost --port=8100 --project=app
[npm] > moodlemobile@3.9.5 ionic:serve C:\Users\xxx\workspace\moodlemobile2
[npm] > gulp watch & NODE_OPTIONS=--max-old-space-size=4096 ng serve "--host=localhost" "--port=8100" "--project=app"
[INFO] Waiting for connectivity with npm...
[npm] [13:59:46] Using gulpfile ~\workspace\moodlemobile2\gulpfile.js
[npm] [13:59:46] Starting 'watch'...
[INFO] Waiting for connectivity with npm...
[INFO] Waiting for connectivity with npm...
[INFO] Waiting for connectivity with npm...
[INFO] Waiting for connectivity with npm...

You can resolve the problem (sort of) by pressing ctrl-c to get out of it, then rerun the last command displayed, but this time with 'npx' before each of the 2 commands. (This assumes you are using a bash shell.)

npx gulp watch & NODE_OPTIONS=--max-old-space-size=4096 npx ng serve "--host=localhost" "--port=8100" "--project=app"

There will be a pause (a few minutes) while building everything. It should finish with the line:

Compiled successfully.

Then you can access it by running Chrome and connecting to localhost:8100.

See also