添加依赖项时,android sdk 28中的PayUmoney集成发生错误,gradle同步失败

时间:2018-10-13 11:33:33

标签: android android-gradle

  

依赖项

dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:28.0.0'
         implementation 'com.android.support.constraint:constraint-layout:1.1.3'
         testImplementation 'junit:junit:4.12'
       androidTestImplementation 'com.android.support.test:runner:1.0.2'
         androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
        implementation 'com.payumoney.sdkui:plug-n-play:1.4.4'
        }
  

错误

这是gradle同步时生成的错误。 如果sdk版本为27,则唯一的gradle同步成功。

Android resource compilation failed
Output:  C:\Users\gagan\AndroidPayment\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1114: error: duplicate value for resource 'attr/layout_anchorGravity' with config ''.
C:\Users\gagan\AndroidPayment\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1114: error: resource previously defined here.

Command: C:\Users\gagan\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\ae5ba3713e4c882dbabd6f009a856f88\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
        -o \
        C:\Users\gagan\AndroidPayment\app\build\intermediates\res\merged\debug \
        C:\Users\gagan\AndroidPayment\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

1 个答案:

答案 0 :(得分:0)

  

资源'attr / layout_anchorGravity'的重复值

     

资源先前在此处定义

有时,由于重复定义的资源,IDE可能会感到困惑。因此,转到values.xml并找到:

layout_anchorGravity

然后删除另一个。如果这不能解决问题,并且您确定不会重复,请尝试清理您的项目。