【问题标题】:API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'API 'variant.getJavaCompile()' 已过时,已替换为 'variant.getJavaCompileProvider()'
【发布时间】:2019-12-11 19:23:52
【问题描述】:

我已经在 Flutter 中构建了一个应用程序。它在模拟和真实设备以及 Iphone X 和安卓手机上运行良好。

上传到 Apple 应用商店很顺利,但我没有为 Google Play 商店构建它。

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

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

在 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.

【问题讨论】:

  • 此链接对您有帮助:stackoverflow.com/questions/52470044/…>
  • 我见过这个。同样的问题,很多解决方案我使用哪一个以及如何使用? ??????

标签: android flutter build google-play


【解决方案1】:

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

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

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

注意:在带有 key 的句子中,他打错了:1000 必须是 10000。所以复制并粘贴颤振指令页面的句子。

【讨论】:

    猜你喜欢
    • 2019-11-23
    • 2019-06-15
    • 1970-01-01
    • 2019-09-28
    • 1970-01-01
    • 1970-01-01
    • 2019-02-23
    • 2019-11-12
    相关资源
    最近更新 更多