【问题标题】:I can't run react-native-webrtc-demo on my android emulator in mac os我无法在 mac os 的 android 模拟器上运行 react-native-webrtc-demo
【发布时间】:2019-01-15 12:29:00
【问题描述】:

我将在移动应用上实时显示 IP 摄像头。

所以我从 GitHub 下载了 Oney 的 RCTWebRTCDemo 来运行它。

我做了以下工作。

Bians-iMac:MyHome byz$ git clone https://github.com/oney/RCTWebRTCDemo.git
Cloning into 'RCTWebRTCDemo'...
remote: Counting objects: 359, done.
remote: Total 359 (delta 0), reused 0 (delta 0), pack-reused 359
Receiving objects: 100% (359/359), 456.78 KiB | 303.00 KiB/s, done.
Resolving deltas: 100% (155/155), done.
Bians-iMac:MyHome byz$ cd RCTWebRTCDemo
Bians-iMac:RCTWebRTCDemo byz$ npm install
npm WARN deprecated connect@2.30.2: connect 2.x series is deprecated
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm notice created a lockfile as package-lock.json. You should commit this file.
added 592 packages from 409 contributors and audited 5796 packages in 434.447s
found 24 vulnerabilities (13 low, 3 moderate, 8 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Bians-iMac:RCTWebRTCDemo byz$ npm audit fix

> fsevents@1.2.4 install /Volumes/STUDY/Work/MyHome/RCTWebRTCDemo/node_modules/fsevents
> node install

[fsevents] Success: "/Volumes/STUDY/Work/MyHome/RCTWebRTCDemo/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
npm WARN react-native@0.56.0 requires a peer of react@16.4.1 but none is installed. You must install peer dependencies yourself.

+ react-native@0.56.0
added 407 packages from 157 contributors, removed 196 packages, updated 72 packages and moved 3 packages in 59.949s
fixed 20 of 24 vulnerabilities in 5796 scanned packages
  1 package update for 4 vulns involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)
Bians-iMac:RCTWebRTCDemo byz$ react-native link
Scanning folders for symlinks in /Volumes/STUDY/Work/MyHome/RCTWebRTCDemo/node_modules (9ms)
rnpm-install info Platform 'ios' module react-native-webrtc is already linked 
rnpm-install info Linking react-native-webrtc android dependency 
rnpm-install info Platform 'android' module react-native-webrtc has been successfully linked 
Bians-iMac:RCTWebRTCDemo byz$ react-native run-android
Scanning folders for symlinks in /Volumes/STUDY/Work/MyHome/RCTWebRTCDemo/node_modules (11ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
File /Users/byz/.android/repositories.cfg could not be loaded.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':WebRTCModule'.
> Could not resolve all dependencies for configuration ':WebRTCModule:_debugPublishCopy'.
   > Could not find com.android.support:appcompat-v7:26.1.0.
     Searched in the following locations:
         file:/Users/byz/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
         file:/Users/byz/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
         file:/Volumes/STUDY/Work/MyHome/RCTWebRTCDemo/android/sdk-manager/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
     Required by:
         RCTWebRTCDemo:WebRTCModule:unspecified > com.facebook.react:react-native:0.56.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 13.627 secs
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

操作系统:mac OS HighSierra 10.13.5

Android SDK:已安装 23.0.2 和 26。

谁能告诉我如何解决这个问题?

感谢您的关注。

【问题讨论】:

  • 显示你的 gradle 文件

标签: android macos react-native webrtc emulation


【解决方案1】:

您可能会在您的 android sdk 中错过 appcompat-v7:26.1.0。 尝试更改为 27.+。它可能会有所帮助!

【讨论】:

    猜你喜欢
    • 2016-11-29
    • 2021-12-21
    • 2017-08-08
    • 2020-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多