首页 > 解决方案 > 无法构建android(因为重复的依赖?)

问题描述

你好我想问一下android错误信息,我想知道如何解决这个问题。我用 react native 开发它,我想知道它是什么意思以及如何解决它。你可以在下面看到错误

home/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/588cc028d2e630da3036f4ad87f9dbb3/res/values/values.xml:252:5-69: AAPT: Attribute "aspectRatio" already defined with incompatible format.

home/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/588cc028d2e630da3036f4ad87f9dbb3/res/values/values.xml:252:5-69: AAPT: Original attribute defined here.

project/node_modules/react-native-camera/android/build/intermediates/bundles/debug/res/values/values.xml:20:5-26:13: AAPT: String types not allowed (at 'aspectRatio' with value '4:3').

warning: string 'title_payment_failed' has no default translation.
Failed to generate resource table for split ''
project/android/app/build/intermediates/res/merged/debug/values/values.xml:477: error: Attribute "aspectRatio" already defined with incompatible format.
project/android/app/build/intermediates/res/merged/debug/values/values.xml:462: Original attribute defined here.
project/HGC-datacomm/android/app/build/intermediates/res/merged/debug/values/values.xml:3636: error: Error: String types not allowed (at 'aspectRatio' with value '4:3').
> Task :app:processDebugResources FAILED
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt

提前致谢

PS。我已经将 android.enableAapt2 设置为 false

编辑:我找到了如何重现这个错误

compile ('com.midtrans:uikit:1.20.3-PRODUCTION')
compile ('com.midtrans:uikit:1.20.3')
compile project(':react-native-camera')

// midtrans repositories

maven { url "http://dl.bintray.com/pt-midtrans/maven" }
maven { url "https://jitpack.io" }

我怀疑依赖项存在冲突,因为当我评论其中一个包时,它的工作没有问题,但我不知道如何解决它。也许老手android可以帮助我如何解决它?提前致谢

标签: androidandroid-studioreact-nativegradleandroid-gradle-plugin

解决方案


推荐阅读