1

I've used xwalk project in mine for a while now. However, during the last round of library version upgrades, gradle doesn't like xwalk any more. Simply including it into my project

compile 'org.xwalk:xwalk_core_library:19.49.514.5'

will produce the following error on my dimens.xml:

error: resource android:attr/fontStyle not found.
error: resource android:attr/font not found.
error: resource android:attr/fontWeight not found.

dimens.xml:

<resources>
  <!-- Default screen margins, per the Android Design guidelines. -->
  <dimen name="activity_horizontal_margin">16dp</dimen>
  <dimen name="activity_vertical_margin">16dp</dimen>
</resources>

The conflicting attributes are actually referenced in app/build/intermediates/incremental/mergeDeployDebugResources/merged.dir/values/values.xml.

Initially I paid this no attention because I needed to develop some new functionality, but now it's time to publish and I need to make my "publish" flavor working again. The ONLY difference between gradle compiling or not being inclusion of xwalk into my project.

To make matters worse, I also upgraded Android Studio to version 3 and now I'm stuck not being able to revert my repository to something before the breaking change so that I could hunt for the issue.

I googled this a lot but it seems I'm the only one messing this up, so I'd appreciate any pointers on what I might be doing wrong.

Reverting xwalk version to an older one does not help. I'm currently using the latest version which still works on Android 4.0 (project requirement).

How can I fix this?

Edit: stupid me!!! I didn't revert to OLD ENOUGH version of xwalk. reverting to 15.44.384.13 removes the problem. The issue is that the attributes in question are only supported from API 16 forward and I must also work with 14 --> Even upping minSdkVersion to 16 doesn't solve the issue.

Edit2: disabling aapt2 does not help: the same errors are reported with aapt1.

Downgrading build tools from 26.0.2 to 25.0.2 does not help.

Edit3: Increasing compileSdkVersion & targetSdkVersion to 26 solves the problem. I have 22 normally because of Marshmallow permissions system. Note that it MUST be at least 26. Even 25 still produces the error.

I am allowed to leave it at 22 in the libraries I'm using, but not the main app project using xwalk.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
velis
  • 8,747
  • 4
  • 44
  • 64

1 Answers1

0

Open build.gradle and put this at the end of the file:

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

Running "cordova build android" - unable to find attribute android:fontVariationSettings and android:ttcIndex

LoneDev
  • 1
  • 2