美文网首页
android studio 3.0 重命名打包apk

android studio 3.0 重命名打包apk

作者: PokerMman181 | 来源:发表于2017-08-18 14:51 被阅读0次

    API change in variant output

    Using the Variant API to manipulate variant outputs is broken with the new plugin. It still works for simple tasks, such as changing the APK name during build time, as shown below:

    // 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 studio 3.0 重命名打包apk

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