Repository navigation
Description
Steps to reproduce
There has been a report from Google:
Your app uses deprecated APIs or parameters for edge-to-edge
One or more of the APIs you use or parameters that you set for edge-to-edge and window display have been deprecated in Android 15. Your app uses the following deprecated APIs or parameters:
- android.view.Window.setDecorFitsSystemWindows
- android.view.Window.setStatusBarColor
- android.view.Window.setNavigationBarColor
- android.view.Window.setNavigationBarDividerColor
These start in the following places:
- com.google.android.material.internal.c.a
- io.flutter.embedding.android.g.I
- io.flutter.plugin.platform.d.a
- io.flutter.plugin.platform.h.C
Stacktrace/Logs
No need of stacktrace
Flutter version
Flutter 3.24.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2663184 (3 months ago) • 2024-09-11 16:27:48 -0500
Engine • revision 36335019a8
Tools • Dart 3.5.3 • DevTools 2.37.3
Expected results
There is no deprecated APIs being used
Actual results
App uses deprecated APIs or parameters for edge-to-edge
Code sample
No need of code example
Screenshots or Video
No have any video
Logs
Logs
[Paste your logs here]Flutter Doctor output
[✓] Flutter (Channel stable, 3.24.3, on macOS 13.5 22G74 darwin-arm64)
• Flutter version 3.24.3 on channel stable at /opt/homebrew/Caskroom/flutter/3.19.4/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184 (3 months ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/longnmp/Library/Android/SDK
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C65
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.1)
• 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
• android-studio-dir = /Applications/Android Studio.app
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (version 1.95.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.100.0
[✓] Connected device (7 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 15 (API 35) (emulator)
• iPhone SE (mobile) • 00008110-000E10381A00401E • ios • iOS 17.5.1 21F90
• iPhone 11 pro (mobile) • 00008030-0005251C0C7A802E • ios • iOS 17.6.1 21G93
• iPhone SE (3rd generation) (mobile) • 336316DA-DFE8-4E62-BBD6-0DFC8855C4B7 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.5 22G74 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 13.5 22G74 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.140
! Error: Browsing on the local area network for Ahn cin ❤️. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for Sally’s. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• All expected network resources are available.
• No issues found!
Activity
darshankawar commentedon Dec 16, 2024
@LNMCode
Check this migration guide to see if it helps to remove the message you get.
LNMCode commentedon Dec 17, 2024
@darshankawar
Currently, my application calls the following function in the source code:
In summary:
_initStatusBar()function to set EdgeToEdge.Are my conclusions correct? Could you please verify and confirm this for me?
Additionally, for case 3 in the list above, can I call the function:
to set the color of the navigation bar? Will it display the warning message from Google?
darshankawar commentedon Dec 17, 2024
I am not sure if you will still get the warning message or not. You may try with the changes you mentioned and see if you still get the warning or not.
LNMCode commentedon Dec 17, 2024
under3415 commentedon Jan 1, 2025
I am on latest version of flutter (3.27.1) and using below parameters
Also, using below plugins
In
main.dartI have this:And am still getting play store warnings:
Second one has this additional info:
Do I need to set StatusBar and NavigationBar color?
mivinayak commentedon Jan 2, 2025
icorradi-inco commentedon Jan 2, 2025
under3415 commentedon Jan 4, 2025
Thumb up the original post if you are experiencing the same issue. Comment if you have new info.
mauriziopinotti commentedon Jan 8, 2025
It's not just a deprecation, some of those APIs no longer work in Android 15 as per https://developer.android.com/about/versions/15/behavior-changes-15:
As a matter of fact, if you set targetSdk to 35
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: theme.themeData.primaryColor))will no longer work. With targetSdk set to 34 compatibility mode applies and the status bar color is set correctly.14 remaining items
darshankawar commentedon Feb 17, 2025
/cc @reidbaker
reidbaker commentedon Feb 18, 2025
The flutter framework will need to contain the apis you linked because we support flutter apps that target a large range of android versions. The nice thing about the apis you listed is that they are visual. If you appr looks correct on the devices you are targeting then you are fine and can ignore the warnings.
mauriziopinotti commentedon Feb 18, 2025
I don't think I fully get this response... currently, Flutter 3.29 does not look correct, see my comment here: #160328 (comment)
tl-sjmcdowall commentedon Feb 18, 2025
@mauriziopinotti -- I am glad you responded because I also don't understand the response either.
reidbaker commentedon Feb 18, 2025
@mauriziopinotti or @tl-sjmcdowall
Right now my current understanding is that there are warnings that flutter is using apis that are deprecated. We know that we are using apis that are deprecated. This is intentional because if you are using compatibility mode or targeting an older android api we want to make those calls. My understanding is also that the calls we are making do not crash or cause any other negative consequences to users of your app.
I also believe that code striping does not work across the dart to native boundary so code minimization and sripping will not remove those apis if the code paths we support are not used in your apps.
If you have an example of a flutter api that is not working please file a bug with reproduction code so we(I) can fix it.
BUT a warning that flutter contains deprecated apis is not a bug.
reidbaker commentedon Feb 18, 2025
@mauriziopinotti I see your comment and I can modify that code to not call the old apis but I can't make the apis work when they are documented to not work.
You will have to set the color in the background by coloring the widgets behind the status bar.
Filed #163545 to update our documentation but that wont fix your app.
mauriziopinotti commentedon Feb 18, 2025
Hi @reidbaker , as I said in my comment it is not only a warning: some of those APIs no longer work in Android 15 as per https://developer.android.com/about/versions/15/behavior-changes-15.
Examples of failing APIs are setStatusBarColor and R.attr#statusBarColor that are deprecated and have no effect on Android 15. As a result, if you set targetSdk to 35 SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: theme.themeData.primaryColor)) will no longer work.
My app compiled with Flutter 3.29 and targetSdk 34:
Same app, just changing targetSdk to 35:
As you can see, the status bar color is wrong.
irvine5k commentedon Feb 20, 2025
I didn't understand what's the fix to get rid of this warning when using the targetSdkVersion 34, I'm unable to publish my app into the Google Play Store.
Could you let me know if you were able to fix that? @LNMCode
PrzemyslawPluszowy commentedon Mar 5, 2025
I have the same problem. How to set a custom color for navigation and change it dynamically based on the system theme? Is there any documentation on this?
By the way, I recently found a similar issue in a post where it was used in a new widget, and it also caused problems there. #164134
@reidbaker @darshankawar
This is bug
jonasbernardo commentedon Mar 9, 2025
@reidbaker
@darshankawar
These warnings are appearing in Google Play's Android Vitals, and this has impacted my app being featured by Google, it has reduced the discovery of my app because Google recommends apps that follow the recommendations, this warning is having a big impact for those who have apps on Google Play
darshankawar commentedon Mar 10, 2025
Please go through this
github-actions commentedon Mar 24, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.