Moodle for mobile

Error in Building PhoneGap App

 
Picture of behnaz ranjbar
Re: Error in Building PhoneGap App
 

same problemmixed

does anyone know the solution?

 
Average of ratings: -
Picture of Grayson Bartlet
Re: Error in Building PhoneGap App
 

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.
 
Average of ratings: -
Picture of Grayson Bartlet
Re: Error in Building PhoneGap App
 

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.

 
Average of ratings: -
Picture of Gaurav Bothra
Re: Error in Building PhoneGap App
 

Hi Grayson Bartlet,

Which method you are trying for building app local or online phonegap build


 
Average of ratings: -
Picture of Grayson Bartlet
Re: Error in Building PhoneGap App
 

Phonegap.

 
Average of ratings: -
Picture of behnaz ranjbar
Re: Error in Building PhoneGap App
 

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

 
Average of ratings: -
Picture of Dani Ureña
Re: Error in Building PhoneGap App
Core developers

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.


 
Average of ratings: -