美文网首页
React Native开发报错Task 'installDeb

React Native开发报错Task 'installDeb

作者: jinrui_w | 来源:发表于2019-04-25 10:46 被阅读0次

    场景描述:
    在配置好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

    相关文章

      网友评论

          本文标题:React Native开发报错Task 'installDeb

          本文链接:https://www.haomeiwen.com/subject/iujagqtx.html