【问题标题】:Android: Dynamic dependency addition in gradle using pluginAndroid:使用插件在gradle中添加动态依赖项
【发布时间】:2017-07-11 09:16:21
【问题描述】:

是否可以根据所用设备的配置在android项目中动态添加依赖项,我可以在gradle插件中添加这个脚本吗?

【问题讨论】:

  • 你找到解决办法了吗?

标签: android android-studio android-gradle-plugin gradle-plugin


【解决方案1】:

怎么样:

if(myconfig=="device one"){
    dependencies.compile 'com.example.android:example:1.0.10'
} else {
    dependencies.compile 'com.example.android:example:1.0.9'
}

【讨论】:

    猜你喜欢
    • 2017-06-02
    • 2015-12-21
    • 2021-01-07
    • 1970-01-01
    • 1970-01-01
    • 2013-03-15
    • 1970-01-01
    • 2016-03-22
    • 1970-01-01
    相关资源
    最近更新 更多