🤳

react-native-camera が動かない(android)

2021/12/07に公開約1,700字

インストール

https://react-native-camera.github.io/react-native-camera/docs/installation#mostly-automatic-install-with-autolinking-rn--060
  • ↑の手順でやってみる
    • そもそも pod がない。
    • cocoapods 入れるもんなのか…?
  • react-native link react-native-camera もやったけどダメそう

起きたこと

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

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
      > The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'. However we cannot choose between the following variants of project :react-native-camera:
          - generalDebugRuntimeElements
          - mlkitDebugRuntimeElements
        All of them match the consumer attributes:
          - Variant 'generalDebugRuntimeElements' capability myReactNativeApp:react-native-camera:unspecified declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
....

解決

https://github.com/react-native-camera/react-native-camera/issues/2150#issuecomment-484059264

Discussion

ログインするとコメントできます