我正在使用以下软件版本:
(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.