6

when I try to build my Ionic project for Android with Crosswalk I get following error. Without Crosswalk everything works fine..

platforms/android/build/intermediates/res/merged/armv7/debug/values/values.xml:243: AAPT: Attribute "layout_anchorGravity" already defined with incompatible format.

and

What went wrong: Execution failed for task ':processArmv7DebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt

  • Ionic CLI: 3.17.0
  • cordova-android: 6.3.0
  • Crosswalk: 2.4.0

Has someone a hint or a solution for me? Thanks in advance <3

Abhinav Gupta
  • 2,225
  • 1
  • 14
  • 30
Frede
  • 701
  • 4
  • 14
  • Did you ever get this fixed @frede? – gregavola May 03 '18 at 18:28
  • Got any solution ? – Upendra May 29 '18 at 07:02
  • hey guys, sry for the late response. yes, i did fix it, but actually I'm not sure how D: Several updates to Ionic, the android sdk, cordova-android and some plugins I've been using probably did the job. Nothing fancy I guess. Working with Ionic sometimes is a pain in the arse – Frede Sep 06 '18 at 14:05

2 Answers2

5

If you are using com.android.support:*-v7:27.1.x gradle dependencies, change it to com.android.support:*-v7:26.1.0 or lower version. Here is the link of Recent Support Library Revisions

Joonsoo
  • 788
  • 1
  • 13
  • 15
0

It happen when you make update build sdk version ,I resolved it by Searching layout_anchorGravity inside entire project in Android Studio ,using CTR+H shortcut, it open file /users/{user}/.android/build.cache/~/output/res/values/values.xml I delete this line from file

<declare-styleable name="CoordinatorLayout_LayoutParams"><attr name="android:layout_gravity"/><attr format="string" name="layout_behavior"/><attr format="reference" name="layout_anchor"/><attr format="integer" name="layout_keyline"/><attr name="layout_anchorGravity"><flag name="top" value="0x30"/><flag name="bottom" value="0x50"/><flag name="left" value="0x03"/><flag name="right" value="0x05"/><flag name="center_vertical" value="0x10"/><flag name="fill_vertical" value="0x70"/><flag name="center_horizontal" value="0x01"/><flag name="fill_horizontal" value="0x07"/><flag name="center" value="0x11"/><flag name="fill" value="0x77"/><flag name="clip_vertical" value="0x80"/><flag name="clip_horizontal" value="0x08"/><flag name="start" value="0x00800003"/><flag name="end" value="0x00800005"/></attr></declare-styleable>

and then from onther java file I removed import android.support.v7.app.NotificationCompat;

I clean and build ,it build successfully

Taimur
  • 559
  • 11
  • 24