Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cordova build fails due to "com.android.support:support-v4" version #207

Closed
prudnikovdbison opened this issue Apr 5, 2018 · 7 comments
Closed

Comments

@prudnikovdbison
Copy link

prudnikovdbison commented Apr 5, 2018

Cordova build fails with exception:
:processDebugResourcesERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex

This can be fixed in plugin.xml by upgrading
<framework src="com.android.support:support-v4:+" />
to a higher version like 27.0.1 or downgrading to 23.+.

Examples (tested):
<framework src="com.android.support:support-v4:27.0.1" />
or
<framework src="com.android.support:support-v4:23.+" />

@Fieel
Copy link

Fieel commented Apr 10, 2018

Same here. Simply adding the plugin in my ionic project without even importing nor using it.

cordova plugin remove cordova-plugin-file-opener2 didn't fix, even tho i removed the plugin with this command.

I ran cordova clean and finally got rid of whatever was causing problems, this is the output:

Android Studio project detected
ANDROID_HOME=C:\android_sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_131
Subproject Path: CordovaLib
Subproject Path: app

> Configure project :CordovaLib
publishNonDefault is deprecated and has no effect anymore. All variants are now published.

> Configure project :app
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_bjcqxndxlo2btrsrtx6k8ypbs.run(C:\Users\Fil\****\Projects\Mobile\Ionic\APOD_nasa\platforms\android\app\build.gradle:144)

@roby65
Copy link

roby65 commented Apr 12, 2018

Use this cordova plugin to fix this problem
I forced version 27.0.0 and it works flawlessy:

cordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=27.0.0

@Fieel
Copy link

Fieel commented Apr 14, 2018

I don't know what happened but i managed to build even though i didn't touch my project. I think this is some kind of compatibility-issue and not a real bug - i'm happily using the plugin without any error now!

@sadikyalcin
Copy link

sadikyalcin commented Apr 19, 2018

@roby65 That only solves half of the issue. Using that plugin keep crashes the app on launch. Only way to get it working is running via Android Studio.

Proper way to solve this is seen on this answer on stack.

Create a build-extras.gradle file in platforms/android and add the following in that file. This forces all framework sources to use v4:27.1.0 of support files.

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}

@AppwareDev
Copy link

I tried every suggestion to fix this but in the end simply updating ionic and cordova fixed it:
npm install -g ionic cordova

You might also need to remove and add the Android platform again:
ionic cordova platform rm android
ionic cordova platform add android

@mmfilesi
Copy link

cordova-android-support-gradle-release and build-extras.gradle conflicts with other plugins. Better not install this plugin.

@shnist
Copy link
Collaborator

shnist commented Dec 11, 2018

version 2.1.0 should now resolve this issue as you can optionally set a compatible android_support_version at installation time, e.g.
cordova plugin add cordova-plugin-file-opener2 --variable ANDROID_SUPPORT_VERSION=27.+

@shnist shnist closed this as completed Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants