react-native run-android报错没有找到设备 Make sure you have an Android emulator running or a device connecte

一些小问题都小记一下
react-native run-android的时候要求当前只运行一个模拟器或者连接真机,rn会自动把app打包进去并运行。可是有时候却出现设备连接正常,跑react-native run-android却报找不到设备的异常,报错信息:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.demopro signatures do not match the previously installed version; ignoring!

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 5s
42 actionable tasks: 25 executed, 17 up-to-date
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

adb devices命令也可以正常显示出连接ok的设备,真是头大。仔细一看问题在这儿:

: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.demopro signatures do not match the previously installed version; ignoring!

当前安装的app和之前的版本不匹配。。具体怎么回事也不清楚,,把模拟器上的版本卸载掉,在运行就OK了

猜你喜欢

转载自blog.csdn.net/lqx_sunhan/article/details/82597421
今日推荐