加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

[RN] React Native 使用 react-native-camera 过程中报错 Found

发布时间:2020-12-15 16:17:45 所属栏目:百科 来源:网络整理
导读:? 详细报错如下: Could not resolve all task dependencies for configuration ‘:app:debugRuntimeClasspath‘. Could not resolve project :react-native-camera. Required by: project :app Cannot choose between the following configurations of proj

?

详细报错如下:

Could not resolve all task dependencies for configuration ‘:app:debugRuntimeClasspath‘.
Could not resolve project :react-native-camera.
Required by:
project :app
> Cannot choose between the following configurations of project :react-native-camera:
- generalDebugRuntimeElements
- mlkitDebugRuntimeElements
All of them match the consumer attributes:
- Configuration ‘generalDebugRuntimeElements‘:
- Required com.android.build.api.attributes.BuildTypeAttr ‘debug‘ and found compatible value ‘debug‘.
- Found com.android.build.api.attributes.VariantAttr ‘generalDebug‘ but wasn‘t required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr ‘Aar‘ and found compatible value ‘Aar‘.
- Required org.gradle.usage ‘java-runtime‘ and found compatible value ‘java-runtime‘.
- Found react-native-camera ‘general‘ but wasn‘t required.
- Configuration ‘mlkitDebugRuntimeElements‘:
- Required com.android.build.api.attributes.BuildTypeAttr ‘debug‘ and found compatible value ‘debug‘.
- Found com.android.build.api.attributes.VariantAttr ‘mlkitDebug‘ but wasn‘t required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr ‘Aar‘ and found compatible value ‘Aar‘.
- Required org.gradle.usage ‘java-runtime‘ and found compatible value ‘java-runtime‘.
- Found react-native-camera ‘mlkit‘ but wasn‘t required.`

?

解决办法:

android/app/build.gradle

增加:

missingDimensionStrategy ‘react-native-camera‘,‘general‘ in defaultConfig

?

同时在android/build.gradle 中:

增加

参考:https://github.com/react-native-community/react-native-camera/issues/2150maven { url "https://jitpack.io" } 
maven { url "https://maven.google.com" }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读