美文网首页
API 'variantOutput.getPackageApp

API 'variantOutput.getPackageApp

作者: Everglow_111 | 来源:发表于2019-08-17 15:44 被阅读0次

更新至Android Studio 3.3 gradle 4.10.1,烦人的提示

WARNING: API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getPackageApplication(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app

修改前

    android.applicationVariants.all { variant ->
        variant.outputs.all { output ->
            def outputFile = output.outputFile
            if (outputFile != null && outputFile.name.endsWith('.apk')) {
                outputFileName = "亚博在线客服" + "-v" + defaultConfig.versionName  + ".apk"
            }
        }

修改后

    android.applicationVariants.all { variant ->
         variant.outputs.all {
             outputFileName = "亚博在线客服-v${variant.versionName}.apk"
         }
    }

这样就不会有提示了!

相关文章

网友评论

      本文标题:API 'variantOutput.getPackageApp

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