我已经在Flutter中构建了一个应用。在模拟和真实设备以及Iphone X和android手机上,它都可以正常工作。
上传到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.
答案 0 :(得分:0)
我遇到的所有这些失败是因为按照Flutter文档中的步骤操作时我做错了事。
最后,我找到了一个关于MTECHVIRAL的YouTube视频,仅通过他的操作,我就得到了一个可以上传的apk文件。对于遇到相同错误的其他flutterfriends,请首先尝试执行此操作。为您节省很多时间和沮丧:
https://www.youtube.com/watch?v=nGvPNG-f1-o
当心:在带有键的句子中,他打错了:1000,必须是10000。因此,复制并跳过flutter指令页面的句子。