我目前在Flutter 2.6.0-12.0.pre.406版本的主通道中,每次运行应用程序时,我都会在控制台中收到这些奇怪的消息,我只想知道它们的原因和含义,以及我是否可以忽略它们。当我新创建一个应用程序并在不编辑任何内容的情况下运行它时,这种情况甚至会发生。所以,即使我在运行示例应用程序。
这是输出:
Launching libmain.dart on ... in debug mode...
Running Gradle task 'assembleDebug'... 7,0s
√ Built buildappoutputsflutter-apkapp-debug.apk.
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
Syncing files to device ... 98ms
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
Flutter run key commands.
r Hot reload.
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
Running with sound null safety
An Observatory debugger and profiler on ... is available at: http://127.0.0.1:59402/M3bn7N7nUow=/
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/Gralloc4(25682): mapper 4.x is not supported
W/Gralloc3(25682): mapper 3.x is not supported
I/gralloc (25682): Arm Module v1.0
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@ba09739 isViewVisible: true
The Flutter DevTools debugger and profiler onv... is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:59402/M3bn7N7nUow=/
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] pd() Asnyc report
I/SurfaceView(25682): setParentSpaceRectangle: useBLAST = false position = Rect(0, 0 - 1440, 3020) frameNumber = 1 t = android.view.SurfaceControl$Transaction@89f17e
I/SurfaceView(25682): applySurfaceTransforms: t = android.view.SurfaceControl$Transaction@89f17e surfaceControl = Surface(name=SurfaceView - com.example.randomdice2/com.example.randomdice2.MainActivity@761f583@0)/@0x7c466df frame = 1
I/SurfaceView(25682): applySurfaceTransforms: postScaleX = 1.0 postScaleY = 1.0
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4668 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938
I/ViewRootImpl@963f43d[MainActivity](25682): [DP] rdf()
当我将Firebase集成到我的flutter应用程序中时,我也遇到了同样的错误。这可能不是这个错误的合法解决方案,但以下是我所做的。
- 将
minSdkVersion
升级为24(ANDROID/APP/build.gradle(
通常firebase需要我们将SDK升级到19。出于测试目的,我将其更改为更高版本的SDK(在本例中为24(。
- 清洁&构建渐变
然后我用以下cmds清理了我们的android gradle文件;
cd android
->如果你是flutter项目的核心./gradlew clean
->清洁坡面环境./gradlew build
->在清洁的环境中重建
- 在颤振环境中清洁并运行
cd ..
->返回根flutter clean
->清理颤振工作区flutter pub get
->获取已删除的包和依赖项flutter run
->运行应用程序
我希望这能帮助到别人,正如我所说,这不是一个合法的解决方案,但这对我来说是有效的。如果失败了。还可以考虑通过检查JAVA和Gradle SDK版本的兼容性;
cd android
->回到android项目java --version
->检查java版本./gradlew --version
->检查渐变版本。使用上面的命令,您可以在此处检查兼容性
将这些行添加到AndroidManifest.xml文件中为我解决了这个问题:
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />
但Run控制台上出现警告:
W/FlutterActivityAndFragmentDelegate(21657): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
我已经解决了这个问题。如果你使用的是flaft_splash_screen包,你应该删除这个包并更新AndroidManifest.xml和styles.xml.