I am trying to build the moodle mobile app on phonegap using moodle mobile repository. I am getting the error below:
FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'project'. > Could not resolve all dependencies for configuration ':_debugApkCopy'. > Could not find com.android.support:support-v4:27.1.0. Required by: project : > Could not find com.android.support:support-v4:27.1.0. Required by: project : > Could not find com.android.support:support-v4:27.1.0. Required by: project : > com.android.support:support-v13:23.4.0 > Could not find com.android.support:support-v4:27.1.0. Required by: project : > com.google.android.gms:play-services-gcm:9.8.0 > com.google.android.gms:play-services-basement:9.8.0 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 1.559 secs Command finished with error code 1: /project/gradlew cdvBuildDebug,-b,/project/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true Error: /project/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.
I'm also facing the same problem. Following is the git project where I got the code from for Moodle Mobile 3.4.2
https://github.com/moodlehq/moodlemobile-phonegapbuild/
I'm trying to develop an app using PhoneGap build https://build.phonegap.com
any help would be appreciated.
Gopal
same problem. googling showed some recommendations, but none work.
https://github.com/moodlehq/moodlemobile2/tree/v3.3.2
I still have the issue with the Moodle App 3.5 as it only able to show the Splash screen page only.
On the browser, it works well but not after building app-debug.apk file.
Do you guys need the steps to build the app in that way and, not in phogape way.
I've succeeded using the latest version v 3.5.0 branch from the above mentioned repo....
I think that you should try doing it from any macbook. It worked for me with no problems.
I followed the steps given in this link for the development environment for app
https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2
I have tried building the app using Cordova & Ionic and also using ionic alone.
When using both Cordova and Ionic, I use to run the following command to build the android apk file is
sudo ionic cordova build andriod
and building using only Cordova I use to run the following command
sudo ionic build andriod
Any help would be appreciated.
There is something I'm missing as it runs very well in the browser while running it with the command sudo ionic serve -b
Note :- I'm able to build the app and it gets installed in the mobile very smoothly but when launching it I'm only able to see the white screen for few seconds and then splash screen which keeps on loading.
-Gopal
Hi,
we're able to build the app both in MacOS and Linux, we haven't tried in Windows but I know some people succeeded in doing so. If you're able to build the app but then it doesn't load, please inspect the Javascript console to see if any error is raised and try to fix it.
If it works in web but not in device then it's probably related to cordova plugins, make sure they're all installed.
Cheers,
Dani
Hi Dani,
Your comments are much appreciated.
I have tried building the Moodle App again with the latest code https://github.com/moodlehq/moodlemobile2/tree/v3.5.0
But I'm still getting the same issue, I have been trying this for a long time even before the official release on June 26, 2018.
I have uploaded a few images below.
This error I'm getting in the console when running in the browser but everything works as expected on the browser
I'm also able to build the .apk file but it stuck on splash screen only and keep on loading.
You can check out those image in the attachment as well.
I'm using 64bit - ubuntu16.04 LTS and other details are as followes
Creating Cordova project for the Android platform:
Path: platforms/android| Package: com.moodle.moodlemobile |Name: Moodle | Activity: MainActivity | Android target: android-26 | Subproject Path: CordovaLib |Subproject Path: app
Android project created with cordova-android@7.0.0
ionic version : 3.20.0 and Cordova version : 8.0.0
much thanks.
-Gopal


Hi Gopal,
I suggest you to use Chrome Web Inspector to open the Javascript console for the device to check if any error is raised in there. Here's a guide about this:
https://developers.google.com/web/tools/chrome-devtools/remote-debugging/
Cheers,
Dani
Hi Dani,
First of all thank you so much for the link you have just shared to help me out.
Following is the screenshot of Remote Debugging Android as you suggested, there are some
ERROR Error: Uncaught (in promise): plugin_not_installed
CoreUpdateManagerProvider: Error migrating table config to core_config: plugin_not_installed
Please do let me know if you have come across this error till the time I find out.
much thanks.
-Gopal
Hi Gopal,
this error means that you lack some Cordova plugins. This means you didn't run "npm run setup" or "cordova prepare", or something went wrong and the plugins weren't installed.
I suggest you to remove all platforms and plugins and run "cordova prepare" again. Please notice that doing so you will lose all your modifications in platforms/android (if you did any), so maybe you prefer adding all the plugins manually. You can see the list of plugins in the config.xml file:
https://github.com/moodlehq/moodlemobile2/blob/v3.5.0/config.xml#L94
Cheers,
Dani
Hi Gopal,
I followed the same steps but I used phonegap and I succeeded!
Be careful while u download the git to ur local computer give this command
git checkout v3.5.0
Best,
Ardian
Hello All who are facing problem with phonegap build of moodle.
We are getting same problem as Yogeshwar and finally we found solution :
It's Simple solution, Just replace
<preference name="phonegap-version" value="cli-6.5.0" />
to
<preference name="phonegap-version" value="cli-7.1.0" />
It will works..!!!