Unable to take build

Unable to take build

Sarath P發表於
Number of replies: 4
Plugin developers的相片

Hello everyone,

Based on the Moodle docs, I have set up a development environment for Moodle Mobile. Earlier I was able to compile and take the build successfully (version 4.0.1). However, now if I clone the latest code (version 4.1.0-dev) I am getting errors while executing npm run prod:android.

I tried to execute the same command in the 4.0.1 version and there I was able to take the build successfully.

The following are the errors:

> Task :CordovaLib:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.

> Compilation failed; see the compiler error output for details.

BUILD FAILED in 2m 55s

29 actionable tasks: 29 executed

Command failed with exit code 1: /home/moodle/Moodle_Mobile_Dev_Environment/projects/moodleapp/platforms/android/gradlew cdvBuildDebug -b /home/moodle/Moodle_Mobile_Dev_Environment/projects/moodleapp/platforms/android/build.gradle

  ─────────────────────────────────────────────────

     Ionic CLI update available: 6.19.0 → 6.20.4

          Run npm i -g @ionic/cli to update

  ─────────────────────────────────────────────────

[ERROR] An error occurred while running subprocess cordova.

        cordova build android exited with exit code 1.


Thanks in advance.

評比平均分數: -
In reply to Sarath P

Re: Unable to take build

Noel De Martin發表於
Core developers的相片 Moodle HQ的相片 Peer reviewers的相片 Plugin developers的相片

Hi there,

For these types of errors I suggest that you take a look at the General Advice section in the troubleshooting guide, most of the issues can be fixed doing something from that list.

Other than that, seeing that you're having issue with the Android build, make sure that you have all the Android dependencies installed. For example, if it was working in 4.0.1 but doesn't work for 4.1-dev it's possible that it's related with MOBILE-4123, where we updated the targetSdk to API level 31. Maybe you need to download the Android libraries for this API level.

In reply to Noel De Martin

Re: Unable to take build

Sarath P發表於
Plugin developers的相片
Hi,

Thank you for your response. Which Android libraries do I need to install? 

So far I have already installed SDK Platforms for API Levels 30, 31, 32, and 33 and SDK Build Tools 30.0.3, 31.0.0, 32.0.0, and 33.0.1. Also, I have installed and configured the latest Gradle.
In reply to Sarath P

Re: Unable to take build

Noel De Martin發表於
Core developers的相片 Moodle HQ的相片 Peer reviewers的相片 Plugin developers的相片

I think SDK with API level 31 should be enough, so maybe the problem is not related with this. Make sure to follow the rest of the suggestions in the troubleshooting section, and if nothing works it's probably something specific to your environment and maybe it'd be easier to search for Ionic or Cordova troubleshooting instructions.

In reply to Noel De Martin

Re: Unable to take build

Sarath P發表於
Plugin developers的相片
Ok. Sure I'll search for Ionic or Cordova troubleshooting instructions.

Just now I executed the command using the verbose flag for 4.1-dev and in the terminal, I noticed this:

> Task :CordovaLib:compileDebugJavaWithJavac
An exception has occurred in the compiler (1.8.0_261). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.