Closed intercretasyo closed 2 years ago
Same, how does one solve this?
I am also having the same problem.
@intercretasyo @SeriousMonk @puze can you provide more information?
@SeriousMonk @puze can you add your Flutter Doctor output?
Is the problem on Android 11? Are the error message happening when you run your app after having previously added the splash screen? Do the errors happen during the splash screen or after the app loads?
I am not able to reproduce these errors. Can you supply me with a means to reproduce the errors?
Hello all, I have replicated this error.
First, create a new Flutter project and import the flutter_native_splash library. When you build and run the app, in the log, you will find this warning:
W/FlutterActivityAndFragmentDelegate(27508): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
So, remove the deprecated code, as shown in the guide..
when you build and run the app, you will find these errors:
I/ViewRootImpl@5d03b84MainActivity: [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@3d78bf0 isViewVisible: true
.. tadaaan :)
For now, I've decided to ignore the deprecation warning and place this code, inside the manifest.
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
@jonbhanson Could you please let us know how to resolve the issue?
Than you, Carlo.
Thanks for the instructions, @CarloDotLog, but unfortunately I still cannot reproduce the problem. Here is what I did:
pubspec.yaml
, add flutter_native_splash: ^1.3.0
under dev_dependencies
pubspec.yaml
, add:
flutter_native_splash:
color: "#42a5f5"
flutter pub get
flutter pub run flutter_native_splash:create
android/app/src/main/AndroidManifest.xml
:
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
Launching lib/main.dart on Pixel 2 XL in debug mode...
Running Gradle task 'assembleDebug'...
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk...
Debug service listening on ws://127.0.0.1:54428/OJvx2wnmt4o=/ws
Syncing files to device Pixel 2 XL...
I/Gralloc4(17407): mapper 4.x is not supported
W/Gralloc3(17407): mapper 3.x is not supported
I don't see the error that you are seeing. Are these the same steps that you took to reproduce this error? Please include your flutter doctor -v
output
Thank you for your reply @jonbhanson.
I confirm that if I retry the steps, I enable/disable the errors.
Without this code in the manifest file
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
I have the errors and a long time white screen.
I've tested on Pixel 4 (Emulator) with Android 11 and a SM A405FN (device) with Android 11 and I had the same errors.
There is my flutter doctor -v output:
Is anyone still experiencing this problem? It seems there was a rash of these in October, and then no more. Maybe it was related to a Flutter update that had a problem and was subsequently patched?
Closed due to inactivity. Feel free to reopen if you are still having a problem.
@jonbhanson I can confirm, that I see these messages now with my app Encrateia that I am currently updating, after having removed meta-data as above from the Android.manifest.
I am developing using flutter installed via snap within Ubuntu;
flutter doctor -v
outputs:
flutter doctor -v
[✓] Flutter (Channel stable, 2.10.1, on Ubuntu 20.04.4 LTS 5.4.0-104-generic, locale en_US.UTF-8)
• Flutter version 2.10.1 at /home/stefan/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision db747aa133 (4 weeks ago), 2022-02-09 13:57:35 -0600
• Engine revision ab46186b24
• Dart version 2.16.1
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
• Android SDK at /home/stefan/Android/Sdk
• Platform android-32, build-tools 33.0.0-rc1
• ANDROID_HOME = /home/stefan/Android/Sdk
• Java binary at: /snap/android-studio/119/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /snap/android-studio/119/android-studio
• Flutter plugin version 65.2.2
• Dart plugin version 211.7808
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[✓] VS Code (version 1.65.1)
• VS Code at /usr/share/code
• Flutter extension version 3.36.0
[✓] Connected device (2 available)
• SM T510 (mobile) • R52MC17S20J • android-arm • Android 11 (API 30)
• Chrome (web) • chrome • web-javascript • Google Chrome 99.0.4844.51
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Edit: found open issue in the flutter repo for this. Sorry for the noise.
Facing the same issue on Samsung M31, API31. The issue isn't reproducible on pixel devices. Reading the comments above, adding the deprecated metadata to AndroidManifest.xml manually shows a deprecation warning
W/FlutterActivityAndFragmentDelegate( 1202): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
and removes the message
I/ViewRootImpl@3aca0baMainActivity: [DP] cancelDraw null isViewVisible: true
Describe the bug More than a hundred of these lines are found: I/ViewRootImpl@50e8af1MainActivity: [DP] cancelDraw io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$2@5fb73dc isViewVisible: true
Device (please complete the following information):
Flutter doctor [✓] Flutter (Channel stable, 2.5.1, on macOS 11.5.2 20G95 darwin-x64, locale en-US) • Flutter version 2.5.1 at /Users/myPC/Developer/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ffb2ecea52 (10 days ago), 2021-09-17 15:26:33 -0400 • Engine revision b3af521a05 • Dart version 2.14.2
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/myPC/Library/Android/sdk • Platform android-31, build-tools 31.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 13.0, Build version 13A233 • CocoaPods version 1.10.2
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] Connected device (2 available) • SM G970F (mobile) • RF8M620YCCW • android-arm64 • Android 11 (API 30) • Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82
• No issues found!
Additional context When I removed this code, the issue is happening. <meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background" />