该应用程序使用Android工作室与Ubuntu一起运行,它也在我的Windows 10上使用react-native运行。
使用react-native init创建的新应用程序可以正常运行ubuntu
但是我当前应用程序上的react-native run-android总是返回:
Running /home/lance/Android/Sdk/platform-tools/
adb -s 4d00550ff22a318d reverse tcp:8081 tcp:8081
adb server version (32) doesn't match this client (36); killing...
* daemon started successfully *
Building and installing the app on the device (cd android && ./gradlew installDebug)...
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/android-setup.html
(node:5781) UnhandledPromiseRejectionWarning:
Unhandled promise rejection (rejection id: 2):
TypeError: Cannot read property 'message' of undefined
(node:5781) DeprecationWarning: Unhandled promise rejections are deprecated.
In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.
欢迎任何帮助。
答案 0 :(得分:2)
通过向gradelew添加执行权限来修复。
在终端中,在react-native项目文件夹中,运行
chmod +x android/gradlew