flutter android 无法运行的情况

flluter 部分控件支持安卓X后,在安卓手机上无法运行。AS单独打开 android项目,产生以下提示。

Warn

WARNING:API'variantOutput.getPackageApplication()'is obsoleteandhas been replaced with'variant.getPackageApplicationProvider()'.It will be removed at theendof2019.For more information, seehttps://d.android.com/r/tools/task-configuration-avoidance.To determine what is calling variantOutput.getPackageApplication(), use -Pandroid.debug.obsoleteApi=trueon the command line to display a stack trace.AffectedModules:app

警告信息说 APIvariantoutput.getPackageApplication()已过时,并且已被替换为variant.getPackageApplicationProvider(),将于2019年底移除。尽管如此,我们还是不知道具体哪个地方的方法过时了,根据后面提示在gradle.properties中配置android.debug.obsoleteApi=true来查看详细的调试信息:

WARNING:API'variantOutput.getPackageApplication()'is obsoleteandhas been replaced with'variant.getPackageApplicationProvider()'.It will be removed at theendof2019.For more information, seehttps://d.android.com/r/tools/task-configuration-avoidance.REASON:Calledfrom:E:\MyApp\app\flutter.gradle:422WARNING:Debugging obsolete API calls can take time during configuration. It's recommended to not keep it on at all times.

Affected Modules: app

虽然乍看和之前的日志差不多,但是这次却明确告诉我们过时方法的具体位置:flutter sdk\flutter.gradle:422。getPackageApplication()这里引用了过时方法。


flutter.gradle

注释掉422行即可,看判断,基本不影响目前的情况,后期修复可能会发生变化。

你可能感兴趣的:(flutter android 无法运行的情况)