首页 > 解决方案 > 在存储库容器上找不到参数 [] 的方法 google()

问题描述

环境:

 "react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-camera": "^1.1.3",
    "react-native-qrcode-scanner": "^1.0.1"

qrcodescaner 用户$ react-native run-android 扫描

/Users/Desktop/reactnativeapps/qrcodescaner/node_modules (9ms) JS 服务器中的符号链接文件夹已在运行。在设备上构建和安装应用程序(cd android && ./gradlew installDebug)...

FAILURE:构建失败并出现异常。

  • 其中:构建文件“/Users/Desktop/reactnativeapps/qrcodescaner/android/build.gradle”行:6

  • 出了什么问题:评估根项目“qrcodescaner”时出现问题。在存储库容器上找不到参数 [] 的方法 google()。

  • 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

构建失败

标签: javascriptandroidreact-native

解决方案


将react-native-camera版本降级到1.0.0并再次检查

转到 ProjectRoot\Android\gradle\wrapper\gradle-wrapper.properties,

并将 distributionUrl 值更改为:

“https://services.gradle.org/distributions/gradle-4.1-all.zip


推荐阅读