Как я могу вручную связать ответную нативную камеру в Android Studio? - PullRequest
0 голосов
/ 26 октября 2019

Просто чтобы уточнить, я работаю на компьютере под управлением Windows Studio с помощью Android Studio.

Я пытаюсь настроить сканер QR-кода, используя камеру-реактивную камеру в приложении-адаптере.

Я могу установить библиотеку без проблем:

$ npm install react-native-camera --save

дает

npm WARN babel-eslint@10.0.1 requires a peer of eslint@>= 4.12.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-eslint-comments@3.1.2 requires a peer of eslint@>=4.19.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-flowtype@2.50.3 requires a peer of eslint@>=2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-jest@22.4.1 requires a peer of eslint@>=5 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react@7.12.4 requires a peer of eslint@^3.0.0 || ^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react-hooks@1.6.1 requires a peer of eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react-native@3.6.0 requires a peer of eslint@^3.17.0 || ^4 || ^5 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename '[file location]\node_modules\.staging\fsevents-7a20bca6\node_modules\needle' -> '[file location]\node_modules\.staging\needle-41ea96cc'


+ react-native-camera@3.8.0
updated 1 package and audited 948127 packages in 76.202s
found 0 vulnerabilities

Каждая онлайн-ссылка, которую я видел, например,https://facebook.github.io/react-native/docs/linking-libraries-ios, кажется, дает инструкции, только если вы программируете для iOS на Mac.

Документы для библиотеки на https://react -native-community.github.io / Reaction-native-camera / docs / installation рекомендует автоподсоединение с использованием

$ react-native link react-native-camera.

Я получаю:

info Linking "react-native-camera" iOS dependency
info iOS module "react-native-camera" has been successfully linked
info Linking "react-native-camera" Android dependency
info Android module "react-native-camera" has been successfully linked

Проблема возникает при сборке на моем устройстве,используя $ react-native run-android, где я получаю:

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
  - react-native-camera (to unlink run: "react-native unlink react-native-camera")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md

Единственные результаты для ручного связывания на XCode, но может ли кто-нибудь помочь мне с Android Studio? Я был бы очень признателен.

1 Ответ

0 голосов
/ 26 октября 2019

Похоже, что вы используете новую версию реагировать-нативный (0,60 или выше). В этом случае вам не нужно самостоятельно связывать свою библиотеку, поскольку библиотеки, которые поддерживают последнюю версиюact-native, теперь связывают себя при установке.

Вы должны быть в состоянии выполнить npm install react-native-camera --save и заставить его работать. Если вы ранее использовали react-native link react-native-camera, теперь вам может потребоваться запустить react-native unlink react-native-camera, чтобы отменить то, что было сделано командой link. Вам также может понадобиться переустановить библиотеку (npm uninstall react-native-camera, затем npm install react-native-camera --save). Если это все еще не работает, вы можете пройти ручную установку этой библиотеки

...