Square Reader SDK Demo (React Native / Mac) - 错误:spawn ./gradlew ENOENT

问题描述

我使用以下软件版本:

(Mac OS Big Sur)
react-native-cli: 2.0.1
react-native: 0.64.1
yarn: 1.22.10
android-sdk: 29.0.3
javac: 16.0.2

我正在尝试从 https://github.com/square/react-native-square-reader-sdk/tree/master/reader-sdk-react-native-quickstart 运行演示。所有文件都与此演示中的文件几乎相同(唯一的区别是建议使用我的凭据插入 gradle.properties 中的新行)。

我成功传递了 npx @react-native-community/cli doctor 命令(我设置了 ANDROID_HOME我有正确的 JDK 和 Android SDK 等......)。我目前正在使用外部 Android 设备测试我的软件。

当我在主目录中运行 react-native run-android 时,这是我的回溯:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:6673) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Jetifier found 903 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: spawn ./gradlew ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:480:16)
    at processticksAndRejections (node:internal/process/task_queues:83:21)
info Run CLI with --verbose flag for more details.

我的 gradew.bat 目录中有 /android,这令人困惑,因为它似乎是大多数“gradlew”问题的来源。

React Native Error: spawn gradlew.bat ENOENT解决方案不起作用,因为 tns install 产生以下输出

No project found at or above '/Users/myuser/Documents/GitHub/react-native-square-reader-sdk' and neither was a --path specified.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)