Android Plugin 3.0 构建变体输出API变化

2019-05-14  本文已影响0人  Android_Dev

变体输出

// If you use each() to iterate through the variant objects,

// you need to start using all(). That's because each() iterates

// through only the objects that already exist during configuration time—

// but those object don't exist at configuration time with the new model.

// However, all() adapts to the new model by picking up object as they are

// added during execution.

android.applicationVariants.all{ variant -> 

 variant.outputs.all{ 

 outputFileName = "${variant.name}-${variant.versionName}.apk" 

 }}

迁移到 Android Plugin for Gradle 3.0.0

上一篇下一篇

猜你喜欢

热点阅读