Moodle for mobile

Struggling to build

 
Picture of Samuel Domingues
Struggling to build
 

Hi,

I've been struggling for the last three weeks just trying to get a Moodle Mobile source to build successfully and run on an Android device/emulator but after going to a lot of problems and finally getting it to start on the emulator, it does not go after the loading screen, it does not even get to the screen where you have to enter the Moodle web site. Could you please help me with this? This is what I've done:

(Windows environment)
C:\moodlemobile>ionic -v
3.20.0
C:\moodlemobile>npm -v
6.1.0
C:\moodlemobile>node -v
v6.9.1
C:\moodlemobile>cordova -v
8.0.0
C:\moodlemobile>gulp -v
[23:16:56] CLI version 3.9.1
[23:16:56] Local version 3.9.1


---Trying v3.5.0

Following the official documentation: 

1. Get source from Git:

git clone https://github.com/moodlehq/moodlemobile2.git moodlemobiledirectory cd moodlemobiledirectory git checkout v3.5.0 

2. npm setup command is not recognized, so I do: npm install && cordova prepare && gulp

3. At this point, although the tutorial says to run "ionic serve", it does not work. It fails with a lot of typescript errors, so I changed the tsconfig.json file and added this in the compilerOptions:

"typeRoots": [
"node_modules/@types"
]

Then the ionic serve finally works.

4. At this point everything seems to be working well, I can test everything from the browser and I don't see any errors, but if I try to run on Android it never goes beyond the loading screen. I don't even get the chance to enter the Moodle website URL. I even tried to remove platform android and add it back but it did not work. Any ideas?

----Trying v3.4.2 (release)

1. Unzip source code
2.  npm setup is not recognized, so I do: npm install && cordova prepare && gulp
3. ionic serve command does not show any error, but when the browser opens the app it is just a blank screen with a lot of errors on console like:


Refused to apply style from localhost:8100/build/mm.bundle.css because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

ionic.bundle.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)

(index):1 Refused to execute script from localhost:8100/lib/ionic/release/js/ionic.bundle.js because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

angular-translate.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)

These are examples of the errors because they happen multiple times for different files.


--Summarizing everything:

All I really want is to be able to successfully build this code for Android, it does not matter if it is version 3.4.2 or 3.5.0, can you please help me? I've looked everywhere and I can't find the solution for this.

Thanks

 
Average of ratings: -
Picture of Dani Palou
Re: Struggling to build
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Samuel,

can you try again using cordova 6.5.0 instead of Cordova 8? We're in the process of updating to Cordova 8, so it's better that you stick to 6.5.0 for now.

Also, please run this command:

cordova platform list

You should have these versions:

android 6.1.2

ios 4.3.1


Cheers,

Dani

 
Average of ratings: -
Picture of Samuel Domingues
Re: Struggling to build
 

Hi Dani,


Thank you for your reply, but the reason I changed the cordova version to 8.0.0 and tried to build for Android 7.0.0 is that when I keep the old versions (Cordova 6.5.0 and Android 6.1.2) the build fails with the following error:


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

Some people were fixing this error by upgrading the Android version, but it would be better if we could actually fix this FontFamilyFont error instead of upgrading cordova/android. Can you help me figure out why this error is happening, the scenario is the same as I described before, except that cordova is 6.5.0.

Thanks

 
Average of ratings: -
Picture of Samuel Domingues
Re: Struggling to build
 

Hi Dani,

I have the android 6.1.2 version listed but the build still fails with the error message:

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

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

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


Even when using phonegap, I get this error.
 

 
Average of ratings: -
Picture of Gaurav Bothra
Re: Struggling to build
 

Hi Samuel Domingues,

i am getting this error how you solve it please tell me

 
Average of ratings: -
Picture of Samuel Domingues
Re: Struggling to build
 

I finally got the build working for Android, I downgraded ionic to version 2.3.3 and now it is working, but I have to specify version 6.3.0 when adding Android platform and if I try to run it on an emulator running Android 4.4 or 5.0.0 I get a blank screen after the splash screen. Any ideas?

 

 
Average of ratings: -
Picture of Dani Palou
Re: Struggling to build
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Samuel,

sorry for the delay in answering, I was also struggling to build, but in my case it was to build in production mode.

For the record, I'm able to build the app fine using Ionic 3.1.9 and the Cordova versions I specified above (I'm using a Mac). I didn't find the FontFamilyFont errors, although I find another error related to the Android support platform that I fixed by adding some lines to build.gradle, like it's explained in here:

https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2#Building_for_Android_and_iOS

Maybe those will fix your errors, but I don't know.

Cheers,

Dani

 
Average of ratings: -
Picture of Gaurav Bothra
Re: Struggling to build
 

Hello Dani Palou,

System and Node Specification

  1. Node -v : - v6.9.1
  2. npm -v :- 3.10.8
  3. gulp -v :- [12:09:17] CLI version 3.9.1
  4. I am Using Windows 10.

According to this document this Post, I successfully executed up to this step.

I am facing error in App build part

ionic cordova build android

ANDROID_HOME=C:\Users\gaura\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_171
Subproject Path: CordovaLib
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders UP-TO-DATE
:CordovaLib:compileReleaseShaders UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareComAndroidSupportSupportV132340Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBase980Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBasement980Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesGcm980Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesIid980Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesTasks980Library UP-TO-DATE
:prepareMeLeolinShortcutBadger1111Library UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\BackgroundActionButtonHandler.java:9: error: package android.support.v4.app does not exist
import android.support.v4.app.RemoteInput;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:18: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:19: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationManagerCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:20: error: package android.support.v4.app.NotificationCompat does not exist
import android.support.v4.app.NotificationCompat.WearableExtender;
                                                ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:21: error: package android.support.v4.app does not exist
import android.support.v4.app.RemoteInput;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:442: error: package NotificationCompat does not exist
    private void createActions(Bundle extras, NotificationCompat.Builder mBuilder, Resources resources, String packageName, int notId) {
                                                                ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:525: error: package NotificationCompat does not exist
    private void setNotificationCount(Context context, Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:534: error: package NotificationCompat does not exist
    private void setVisibility(Context context, Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:550: error: package NotificationCompat does not exist
    private void setNotificationVibration(Bundle extras, Boolean vibrateOption, NotificationCompat.Builder mBuilder) {
                                                                                                  ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:568: error: package NotificationCompat does not exist
    private void setNotificationMessage(int notId, Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                                    ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:641: error: package NotificationCompat does not exist
    private void setNotificationSound(Context context, Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:658: error: package NotificationCompat does not exist
    private void setNotificationLedColor(Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:677: error: package NotificationCompat does not exist
    private void setNotificationPriority(Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:693: error: package NotificationCompat does not exist
    private void setNotificationLargeIcon(Bundle extras, String packageName, Resources resources, NotificationCompat.Builder mBuilder) {
                                                                                                                    ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:722: error: package NotificationCompat does not exist
    private void setNotificationSmallIcon(Context context, Bundle extras, String packageName, Resources resources, NotificationCompat.Builder mBuilder, String localIcon) {
                                                                                                                                     ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:740: error: package NotificationCompat does not exist
    private void setNotificationIconColor(String color, NotificationCompat.Builder mBuilder, String localIconColor) {
                                                                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\PushHandlerActivity.java:10: error: package android.support.v4.app does not exist
import android.support.v4.app.RemoteInput;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:17: error: package android.support.v4.app does not exist
import android.support.v4.app.ActivityCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:18: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:19: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Notification.java:34: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Options.java:30: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Notification.java:65: error: package NotificationCompat does not exist
    private final NotificationCompat.Builder builder;
                                    ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Notification.java:81: error: package NotificationCompat does not exist
                    NotificationCompat.Builder builder, Class<?> receiver) {
                                      ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:30: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:161: error: package NotificationCompat does not exist
    private void applyDeleteReceiver(NotificationCompat.Builder builder) {
                                                       ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:183: error: package NotificationCompat does not exist
    private void applyContentReceiver(NotificationCompat.Builder builder) {
                                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\io\github\pwlin\cordova\plugins\fileopener2\FileProvider.java:28: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
                                                            ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\org\apache\cordova\camera\CameraLauncher.java:64: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\org\apache\cordova\camera\CordovaUri.java:25: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\BackgroundActionButtonHandler.java:31: error: cannot find symbol
            Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
                                 ^
  symbol:   variable RemoteInput
  location: class BackgroundActionButtonHandler
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:334: error: package NotificationCompat does not exist
        NotificationCompat.Builder mBuilder =
                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:335: error: package NotificationCompat does not exist
                new NotificationCompat.Builder(context)
                                      ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:448: error: package NotificationCompat does not exist
                ArrayList<NotificationCompat.Action> wActions = new ArrayList<NotificationCompat.Action>();
                                            ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:448: error: package NotificationCompat does not exist
                ArrayList<NotificationCompat.Action> wActions = new ArrayList<NotificationCompat.Action>();
                                                                                                ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:490: error: package NotificationCompat.Action does not exist
                    NotificationCompat.Action.Builder actionBuilder =
                                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:491: error: package NotificationCompat.Action does not exist
                        new NotificationCompat.Action.Builder(resources.getIdentifier(action.optString(ICON, ""), DRAWABLE, packageName),
                                                     ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:494: error: cannot find symbol
                    RemoteInput remoteInput = null;
                    ^
  symbol:   class RemoteInput
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:499: error: package RemoteInput does not exist
                                new RemoteInput.Builder(INLINE_REPLY)
                                               ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:505: error: package NotificationCompat does not exist
                    NotificationCompat.Action wAction = actionBuilder.build();
                                      ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:517: error: cannot find symbol
                mBuilder.extend(new WearableExtender().addActions(wActions));
                                    ^
  symbol:   class WearableExtender
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:539: error: cannot find symbol
                if (visibility >= NotificationCompat.VISIBILITY_SECRET && visibility <= NotificationCompat.VISIBILITY_PUBLIC) {
                                  ^
  symbol:   variable NotificationCompat
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:539: error: cannot find symbol
                if (visibility >= NotificationCompat.VISIBILITY_SECRET && visibility <= NotificationCompat.VISIBILITY_PUBLIC) {
                                                                                        ^
  symbol:   variable NotificationCompat
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:586: error: package NotificationCompat does not exist
                NotificationCompat.InboxStyle notificationInbox = new NotificationCompat.InboxStyle()
                                  ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:586: error: package NotificationCompat does not exist
                NotificationCompat.InboxStyle notificationInbox = new NotificationCompat.InboxStyle()
                                                                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:596: error: package NotificationCompat does not exist
                NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
                                  ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:596: error: package NotificationCompat does not exist
                NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
                                                                                ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:606: error: package NotificationCompat does not exist
            NotificationCompat.BigPictureStyle bigPicture = new NotificationCompat.BigPictureStyle();
                              ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:606: error: package NotificationCompat does not exist
            NotificationCompat.BigPictureStyle bigPicture = new NotificationCompat.BigPictureStyle();
                                                                                  ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:618: error: package NotificationCompat does not exist
            NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
                              ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:618: error: package NotificationCompat does not exist
            NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
                                                                            ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:682: error: cannot find symbol
                if (priority >= NotificationCompat.PRIORITY_MIN && priority <= NotificationCompat.PRIORITY_MAX) {
                                ^
  symbol:   variable NotificationCompat
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:682: error: cannot find symbol
                if (priority >= NotificationCompat.PRIORITY_MIN && priority <= NotificationCompat.PRIORITY_MAX) {
                                                                               ^
  symbol:   variable NotificationCompat
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\PushHandlerActivity.java:81: error: cannot find symbol
            remoteInput = RemoteInput.getResultsFromIntent(intent);
                          ^
  symbol:   variable RemoteInput
  location: class PushHandlerActivity
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:255: error: cannot find symbol
        int permissionCheck = ContextCompat.checkSelfPermission(this.cordova.getActivity(),
                              ^
  symbol:   variable ContextCompat
  location: class IntentShim
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:261: error: cannot find symbol
            ActivityCompat.requestPermissions(this.cordova.getActivity(),
            ^
  symbol:   variable ActivityCompat
  location: class IntentShim
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:281: error: cannot find symbol
                Uri uri = FileProvider.getUriForFile(this.cordova.getActivity().getApplicationContext(), PACKAGE_NAME, uriAsFile);
                          ^
  symbol:   variable FileProvider
  location: class IntentShim
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Options.java:302: error: cannot find symbol
            return NotificationCompat.COLOR_DEFAULT;
                   ^
  symbol:   variable NotificationCompat
  location: class Options
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:121: error: package NotificationCompat does not exist
        NotificationCompat.Builder builder;
                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:123: error: package NotificationCompat does not exist
        builder = new NotificationCompat.Builder(context)
                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\io\github\pwlin\cordova\plugins\fileopener2\FileOpener2.java:110: error: cannot
find symbol
                                        path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);
                                                           ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\org\apache\cordova\camera\CameraLauncher.java:295: error: cannot find symbol
        this.imageUri = new CordovaUri(FileProvider.getUriForFile(cordova.getActivity(),
                                       ^
  symbol:   variable FileProvider
  location: class CameraLauncher
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\org\apache\cordova\camera\CameraLauncher.java:800: error: cannot find symbol
                        Uri tmpFile = FileProvider.getUriForFile(cordova.getActivity(),
                                      ^
  symbol:   variable FileProvider
  location: class CameraLauncher
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
63 errors
:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.


BUILD FAILED

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Total time: 7.751 secs
Error: cmd: Command failed with exit code 1 Error output:
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\BackgroundActionButtonHandler.java:9: error: package android.support.v4.app does not exist
import android.support.v4.app.RemoteInput;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:18: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:19: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationManagerCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:20: error: package android.support.v4.app.NotificationCompat does not exist
import android.support.v4.app.NotificationCompat.WearableExtender;
                                                ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:21: error: package android.support.v4.app does not exist
import android.support.v4.app.RemoteInput;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:442: error: package NotificationCompat does not exist
    private void createActions(Bundle extras, NotificationCompat.Builder mBuilder, Resources resources, String packageName, int notId) {
                                                                ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:525: error: package NotificationCompat does not exist
    private void setNotificationCount(Context context, Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:534: error: package NotificationCompat does not exist
    private void setVisibility(Context context, Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:550: error: package NotificationCompat does not exist
    private void setNotificationVibration(Bundle extras, Boolean vibrateOption, NotificationCompat.Builder mBuilder) {
                                                                                                  ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:568: error: package NotificationCompat does not exist
    private void setNotificationMessage(int notId, Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                                    ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:641: error: package NotificationCompat does not exist
    private void setNotificationSound(Context context, Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:658: error: package NotificationCompat does not exist
    private void setNotificationLedColor(Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:677: error: package NotificationCompat does not exist
    private void setNotificationPriority(Bundle extras, NotificationCompat.Builder mBuilder) {
                                                                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:693: error: package NotificationCompat does not exist
    private void setNotificationLargeIcon(Bundle extras, String packageName, Resources resources, NotificationCompat.Builder mBuilder) {
                                                                                                                    ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:722: error: package NotificationCompat does not exist
    private void setNotificationSmallIcon(Context context, Bundle extras, String packageName, Resources resources, NotificationCompat.Builder mBuilder, String localIcon) {
                                                                                                                                     ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:740: error: package NotificationCompat does not exist
    private void setNotificationIconColor(String color, NotificationCompat.Builder mBuilder, String localIconColor) {
                                                                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\PushHandlerActivity.java:10: error: package android.support.v4.app does not exist
import android.support.v4.app.RemoteInput;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:17: error: package android.support.v4.app does not exist
import android.support.v4.app.ActivityCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:18: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:19: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Notification.java:34: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Options.java:30: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Notification.java:65: error: package NotificationCompat does not exist
    private final NotificationCompat.Builder builder;
                                    ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Notification.java:81: error: package NotificationCompat does not exist
                    NotificationCompat.Builder builder, Class<?> receiver) {
                                      ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:30: error: package android.support.v4.app does not exist
import android.support.v4.app.NotificationCompat;
                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:161: error: package NotificationCompat does not exist
    private void applyDeleteReceiver(NotificationCompat.Builder builder) {
                                                       ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:183: error: package NotificationCompat does not exist
    private void applyContentReceiver(NotificationCompat.Builder builder) {
                                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\io\github\pwlin\cordova\plugins\fileopener2\FileProvider.java:28: error: package android.support.v4.content does not exist
public class FileProvider extends android.support.v4.content.FileProvider {
                                                            ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\org\apache\cordova\camera\CameraLauncher.java:64: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\org\apache\cordova\camera\CordovaUri.java:25: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\BackgroundActionButtonHandler.java:31: error: cannot find symbol
            Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
                                 ^
  symbol:   variable RemoteInput
  location: class BackgroundActionButtonHandler
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:334: error: package NotificationCompat does not exist
        NotificationCompat.Builder mBuilder =
                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:335: error: package NotificationCompat does not exist
                new NotificationCompat.Builder(context)
                                      ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:448: error: package NotificationCompat does not exist
                ArrayList<NotificationCompat.Action> wActions = new ArrayList<NotificationCompat.Action>();
                                            ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:448: error: package NotificationCompat does not exist
                ArrayList<NotificationCompat.Action> wActions = new ArrayList<NotificationCompat.Action>();
                                                                                                ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:490: error: package NotificationCompat.Action does not exist
                    NotificationCompat.Action.Builder actionBuilder =
                                             ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:491: error: package NotificationCompat.Action does not exist
                        new NotificationCompat.Action.Builder(resources.getIdentifier(action.optString(ICON, ""), DRAWABLE, packageName),
                                                     ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:494: error: cannot find symbol
                    RemoteInput remoteInput = null;
                    ^
  symbol:   class RemoteInput
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:499: error: package RemoteInput does not exist
                                new RemoteInput.Builder(INLINE_REPLY)
                                               ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:505: error: package NotificationCompat does not exist
                    NotificationCompat.Action wAction = actionBuilder.build();
                                      ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:517: error: cannot find symbol
                mBuilder.extend(new WearableExtender().addActions(wActions));
                                    ^
  symbol:   class WearableExtender
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:539: error: cannot find symbol
                if (visibility >= NotificationCompat.VISIBILITY_SECRET && visibility <= NotificationCompat.VISIBILITY_PUBLIC) {
                                  ^
  symbol:   variable NotificationCompat
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:539: error: cannot find symbol
                if (visibility >= NotificationCompat.VISIBILITY_SECRET && visibility <= NotificationCompat.VISIBILITY_PUBLIC) {
                                                                                        ^
  symbol:   variable NotificationCompat
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:586: error: package NotificationCompat does not exist
                NotificationCompat.InboxStyle notificationInbox = new NotificationCompat.InboxStyle()
                                  ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:586: error: package NotificationCompat does not exist
                NotificationCompat.InboxStyle notificationInbox = new NotificationCompat.InboxStyle()
                                                                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:596: error: package NotificationCompat does not exist
                NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
                                  ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:596: error: package NotificationCompat does not exist
                NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
                                                                                ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:606: error: package NotificationCompat does not exist
            NotificationCompat.BigPictureStyle bigPicture = new NotificationCompat.BigPictureStyle();
                              ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:606: error: package NotificationCompat does not exist
            NotificationCompat.BigPictureStyle bigPicture = new NotificationCompat.BigPictureStyle();
                                                                                  ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:618: error: package NotificationCompat does not exist
            NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
                              ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:618: error: package NotificationCompat does not exist
            NotificationCompat.BigTextStyle bigText = new NotificationCompat.BigTextStyle();
                                                                            ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:682: error: cannot find symbol
                if (priority >= NotificationCompat.PRIORITY_MIN && priority <= NotificationCompat.PRIORITY_MAX) {
                                ^
  symbol:   variable NotificationCompat
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\GCMIntentService.java:682: error: cannot find symbol
                if (priority >= NotificationCompat.PRIORITY_MIN && priority <= NotificationCompat.PRIORITY_MAX) {
                                                                               ^
  symbol:   variable NotificationCompat
  location: class GCMIntentService
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\adobe\phonegap\push\PushHandlerActivity.java:81: error: cannot find symbol
            remoteInput = RemoteInput.getResultsFromIntent(intent);
                          ^
  symbol:   variable RemoteInput
  location: class PushHandlerActivity
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:255: error: cannot find symbol
        int permissionCheck = ContextCompat.checkSelfPermission(this.cordova.getActivity(),
                              ^
  symbol:   variable ContextCompat
  location: class IntentShim
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:261: error: cannot find symbol
            ActivityCompat.requestPermissions(this.cordova.getActivity(),
            ^
  symbol:   variable ActivityCompat
  location: class IntentShim
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\com\darryncampbell\plugin\intent\IntentShim.java:281: error: cannot find symbol
                Uri uri = FileProvider.getUriForFile(this.cordova.getActivity().getApplicationContext(), PACKAGE_NAME, uriAsFile);
                          ^
  symbol:   variable FileProvider
  location: class IntentShim
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Options.java:302: error: cannot find symbol
            return NotificationCompat.COLOR_DEFAULT;
                   ^
  symbol:   variable NotificationCompat
  location: class Options
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:121: error: package NotificationCompat does not exist
        NotificationCompat.Builder builder;
                          ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\de\appplant\cordova\plugin\notification\Builder.java:123: error: package NotificationCompat does not exist
        builder = new NotificationCompat.Builder(context)
                                        ^
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\io\github\pwlin\cordova\plugins\fileopener2\FileOpener2.java:110: error: cannot
find symbol
                                        path = FileProvider.getUriForFile(context, cordova.getActivity().getPackageName() + ".opener.provider", file);
                                                           ^
  symbol:   method getUriForFile(Context,String,File)
  location: class FileProvider
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\org\apache\cordova\camera\CameraLauncher.java:295: error: cannot find symbol
        this.imageUri = new CordovaUri(FileProvider.getUriForFile(cordova.getActivity(),
                                       ^
  symbol:   variable FileProvider
  location: class CameraLauncher
C:\Users\gaura\Desktop\moodlemobile2\platforms\android\src\org\apache\cordova\camera\CameraLauncher.java:800: error: cannot find symbol
                        Uri tmpFile = FileProvider.getUriForFile(cordova.getActivity(),
                                      ^
  symbol:   variable FileProvider
  location: class CameraLauncher
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
63 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output


 
Average of ratings: -
Picture of Dani Palou
Re: Struggling to build
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Gaurav,

please try to add these lines at the end of platforms/android/build.gradle:

configurations.all {

     resolutionStrategy.force 'com.android.support:support-v4:24.0.0'

 }

Also, please open the Android SDK Manager and make sure you have the support library installed.

Cheers,

Dani

 
Average of ratings: -
Picture of Gaurav Bothra
Re: Struggling to build
 

Thanks for reply Dani,

Support Library is installed in Android Studio and I already added this line at the end of build.gradle file

configurations.all {

     resolutionStrategy.force 'com.android.support:support-v4:24.0.0'

 }


I getting same same error as mentioned above



 
Average of ratings: -