Error during build the moodle mobile app through phonegap

Error during build the moodle mobile app through phonegap

by Yogeshwar Shukla -
Number of replies: 20

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.

Average of ratings: -
In reply to Yogeshwar Shukla

Re: Error during build the moodle mobile app through phonegap

by Payman Zafar -

I have the same problem.

In reply to Yogeshwar Shukla

Re: Error during build the moodle mobile app through phonegap

by Gopal Sharma -
Picture of Plugin developers Picture of Testers

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

In reply to Gopal Sharma

Re: Error during build the moodle mobile app through phonegap

by Edgar Ortega -

Yo tengo el mismo problema. Ya intente de todo y aun nada.

In reply to Yogeshwar Shukla

Re: Error during build the moodle mobile app through phonegap

by ODUCATE E -


Same problem! sad

In reply to ODUCATE E

Re: Error during build the moodle mobile app through phonegap

by Madhav Deshpande -

same problem. googling showed some recommendations, but none work.

In reply to Madhav Deshpande

Re: Error during build the moodle mobile app through phonegap

by Gopal Sharma -
Picture of Plugin developers Picture of Testers
At last, I succeeded in developing the Customised Moodle app using the version 3.3.2, the link is

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.

In reply to Gopal Sharma

Re: Error during build the moodle mobile app through phonegap

by Ardian Deari -

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. 

In reply to Ardian Deari

Re: Error during build the moodle mobile app through phonegap

by Gopal Sharma -
Picture of Plugin developers Picture of Testers
Hi Ardian Deari, is it possible for you to share the steps you followed for building the moodle app 3.5.

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


In reply to Gopal Sharma

Re: Error during build the moodle mobile app through phonegap

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers

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

Average of ratings: Useful (1)
In reply to Dani Palou

Re: Error during build the moodle mobile app through phonegap

by Gopal Sharma -
Picture of Plugin developers Picture of Testers

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

Console errorr


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.

build app

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

Attachment browser_11.png
Attachment Screenshot_2018-07-25-18-29-57-986_com.moodle.moodlemobile.png
In reply to Gopal Sharma

Re: Error during build the moodle mobile app through phonegap

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers

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

In reply to Dani Palou

Re: Error during build the moodle mobile app through phonegap

by Gopal Sharma -
Picture of Plugin developers Picture of Testers

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

Remote Debugging Android


Remote Debugging Android


Please do let me know if you have come across this error till the time I find out.

 much thanks.

-Gopal


In reply to Gopal Sharma

Re: Error during build the moodle mobile app through phonegap

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers

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

In reply to Gopal Sharma

Re: Error during build the moodle mobile app through phonegap

by dat nguyen -

I have same issue. Do you have any idea?

In reply to Gopal Sharma

Re: Error during build the moodle mobile app through phonegap

by Ardian Deari -

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

in order to be able to use the newest version... I had the same problem many times because I didn't gave that command....

Best,

Ardian

In reply to Ardian Deari

Re: Error during build the moodle mobile app through phonegap

by Dennie Walker -

Which steps are you referring to?
I am also using phongap but errors still show up.

In reply to Gopal Sharma

Re: Error during build the moodle mobile app through phonegap

by behnaz ranjbar -
exactly same as me these days..i'm struggling to solve it but couldn't find a waysad
it would be very nice to hear advices of dear admins..but there is no answer
In reply to behnaz ranjbar

Re: Error during build the moodle mobile app through phonegap

by dat nguyen -
Same problem! any idea?
In reply to Yogeshwar Shukla

Re: Error during build the moodle mobile app through phonegap

by Harshil Shah -

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..!!!