moaazsidat / react-native-qrcode-scanner

A QR code scanner component for React Native.
MIT License
2.04k stars 516 forks source link

ViewPropTypes is back on React Native 0.71 #404

Open saifulshihab opened 1 year ago

saifulshihab commented 1 year ago

I have created a new react native app with the latest version 0.71. And using this package to implement QR code scan feature on my app. Scanning works fine. But need to fix this warning. image

musabsengul commented 1 year ago

@saifulshihab Did you use 'react-native-camera' because it is deprecated.

saifulshihab commented 1 year ago

Yes, what's the alternative??

musabsengul commented 1 year ago

@saifulshihab I know there is no alternative. I am also trying to use this but i am getting error like this on android

`Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. Could not resolve project :react-native-camera. Required by: project :app The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1'. However we cannot choose between the following variants of project :react-native-camera:

  • generalDebugApiElements
  • mlkitDebugApiElements All of them match the consumer attributes:
  • Variant 'generalDebugApiElements' capability courier:react-native-camera:unspecified declares an API of a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
  • Unmatched attributes:
  • Provides attribute 'com.android.build.api.attributes.ProductFlavor:react-native-camera' with value 'general' but the consumer didn't ask for it
  • Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'generalDebug' but the consumer didn't ask for it
  • Doesn't say anything about its target Java environment (preferred optimized for Android)
  • Provides attribute 'react-native-camera' with value 'general' but the consumer didn't ask for it
  • Variant 'mlkitDebugApiElements' capability courier:react-native-camera:unspecified declares an API of a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
  • Unmatched attributes:
  • Provides attribute 'com.android.build.api.attributes.ProductFlavor:react-native-camera' with value 'mlkit' but the consumer didn't ask for it
  • Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'mlkitDebug' but the consumer didn't ask for it
  • Doesn't say anything about its target Java environment (preferred optimized for Android)
  • Provides attribute 'react-native-camera' with value 'mlkit' but the consumer didn't ask for it The following variants were also considered but didn't match the requested attributes:
  • Variant 'generalReleaseApiElements' capability courier:react-native-camera:unspecified declares an API of a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1':
  • Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
  • Other compatible attribute:
  • Doesn't say anything about its target Java environment (preferred optimized for Android)
  • Variant 'generalReleaseRuntimeElements' capability courier:react-native-camera:unspecified declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1':
  • Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
  • Other compatible attribute:
  • Doesn't say anything about its target Java environment (preferred optimized for Android)
  • Variant 'mlkitReleaseApiElements' capability courier:react-native-camera:unspecified declares an API of a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1':
  • Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
  • Other compatible attribute:
  • Doesn't say anything about its target Java environment (preferred optimized for Android)
  • Variant 'mlkitReleaseRuntimeElements' capability courier:react-native-camera:unspecified declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1':
  • Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
  • Other compatible attribute:
  • Doesn't say anything about its target Java environment (preferred optimized for Android) `
JJalit commented 1 year ago

@musabsengul I have same issue on Android ... how to solve this issue?

musabsengul commented 1 year ago

@JJalit

I've followed these steps: https://react-native-camera.github.io/react-native-camera/docs/installation#manual-install---android-not-recommended

ahmedfouad01099 commented 1 year ago

any updates any solutions?

JJalit commented 1 year ago

I solved this issue. I followed this

add this line to android/app/build.gralde defaultConfig missingDimensionStrategy 'react-native-camera', 'mlkit'