android - 我无法在 mac os 的 android 模拟器上运行 react-native-webrtc-demo

标签 android macos react-native webrtc emulation

我将在移动应用程序上实时显示 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

Operating System: mac OS HighSierra 10.13.5

Android SDK: 23.0.2 & 26 installed.

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

感谢您的关注。

最佳答案

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

关于android - 我无法在 mac os 的 android 模拟器上运行 react-native-webrtc-demo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51743320/

相关文章:

macos - 使用 sudo 运行时无法连接到 Docker 守护程序

swift - HTTP Get API调用总是失败 "NSLocalizedDescription=A server with the specified hostname could not be found"

javascript - 如何在 json 请求中放置变量

java - 通过 setOnItemClickListener 获取与该列表项关联的数据

android使 View 包装内容但不大于特定大小

Android 从内部存储播放资源文件导致 MediaPlayer.prepare 给出 IOException

macos - 在 Windows 上使用 Tycho 构建的 Eclipse RCP 应用程序的 Mac 分发无法启动

android - 当用户打开抽屉时调用函数(onClick 按钮或幻灯片)

android - 使用 React Native 从 url 共享文件

java - Android:JsonObjectRequest 内的媒体播放器