Error in Building PhoneGap App

Re: Error in Building PhoneGap App

by behnaz ranjbar -
Number of replies: 7

same problemmixed

does anyone know the solution?

In reply to behnaz ranjbar

Re: Error in Building PhoneGap App

by Grayson Bartlet -

I've been having this problem as well. My understanding is that it's caused by plugins wanting different versions of the Android support library. That issue can be resolved with the cordova-android-support-gradle-release plugin. I resolved that issue by adding the following to my config.xml:

    <gap:plugin name="cordova-android-support-gradle-release" source="npm" >
        <variable name = "ANDROID_SUPPORT_VERSION" value = "27.1.0" /> <!--forces plugins to use same version of android support library-->
    </gap:plugin>

...unfortunately that gives me a new error in phonegap:

Error: /project/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
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
I think the FontFamily stuff is required by the newer android versions.
In reply to Grayson Bartlet

Re: Error in Building PhoneGap App

by Grayson Bartlet -

OK, I don't get that error and am able to successfully compile if I also set the android-targetSdkVersion to 27.

However, the app now crashes when I launch it with this exception:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/util/zzw;

I think this is because I've got a conflict between the phonegap-plugin-push plugin and the cordova-plugin-google-analytics plugin, where they want different versions of some library. If you're not using the analytics plugin, tell me if this works for you.

In reply to Grayson Bartlet

Re: Error in Building PhoneGap App

by behnaz ranjbar -

I also got such a error :Error - Malformed config.xml

really it would be very nice if we could see a complete and step by step document for building an app in moodle site sad

In reply to Grayson Bartlet

Re: Error in Building PhoneGap App

by Dani Ureña -

Hello Grayson,
I had the same problem with the fonts I take these steps to find the solution:

I run my Android SDK Manager and see what exactly is my version of "Android SDK Build-Tools" and I specify this at the end of the file platforms/android/build.gradle :

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
}

After finding the solution I have reported it and it is already in the Wiki:

https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2#ERROR:_In_.3Cdeclare-styleable.3E_FontFamilyFont.2C_unable_to_find_attribute_android:font

Regards.


In reply to Grayson Bartlet

Re: Error in Building PhoneGap App

by Dennie Walker -

Did you find a solution to this?
I have the same issue trying to build this app.

I am really pulling my hair out over this since none of the suggestions below work.