FAILURE: Build failed with an exception.



  • JS server already running.
    Building and installing the app on the device (cd android && gradlew.bat installDebug)...

    FAILURE: Build failed with an exception.

    • What went wrong:
      Could not determine the dependencies of task ':app:mergeDebugAssets'.

    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.

    • Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 4s
    Could not install the app on the device, read the error above for details.
    Make sure you have an Android emulator running or a device connected and have
    set up your Android development environment:
    https://facebook.github.io/react-native/docs/getting-started.html

    Command failed: gradlew.bat installDebug

    Error: Command failed: gradlew.bat installDebug
    at checkExecSyncError (child_process.js:601:13)
    at Object.execFileSync (child_process.js:621:13)
    at runOnAllDevices (D:\kunchiBARN\newload\two\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
    at buildAndRun (D:\kunchiBARN\newload\two\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
    at isPackagerRunning.then.result (D:\kunchiBARN\newload\two\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    我引入react-native-carmer之后一直报这个错误,找了一下午的google没有找到结果,求教遇到的高手,到底是什么问题



  • @zhangdan183 我也这问题,跪求大佬帮忙



  • 经过我自己尝试 有些模块可以正常使用 有些却不可以
    其他问题暂时没有解决