一些小问题都小记一下
react-native run-android的时候要求当前只运行一个模拟器或者连接真机,rn会自动把app打包进去并运行。可是有时候却出现设备连接正常,跑react-native run-android却报找不到设备的异常,报错信息:
FAILURE:Build failed with an exception.* What went wrong:
Execution failedfor task':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failedto finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.demopro signaturesdonot matchthe previously installedversion; ignoring!
* Try:
Runwith--stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILEDin5s42 actionable tasks:25 executed,17 up-to-date
Couldnot installthe apponthedevice,readtheerrorabovefordetails.
Make sure you havean Android emulator runningora device connectedand haveset 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了