API 'variant.getJavaCompile()' 已过时并已替换为 'variant.getJavaCompileProvider()'

API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'

我已经在 Flutter 中构建了一个应用程序。它在模拟和真实设备以及 Iphone X 和 android phone.

上运行良好

上传到 Apples appstore 很顺利,但我没有为 Google play store 构建它。

每次我都失败了好几次,现在我没牌了。我只是不明白代码在说什么以及我必须做什么。

(作为一个初学者,我也很惊讶你制作一个可以上传的文件的困难方法和很多步骤。我发现它比编程更难。我希望他们能让这更容易,例如在模拟器上是 运行,将其作为构建文件。)

运行 它在 Android。按照 fluttersite 上的步骤操作。

* Error running Gradle:
  abnormally:
  Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :app
WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with
'variant.getJavaCompileProvider()'.
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 variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command
line to display more information.
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with
'variant.getMergeAssetsProvider()'.
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 variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command
line to display more information.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with
'variantOutput.getProcessResourcesProvider()'.
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.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the
command line to display more information.
     *********************************************************
WARNING: This version of shared_preferences will break your Android build if it or its dependencies aren't
compatible with AndroidX.
     See (had to remove this url) for more information on the problem and how to fix it.
     This warning prints for all Android build failures. The real root cause of the error may be
     unrelated.
     *********************************************************

Please review your Gradle project setup in the android/ folder.

我所有的失败都是因为我按照 Flutter 文档中的步骤做错了。

最后我找到了 MTECHVIRAL 的 YouTube 视频,按照他的做法,我得到了一个可以上传的 apk 文件。其他出现同样错误的flutterfriends,先试试这个吧。为您节省大量时间和挫折:

https://www.youtube.com/watch?v=nGvPNG-f1-o

注意:在带钥匙的句子中,他打错了:1000,必须是 10000。所以复制并粘贴 flutter 说明页面的句子。