zoukankan      html  css  js  c++  java
  • [RN] React Native 使用 react-native-camera 过程中报错 Found react-native-camera 'mlkit' but wasn't required.`

    详细报错如下:

    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 中:

    增加

    maven { url "https://jitpack.io" } 
    maven { url "https://maven.google.com" } 


    参考:
    https://github.com/react-native-community/react-native-camera/issues/2150

  • 相关阅读:
    Nginx 在 Linux 下安装与搭建集群
    php服务器环境安装及项目搭建
    安全运维 -- Linux服务器使用公私钥密匙证书登录
    Linux 使用nexus搭建maven私服
    lombok使用教程
    Java爬虫项目实战(一)
    CGI,FastCGI和PHP-FPM之间的关系和区别
    IPv6、双栈与隧道
    mysql时间戳转日期
    socket通讯原理及例程(一看就懂
  • 原文地址:https://www.cnblogs.com/wukong1688/p/11029562.html
Copyright © 2011-2022 走看看