React Native开发报错Task 'installDeb

2019-04-25  本文已影响0人  jinrui_w

场景描述:
在配置好Android自动打包后,使用Android Studio是可以正常运行的,但是使用react-native run-android运行会报错:Task 'installDebug' not found in project ':app'.

报错信息

解决办法:
使用react-native run-android --variant channel01Debug运行,channel01Debug中的channel01为配置自动打包时的其中一个渠道,例如下面的配置,安装时可以把channel01Debug替换为channel02Debug或channel20Debug等。此时,设备上安装的就是对应渠道的apk。

productFlavors {
    channel01 {
        manifestPlaceholders = [UMENG_CHANNEL_VALUE: "渠道1"]
    }
    channel02 {
        manifestPlaceholders = [UMENG_CHANNEL_VALUE: "渠道2"]
    }
    ...
    channel20 {
        manifestPlaceholders = [UMENG_CHANNEL_VALUE: "渠道20"]
    }
    ...
}

参考地址:
https://blog.csdn.net/qq_31417381/article/details/86063695

上一篇 下一篇

猜你喜欢

热点阅读