我对 Flutter 比较陌生,收到以下错误消息。
错误信息:
The following assertion was thrown while applying parent data.:
Incorrect use of ParentDataWidget.
The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept ParentData of incompatible type ParentData.
Usually, this means that the Expanded widget has the wrong ancestor RenderObjectWidget. Typically, Expanded widgets are placed directly inside Flex widgets.
The offending Expanded is currently placed inside a SizedBox widget.
Run Code Online (Sandbox Code Playgroud)
以下是我认为错误所在的代码:
Material(
elevation: 2,
color: Colors.white70, …Run Code Online (Sandbox Code Playgroud) 我对 Flutter 比较陌生,该项目 2 天前就开始工作了。当我今天尝试运行它时,遇到了这个错误。这是我面临的错误。
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.android.gms:play-services-measurement-base:[18.0.0].
Required by:
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement:18.0.0
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement-api:18.0.0
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement-sdk:18.0.0
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement:18.0.0 > com.google.android.gms:play-services-measurement-impl:18.0.0
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement-api:18.0.0 > com.google.android.gms:play-services-measurement-sdk-api:18.0.0
> Failed to list versions for …Run Code Online (Sandbox Code Playgroud)