text:
Cannot find bundled Java version on AS 2022.1.1.x (Electric Eel)

Thanks for the feedback! If your issue is related to the Flutter framework itself,
please open an issue at
github.com/flutter/flutter.
Steps to Reproduce
Was redirected here to file an issue when using AS Chipmunk and running flutter doctor which complaints about missing bundled Java version in AS Electric Eel. See issue: https://issuetracker.google.com/237019251
Referencing it here:
Build: AI-212.5712.43.2112.8609683, 202205181650,
AI-212.5712.43.2112.8609683, JRE 11.0.12+7-b1504.28-7817840x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 1920.0x1080.0, 1920.0x1080.0, 1920.0x1080.0, 768.0x1366.0
AS: Chipmunk | 2021.2.1 Patch 1; Kotlin plugin: 212-1.7.0-release-281-AS5457.46; Android Gradle Plugin: (plugin information not found); Gradle: (gradle version information not found); Gradle JDK: version 11.0.12; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
IMPORTANT: Please read https://developer.android.com/studio/report-bugs.html carefully and supply all required information.
Is this a known issue that AS Electic Eel don't provide known bundled java location when using it with Flutter 3.1 (beta) ? (seen from ChipMunk flutter doctor).
May this be related to same foundation problem discovered in AS EE after ugrade to AS EE C4 (or C5): https://issuetracker.google.com/issues/236055498
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 3.1.0-9.0.pre, on Microsoft Windows [Version 10.0.22000.739], locale nb-NO)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.3)
[√] Android Studio (version 2020.3)
[√] Android Studio (version 2021.1)
[√] Android Studio (version 2021.2)
[√] Android Studio (version 2021.1)
[√] Android Studio (version 2021.2)
[√] Android Studio (version 2021.3)
[!] Android Studio (version 2022.1)
    X Unable to find bundled Java version.
[√] Connected device (4 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.

Version info
PS C:\FlutterProjects\mwork> flutter doctor -v
[√] Flutter (Channel beta, 3.1.0-9.0.pre, on Microsoft Windows [Version 10.0.22000.739], locale nb-NO)
    • Flutter version 3.1.0-9.0.pre at c:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f28e570c8c (10 days ago), 2022-06-14 13:39:33 -0500
    • Engine revision 74ee6b5afd
    • Dart version 2.18.0 (build 2.18.0-165.1.beta)
    • DevTools version 2.14.0

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\roarg\AppData\Local\Android\Sdk
    • Platform android-TiramisuPrivacySandbox, build-tools 33.0.0
    • ANDROID_HOME = C:\Users\roarg\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android Studio\Android Studio 2021.3.1.13\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31702.278
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2020.3.1.26
    • 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-7249189)

[√] Android Studio (version 2021.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2021.1.1.23
    • 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.11+9-b60-7590822)

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2021.2.1.15
    • 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.12+7-b1504.28-7817840)

[√] Android Studio (version 2020.3_new)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2020.3.1.4
    • 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.8+10-b944.6842174)

[√] Android Studio (version 2021.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2021.1.1.13
    • 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.11+9-b60-7590822)

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2021.2.1.11
    • 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.12+7-b1504.28-7817840)

[√] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2021.3.1.13
    • 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.13+0-b1751.21-8125866)

[!] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android Studio\Android Studio 2022.1.1.5
    • 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
    X Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[√] Connected device (4 available)
    • SM T515 (mobile)  • R52NB09L7ZP • android-arm    • Android 11 (API 30)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.22000.739]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 103.0.5060.53
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 102.0.1245.39

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Please paste the output of running flutter doctor -v here (available from the command
line or from Tools > Flutter > Flutter Doctor). It will provide the version of the
Flutter framework as well as of the IntelliJ plugin.

Hi @RoarGronmo, thanks for filing the issue
Could you please try these solutions to see if this issue still reproduces?
https://stackoverflow.com/a/67999421
https://stackoverflow.com/a/51286951

@RoarGronmo
Android Studio Electric Eel | 2022.1.1 is still in Canary. And there is similar old issue that has been filed before due to the Preview version of Android Studio. So, please use the stable version until this gets resolved.
I also confirm that the issue is reproducible on the latest stable and master channels after install new Android Studio Electric Eel on Windows and Mac machines.

flutter doctor -v (Windows)
[√] Flutter (Channel stable, 3.0.3, on Microsoft Windows [Version 10.0.19043.1766], locale en-US)
    • Flutter version 3.0.3 at C:\WIP\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 676cefaaff (6 days ago), 2022-06-22 11:34:49 -0700
    • Engine revision ffe7b86a1e
    • Dart version 2.17.5
    • DevTools version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at C:\AndroidSDK
    • Platform android-32, build-tools 32.0.0
    • ANDROID_HOME = C:\AndroidSDK
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.5)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32616.157
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.12+7-b1504.28-7817840)

[!] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio Electric Eel 2022.1.1
    • 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
    X Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[√] VS Code (version 1.68.1)
    • VS Code at C:\Users\ADMIN\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.42.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19043.1766]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 102.0.5005.115
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 101.0.1210.53

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

flutter doctor -v (Mac)
[✓] Flutter (Channel stable, 3.0.3, on macOS 12.2.1 21D62 darwin-x64, locale en-VN)
    • Flutter version 3.0.3 at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 676cefaaff (6 days ago), 2022-06-22 11:34:49 -0700
    • Engine revision ffe7b86a1e
    • Dart version 2.17.5
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[!] Android Studio
    • Android Studio at /Users/huynq/Downloads/Android Studio Preview.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Community Edition (version 2020.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • 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

[✓] VS Code (version 1.68.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.42.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 103.0.5060.53

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Labeling this issue for further support/investigation.

Will just mention (as you may be aware of) that the same problem exists for AS Flamingo, at least for Canary 3.

I am using:
Android Studio Electric Eel | 2022.1.1 Beta 2
Build #AI-221.6008.13.2211.9113387, built on September 27, 2022
Runtime version: 11.0.15+0-b2043.56-8887301 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.0.0-1-default
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 8
Registry:
    external.system.auto.import.disabled=true
    ide.text.editor.with.preview.show.floating.toolbar=false

Non-Bundled Plugins:
    Dart (221.6008.17)
    io.flutter (70.2.4)

Current Desktop: GNOME

My flutter doctor -v returns:
[✓] Flutter (Channel stable, 3.3.4, on openSUSE Tumbleweed 6.0.0-1-default,
    locale en_US.UTF-8)
    • Flutter version 3.3.4 on channel stable at
      /home/archerallstars/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision eb6d86ee27 (4 days ago), 2022-10-04 22:31:45 -0700
    • Engine revision c08d7d5efc
    • Dart version 2.18.2
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /home/archerallstars/Android/Sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /usr/lib64/jvm/jre-openjdk/bin/java
    • Java version OpenJDK Runtime Environment (IcedTea 3.24.0) (build
      1.8.0_345-b01 suse-2.2-x86_64)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
    • cmake version 3.10.2
    • ninja version 1.8.2
    • pkg-config version 0.29.1

[!] Android Studio (version 2022.1)
    • Android Studio at /home/archerallstars/android-studio
    • Flutter plugin version 70.2.4
    • Dart plugin version 221.6008.17
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • openSUSE Tumbleweed
      6.0.0-1-default
    • Chrome (web)    • chrome • web-javascript • Google Chrome 106.0.5249.103

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Coming here from #113775. This issue may be caused by the fact that newer versions of Android Studio come with JBR as a bundled Java version. If Flutter Tools included the directory jbr/Contents/Home to look in, this issues could be (at least partially) fixed.

As a workaround I have just created a symbolic link.
# ln -s  TARGET              LINK_NAME
ln -s /usr/lib/jvm/java-17 $USER/.local/lib/android-studio/jre

Replace TARGET /usr/lib/jvm/java-17 with the location of your JDK home.
Replace LINK_NAME $USER/.local/lib/android-studio with the location of your Android Studio

@justintime4tea How to solve this problem under windows11：
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.3.8, on Microsoft Windows [版本 10.0.22000.1219], locale zh-CN)
• Flutter version 3.3.8 on channel stable at D:\Program_Files\scoop\apps\flutter\current
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 52b3dc25f6 (2 weeks ago), 2022-11-09 12:09:26 +0800
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at D:\Program_Files\scoop\apps\android-sdk\current
• Platform android-TiramisuPrivacySandbox, build-tools 33.0.1
• ANDROID_HOME = D:\Program_Files\scoop\apps\android-sdk\current
• Java binary at: D:\Program_Files\scoop\apps\openjdk17\current\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.2+8-86)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.1)
• Visual Studio at D:\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.4.33110.190
• Windows 10 SDK version 10.0.22000.0
[!] Android Studio (version 2022.2)
• Android Studio at D:\Program_Files\scoop\apps\android-studio-canary\current
• 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
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2)
• IntelliJ at D:\Program Files\JetBrains\IntelliJ IDEA 2021.2
• 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
[✓] Proxy Configuration
• HTTP_PROXY is set
• NO_PROXY is 127.0.0.1;localhost;::1
• NO_PROXY contains localhost
• NO_PROXY contains ::1
• NO_PROXY contains 127.0.0.1
[✓] Connected device (2 available)
• Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.22000.1219]
• Chrome (web)      • chrome  • web-javascript • Google Chrome 107.0.5304.107
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.

@git136975643 try creating a symbolic link within your android Studio directory with the name "jre" with the target being your java JDK directory.
From the look of your logs, maybe this will work? (PowerShell)
New-Item -ItemType SymbolicLink -Path "D:\Program_Files\scoop\apps\openjdk17\current\bin\java" -Target "D:\Program_Files\scoop\apps\android-studio-canary\current\jre"

Afterwards try running flutter doctor again.
This is essentially the Windows equivalent to my previous comment.

For windows 11 this worked for me.
From within the android-studio folder
New-Item -ItemType SymbolicLink -Path .\jre -Target .\jbr

For MacBook:
change directory to the forder:  "Android Studio.app/Contents"
then
ln -s jbr jre

For windows 11 this worked for me. From within the android-studio folder
New-Item -ItemType SymbolicLink -Path .\jre -Target .\jbr

Just upgraded to Electic Eel now and having the same issue on Win10.
I deleted the old (mostly empty) /jre folder and added the Symlink.
Now all is working again.

For MacBook M1:
Step 1: Change directory to the subdirectory (Contents) of the Android Studio forder:

Android Studio.app/Contents

Step 2: Create a symbolic link named jre and point it to jbr:
ln -s jbr jre

This worked for me on Ubuntu 22.04.1 LTS, so this instruction is not just for Mac.

Good to know this method works here too.

I have this in windows 10.
How do I solve it?

I have this in windows 10. How do I solve it?

Someone upstairs mentioned the method applicable to Windows 10:
https://github.com/flutter/flutter/issues/106674#issuecomment-1381556535:~:text=Just upgraded to Electic Eel now and having the same issue on Win10.
I deleted the old (mostly empty) /jre folder and added the Symlink.
Now all is working again.

I have this in windows 10. How do I solve it?

Someone upstairs mentioned the method applicable to Windows 10:
#106674 (comment).

How can  added the Symlink in windows

on Win10.

https://www.google.com/search?q=windows+10+power+shell+command+symbolic+link&rlz=1C5CHFA_enTW943TW943&ei=gznBY6_ZIsyGoATl04KIBw&ved=0ahUKEwjvpt_-scT8AhVMA4gKHeWpAHEQ4dUDCA8&uact=5&oq=windows+10+power+shell+command+symbolic+link&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQAzIFCAAQogQyBQgAEKIEMgUIABCiBDIHCAAQHhCiBDoKCAAQRxDWBBCwAzoKCCEQoAEQwwQQCkoECEEYAEoECEYYAFDDCljbD2CvHWgBcAF4AIABZ4gB5wGSAQMyLjGYAQCgAQHIAQrAAQE&sclient=gws-wiz-serp

For Windows
Go To android studio directory (Default C:\Program Files\Android\Android Studio)
remove jre folder
run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink .\jre .\jbr

Now all is working again.

remove jre folder

Will this cause any issues down the line somewhere?

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

Now all is working again.

May God's face shine upon you. This did it! I'm now on my way to fun with Flutter.

Good to know this approach works here too.
I think this works on all Unix-like systems - use the same shell command.
Step 1: Change directory to the subdirectory (Contents) of the Android Studio forder:

Android Studio.app/Contents

Step 2: Create a symbolic link named jre and point it to jbr:
ln -s jbr jre

Working like a charm! Thank you.

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

Now all is working again.

May God's face shine upon you. This did it! I'm now on my way to fun with Flutter.

Neverrrrr updating my android studio again :)

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

Now all is working again.

love you

Quite surprised to have to make a symbolic link on windows in order to make things work. But I am afraid this workaround  itself will become a issue once the real 'issue' is fixed in a future version.

Good to know this approach works here too.
I think this works on all Unix-like systems - use the same shell command.
Step 1: Change directory to the subdirectory (Contents) of the Android Studio forder:

Android Studio.app/Contents

Step 2: Create a symbolic link named jre and point it to jbr:
ln -s jbr jre

How am I going to change the directory to the subdirectory in terminal I didn't understand? :(

For MacBook M1:
Step 1: Change directory to the subdirectory (Contents) of the Android Studio forder:

Android Studio.app/Contents

Step 2: Create a symbolic link named jre and point it to jbr:
ln -s jbr jre

Thank you man. This was a really annoying one!

Hey there!!!!
I can't find the subdirectory (Contents ) of the android-studio folder
what should I do

Simply go to Applications on finder Right Click Android Studio. Select "Show package contents". And then right click "Contents" and select "New Terminal Folder". Once the terminal opens just copy paste this line and press enter ln -s jbr jre . This worked for me.

Simply go to Applications on finder Right Click Android Studio. Select "Show package contents". And then right click "Contents" and select "New Terminal Folder". Once the terminal opens just copy paste this line and press enter ln -s jbr jre . This worked for me.

The problem is that i do not have an Application folder

If you are using a Mac it's impossible it should be at your sidebar when you click finder. If it's not their edit your sidebar.

If you are using a Mac it's impossible it should be at your sidebar when you click finder. If it's not there edit your sidebar.

Nope, actually I am using ubuntu

finally solved this problem?

Please follow this command and Steps
Step 1
Commands to run in terminal:

cd /Applications/Android\ Studio.app/Contents/jbr
ln -s ../jbr jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

Step 2
Then go to  application/Android studio

right click and show package contents
contents-then create new folder called jre
copy contents of the jbr folder and paste into jre folder

Step 3
Restart you mac and run command on terminal
Flutter doctor -v

Just create a link
cd ~/android-studio/ && ln -s jbr jre

i couldn't find any android-studio/applications/subdirectory (Contents ) in my system. there's only an Android and .android folder that exists but no subdirectory (contents) or applications dir inside them.

I opened and answered a question in SO to link this bug in Electric Eel and confirmed this to work with macOS Ventura in Apple M1 after Android Studio was upgraded with Brew.

On LINUX OS
cd /opt/android-studio
then
ln -s jbr jre

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

Now all is working again.

Y love You

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

Now all is working again.

thank you so much, god bless you

this works for me On the M1 chip.
1- Create folder "/Applications/Android Studio.app/Contents/jre"
2- Copy all contents inside  "/Applications/Android Studio.app/Contents/jbr"
3- Past in "/Applications/Android Studio.app/Contents/jre"
run flutter doctor
NOTE: maybe creating Symbolic Links will work too I have not tried that.

Keep in mind you actually have to copy jbr/* into jre/*. I was lazy and tried to symlink instead, but that won't work.

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

Thank you so much it's working now.

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

Now all is working again.

Thank you

On windows however I fixed it another way:
I had to go to C:\Program Files\Android\Android Studio.
There is already jre folder in there, but it contained signle empty file.
Remove jre folder.
Create a copy of jbr folder.
Rename the copy to jre.

Tested Android Studio Flamingo | 2022.2.1 Canary 11
It has same issue.
Noticed that its possible to override the bundled java.

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

Now all is working again.

Tried this but it's showing system can not find path specified

For Win10, is that the best way  thank you for help

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator
cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

Now all is working again.

Y love You

For windows 11 this worked for me. From within the android-studio folder
New-Item -ItemType SymbolicLink -Path .\jre -Target .\jbr

Works also with win 10, you need just to remove the jre empty folder before.

For MacBook M1:
Step 1: Change directory to the subdirectory (Contents) of the Android Studio forder:

Android Studio.app/Contents

Step 2: Create a symbolic link named jre and point it to jbr:
ln -s jbr jre

works for me

In Electric Eel, I copied all the folders from C:\Program Files\Android\Android Studio\jbr and pasted it in  C:\Program Files\Android\Android Studio\jre. It worked.

Simply deleting the jre folder seems to have fixed it for me on Windows 11. Did not symlink or copy anything over.

If you installed Android Studio via the JetBrains Toolbox on a Mac then Android Studio might be installed in
/Users/Batman/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/Android Studio.app/Contents

To run the following command in this directory, make sure that you give the terminal that you are using "Full Disk Access" under "Privacy & Security" of the System Settings:
ln -s jbr jre

https://issuetracker.google.com/issues/237019251#comment2

this work for me on mac pro M2
Step 1
Commands to run in terminal:

cd /Applications/Android\ Studio.app/Contents/jbr
ln -s ../jbr jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

Step 2
Then go to  application/Android studio

right click and show package contents
contents-then create new folder called jre
copy contents of the jbr folder and paste into jre folder

Step 3
restart terminal
flutter doctor
NB: If when you execute ln -s ../jbr jdk receive an: "operation not permitted" Allow terminal in privacy&security -> Full Disk Access

On windows however I fixed it another way: I had to go to C:\Program Files\Android\Android Studio. There is already jre folder in there, but it contained signle empty file. Remove jre folder. Create a copy of jbr folder. Rename the copy to jre.

Thanks man !!

For Android Studio Electric Eel on Apple M1 Pro, macOS Monterey (12.6.2), it seems that all I needed to do to fix it was:
cd /Applications/Android Studio.app/Contents
ln -s jbr jre

flutter doctor -v now reports Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

Simply deleting the jre folder seems to have fixed it for me on Windows 11. Did not symlink or copy anything over.

Copying and renaming jbr to jre didn't work, but this did pretty fine. Thanks!

Flutter searches for jre folder instead of jbr which is wrong since Android Studio Electric Eel | 2022.1.1
https://github.com/flutter/flutter/blob/f9daa9aac4b8c801359b3c7a194d490bebcc2016/packages/flutter_tools/lib/src/android/android_studio.dart#L444-L469

For Android Studio Electric Eel on Apple M1 Pro, macOS Monterey (12.6.2), it seems that all I needed to do to fix it was:
cd /Applications/Android Studio.app/Contents
ln -s jbr jre

flutter doctor -v now reports Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

Changing jbr to jre has worked for me. macOS Ventura (13.1). Thanks

I tried the windows solution. But when i try to build my flutter app. This is what i am getting
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files (x86)\Java\jre1.8.0_111\bin\java.exe
I don't even have that folder jre1.8.0_111 anymore. How can i point it to the correct location?

@manylittlestorms open flutter project -> right click android folder -> Flutter -> Open Android module in Android Studio -> New Window / This Window -> Let Gradle do it's thing -> File -> Settings -> Build, Exectuion, Deployment -> Build Tool -> Gradle -> Gradle JDK -> Embedded JDK which ships with Android Studio by default (it is JDK 11 but it can compile to java 8)

Update your path variable to include java (delete old one if you see it):
In my case JAVA_HOME is C:\Program Files\Android\Android Studio\jbr and add %JAVA_HOME%\bin to your PATH

This is still broken in macOS. I just upgraded AS to Electric Eel 2022.1.1 Patch 1 and Flutter doctor throws the same old error. And what is worse, the ln -s jbr jre workaround is not permitted anymore, not even with sudo.

https://github.com/flutter/flutter/pull/119244 is reverted.

This is still broken in macOS. I just upgraded AS to Electric Eel 2022.1.1 Patch 1 and Flutter doctor throws the same old error. And what is worse, the ln -s jbr jre workaround is not permitted anymore, not even with sudo.

For MacBook M1:
Step 1: Please modify .zshrc as follow:
export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
export PATH="$JAVA_HOME/bin:$JAVA_HOME/bin/java:$PATH"

Step 2: Change directory to the subdirectory (Contents) of the Android Studio forder:
cd /Applications/Android\ Studio.app/Contents/
Step 3: Create a symbolic link named jre and point it to jbr:
ln -s jbr jre

#119244 is reverted.

I will work to get this re-landed

was this issue resolved, my electric eel displayed a similar error on running flutter doctor

This is still broken in macOS. I just upgraded AS to Electric Eel 2022.1.1 Patch 1 and Flutter doctor throws the same old error. And what is worse, the ln -s jbr jre workaround is not permitted anymore, not even with sudo.

Check out this guide. Worked fine on my m1.
https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/

This is still broken in macOS. I just upgraded AS to Electric Eel 2022.1.1 Patch 1 and Flutter doctor throws the same old error. And what is worse, the ln -s jbr jre workaround is not permitted anymore, not even with sudo.

Check out this guide. Worked fine on my m1. https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/

This is the correct way to

Fix Terminal “Operation not permitted” Error in macOS

.

Seems to be solved in beta 3.8.0:
Flutter 3.8.0-10.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 1a0a03a41d (3 days ago) • 2023-02-16 22:03:58 -0600
Engine • revision 639e313f99
Tools • Dart 3.0.0 (build 3.0.0-218.1.beta) • DevTools 2.21.1

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 3.8.0-10.1.pre, on Microsoft Windows [Version 10.0.22621.1265], locale nb-NO)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.3)
[√] Android Studio (version 2021.2)
[√] Android Studio (version 2021.3)
[√] Android Studio (version 2022.1)
[√] Android Studio (version 2022.1)
[√] Android Studio (version 2022.2)
[√] Android Studio (version 2022.3)
[√] Connected device (3 available)
[√] HTTP Host Availability

• No issues found!

Happy to hear that Flutter 3.7.6 - Fixes an issue where Flutter is unable to find the current JDK in specific versions of Android Studio.

https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel

Hi,
This issue is not really fixed.
Flutter doctor is no longer complaining, but when you try to actually run the app in an emulator or build it then it fails with below error:
Exception: Found syntax errors.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
main.dart:1

FAILURE: Build failed with an exception.

* What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Android\Android Studio\jre\bin\java.exe

In Windows environment configuration JAVA_HOME is set to jbr, so not sure why is flutter still looking in jre.
To resolve the problem I reverted to the old workaround of making a symbolic link from jre to jbr folder (same thing that used to work for flutter doctor issue).
My flutter doctor output is:
[√] Flutter (Channel stable, 3.7.7, on Microsoft Windows [Version 10.0.19045.2728], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[!] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.2)
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK
[√] Android Studio (version 2022.1)
[√] VS Code (version 1.76.1)
[√] Connected device (4 available)
[√] HTTP Host Availability

@under3415 Please file a new issue. That will be a much more effective place to investigate and resolve the issue you're seeing than the thread for this old fixed issue is.
When you do, please include the command you're running and its complete output.

authors: AdnanBayu Ashwani10101 EsamSmsm GabriellViictor Gufdoor Igneele91 JasonChiu-dev Khazbs RoarGronmo RomjanHossain Samsonroyal SanjayRajpoot3579 TahaTesser TheGuyDangerous WIHVI anasanisg apravint asaarnak belachkar bingshanguxue christopherfujino ciriousjoker eldarj firestormza flavynho-gif git136975643 gnprice hahnemann huycozy jacisback justintime4tea ketanjangid kreaninw maRci002 manylittlestorms max-torch moeteztounsi mstfkhazaal naccio8 oivinig pandeyhitesh revever rlipscombe segunak selimyaylali timbophillips under3415 vinc3m1 way2sick zacharypuulsedev zainahmed0597


text:
DragTarget.onWillAccept should trigger when the widget appears under a dragged item (like MouseRegion.onEnter)

Problem
I am currently implementing a "drag-file-to-change-directory" kind of UI like in MacOS:
https://user-images.githubusercontent.com/24209580/184374376-4b5dc77f-d41f-4b9a-af50-8f3b01d39c5f.mov
For this i am using DragTarget.onWillAccept to detect a dragged file (Draggable) entering a folder (DragTarget), and triggering a "change directory" based on that.
The video above shows two "change directory" actions without moving the pointer in between.
This is not currently possible to replicate with flutter DragTarget.
Instead the user must first move the pointer a tiny bit for DragTarget.onWillAccept to be triggered for the second time.
MouseRegion can already detect non moving pointers in onEnter that were at their location before the widget existed
MouseRegion.onEnters doc states:
[...]
/// This callback is triggered when the pointer, with or without buttons
/// pressed, has started to be contained by the region of this widget. More
/// specifically, the callback is triggered by the following cases:
///
///  * This widget has appeared under a pointer.
///  * This widget has moved to under a pointer.
///  * A new pointer has been added to somewhere within this widget.
///  * An existing pointer has moved into this widget.
[...]

With the important bit being This widget has appeared under a pointer..
DragTarget.onWillAccept states:
[...]
/// Called when a piece of data enters the target. [...]

Steps to reproduce
I have created two minimal examples, one for MouseRegion.onEnter, and one for DragTarget.onWillAccept
MouseRegion.onEnter

click on the grey background
wait one second and dont move your cursor at all
a new widget is inserted that has a MouseRegion.onEnter to set a boolean
the background turns blue, meaning the MouseRegion.onEnter was triggered
(If you instead move the mouse out of the window before the one second has passed, the background will be red)

https://user-images.githubusercontent.com/24209580/184377551-ef1cb0d3-e3d9-493d-ba98-e8b47745f3cf.mov

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: "Application",
      home: Scaffold(
        body: MyWidget(),
      ),
    );
  }
}

class MyWidget extends StatefulWidget {
  const MyWidget({Key? key}) : super(key: key);

  @override
  State<MyWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  bool isVisible = false;
  bool isEntered = false;

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Positioned.fill(
          child: InkWell(
            onTap: () => Future.delayed(
              const Duration(seconds: 1),
              () => setState(() {
                isVisible = true;
              }),
            ),
            child: Container(
              color: Colors.grey,
            ),
          ),
        ),
        if (isVisible)
          Positioned.fill(
            child: MouseRegion(
              onEnter: (_) => setState(() {
                isEntered = true;
              }),
              child: Container(
                color: isEntered ? Colors.blue : Colors.red,
                width: double.infinity,
                height: double.infinity,
              ),
            ),
          ),
      ],
    );
  }
}

DragTarget.onWillAccept

click on the grey background
this will start a drag, DONT move your pointer at all
a new widget is inserted that has a DragTarget.onWillAccept to set a boolean
the background stays red, meaning the DragTarget.onWillAccept was not yet triggered
now move your pointer
the background turns blue, meaning the DragTarget.onWillAccept was now triggered after the movement

https://user-images.githubusercontent.com/24209580/184379109-c270b502-4c3d-4e0a-9c26-d23885c00ca3.mov

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: "Application",
      home: Scaffold(
        body: MyWidget(),
      ),
    );
  }
}

class MyWidget extends StatefulWidget {
  const MyWidget({Key? key}) : super(key: key);

  @override
  State<MyWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  bool isVisible = false;
  bool isEntered = false;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Positioned.fill(
          child: Draggable<int>(
            data: 0,
            feedback: Container(
              width: 100,
              height: 100,
              color: Colors.black,
            ),
            onDragStarted: () => setState(() {
              isVisible = true;
            }),
            child: Container(
              color: Colors.grey,
            ),
          ),
        ),
        if (isVisible)
          Positioned.fill(
            child: DragTarget<int>(
              onWillAccept: (data) {
                setState(() {
                  isEntered = true;
                });
                return true;
              },
              builder: (_, __, ___) => Container(
                color: isEntered ? Colors.blue : Colors.red,
                width: double.infinity,
                height: double.infinity,
              ),
            ),
          ),
      ],
    );
  }
}

Expected vs Actual Behaviour

Expected: DragTarget.onWillAccept triggers when the widget appears under a dragged item (like MouseRegion.onEnter)
Actual: DragTarget.onWillAccept does not trigger when the widget appears under a dragged item. Instead it triggers only after the pointer has moved inside the widget

Hi @ltOgt, Thanks for filing the issue. If I understand it right, By just tapping the Draggable, Your other widget is visible, And it should trigger onWillAccept since its under the DragTarget, But it doesn't is that correct?

code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: "Application",
      home: Scaffold(
        body: MyWidget(),
      ),
    );
  }
}

class MyWidget extends StatefulWidget {
  const MyWidget({Key? key}) : super(key: key);

  @override
  State<MyWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  bool isVisible = false;
  bool isEntered = false;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Positioned.fill(
          child: Draggable<int>(
            data: 0,
            feedback: Container(
              width: 100,
              height: 100,
              color: Colors.black,
            ),
            onDragStarted: () => setState(() {
              isVisible = true;
            }),
            child: Container(
              color: Colors.grey,
            ),
          ),
        ),
        if (isVisible)
          Positioned.fill(
            child: DragTarget<int>(
              onWillAccept: (data) {
                setState(() {
                  isEntered = true;
                });
                return true;
              },
              builder: (_, __, ___) => Container(
                color: isEntered ? Colors.blue : Colors.red,
                width: double.infinity,
                height: double.infinity,
              ),
            ),
          ),
      ],
    );
  }
}

flutter doctor -v (mac)
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-IN)
    • Flutter version 3.0.5 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (5 days ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-32, build-tools 33.0.0-rc4
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.67.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.44.0

[✓] Connected device (3 available)
    • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64  • Android 11 (API 30) (emulator)
    • macOS (desktop)           • macos         • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)              • chrome        • web-javascript • Google Chrome 103.0.5060.114

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

@maheshmnj, yes that is correct.
a simple tap (and hold) starts the drag and inserts the DropTarget below, and therefore the onWillAccept should be called.
The other example was simply to show that MouseRegion.onEnter already behaves in the expected way.

Thanks for the confirmation, I think this is working as intended as per the current implementation. I am labeling this issue as a proposal to trigger onWillAccept when a draggable is tapped. I think is specifically for a case when DragTarget is created dynamically, and the gesture is already in contact with the Draggable.
Triage details can be found here https://github.com/flutter/flutter/issues/109455#issuecomment-1214731424

@goderbauer could you maybe point me in the right direction here?
I am aware of the layering issue, which is why i asked for alternative ideas.
In case the DragTargetPostFrameUpdater is all together the wrong approach, should _DraggableState handle this internally?
I would like to continue working on this, but without any feedback its hard to do that

source: gharchive/issue

authors: ltOgt maheshmnj

repo: flutter/flutter

license_type: permissive

license_source: github-api


text:
wrong position of TabBarIndicator when it's label size and has label padding

Steps to Reproduce

Execute flutter run on the code sample

Expected results:  blue indicator is cover all of label text
Actual results:  blue indicator is not cover all of label text

Code sample

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage>
    with SingleTickerProviderStateMixin {
  int _counter = 0;
  late TabController _controller;
  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _controller = TabController(length: 3, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Directionality(
        textDirection: TextDirection.ltr,
        child: TabBar(
          controller: _controller,
          tabs: <Widget>[
           Tab(text: 'Tab1'),
           Tab(text: 'Tab2'),
           Tab(text: 'Tab3'),
          ],
          indicator: BoxDecoration(color: Colors.blue),
          unselectedLabelColor: Colors.black,
          labelColor: Colors.red,
          indicatorSize: TabBarIndicatorSize.label,
          labelPadding: EdgeInsets.only(left: 10,right:0),
          //indicatorPadding: EdgeInsets.only(left: 0,right:15),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Logs

[!] Flutter (Channel master, 3.1.0-0.0.pre.2294, on macOS 12.4 21F79 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.1.0-0.0.pre.2294 on channel master at /Users/zmtzawqlp/Documents/flutter/flutter
    ! Upstream repository https://github.com/zmtzawqlp/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://github.com/zmtzawqlp/flutter.git to dismiss this error.
    • Framework revision f4771e16ec (8 minutes ago), 2022-08-16 19:46:48 +0800
    • Engine revision 280e9a7bec
    • Dart version 2.19.0 (build 2.19.0-100.0.dev)
    • DevTools version 2.16.0
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks
      and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/zmtzawqlp/Library/Android/sdk
    • Platform android-32, build-tools 30.0.3
    • ANDROID_HOME = /Users/zmtzawqlp/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13F100
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[✓] VS Code (version 1.70.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.46.0

[✓] Connected device (3 available)
    • iPhone 13 Pro (mobile) • 5E3C7BC0-AE32-4464-AB2B-C3C51E380EC3 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64     • macOS 12.4 21F79 darwin-x64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 104.0.5112.79

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Hi @zmtzawqlp
Thanks for the report! This is a known issue being tracked at #63700.
I also see your PR https://github.com/flutter/flutter/pull/109605 is fixing this issue, you could also refer to issue #63700 for easier tracking. Closing as a duplicate. Thanks for your contribution!

authors: huycozy zmtzawqlp


text:
Flutter app flagged for missing accessibility content labels by Google Play Store

Flutter app is incorrectly flagged for missing Accessibility content labels by Google Play Store
See also: https://stackoverflow.com/questions/73313667/how-to-fix-google-play-console-warnings-about-missing-content-labels
Steps to Reproduce

Create an app.
Wrap every widget with Semantics widget
Submit to Google Play Store

Expected results:
No accessibility issues raised
Actual results:
700+ instances of accessibility issues of type content label missing raised by Google Play Store Console.
This is for a 4 screen app.
All instances show the app screenshot with the entire screen surrounded by a red line. So store is not identifying individual widgets, it just sees the entire screen as a widget. I suspect this has to do with how flutter framework renders things on screen, so play store bots get confused.

You can use demo app created with `flutter create` command
flutter create testApp

Logs

[√] Flutter (Channel beta, 3.3.0-0.3.pre, on Microsoft Windows [Version 10.0.19044.1889], locale en-US)
• Flutter version 3.3.0-0.3.pre on channel beta at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8c1149878b (8 days ago), 2022-08-10 12:15:36 -0500
• Engine revision f16e757d5d
• Dart version 2.18.0 (build 2.18.0-271.4.beta)
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at C:\Users\dejan\AppData\Local\Android\sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[!] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.2.32630.192
• Windows 10 SDK version 10.0.22000.0
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these
components:
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple build tool versions available, install the latest
C++ CMake tools for Windows
Windows 10 SDK
[√] Android Studio (version 2021.2)
• Android Studio at C:\Program Files\Android\Android Studio
• 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.12+7-b1504.28-7817840)
[√] VS Code (version 1.70.2)
• VS Code at C:\Users\dejan\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.46.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.1889]
• Chrome (web)      • chrome  • web-javascript • Google Chrome 98.0.4758.80
• Edge (web)        • edge    • web-javascript • Microsoft Edge 104.0.1293.54
[√] HTTP Host Availability
• All required HTTP hosts are available

Hello @under3415. Thank you for filing this issue. Labelling for further insights from the team.

For me, all the errors either come from the android:id/content/r[0] or android:id/content/FrameLayout[0] element paths, no matter in which screen of the app the tester is, so it's definitely a Flutter framework thing.
I hope these warnings don't cause ASO problems in the Play Store...

Any updates on this?

i have put semantics in the code  but the promblem is still comming in google play store kindly give me a solution plzz

the code
import 'package:cooking/pages/commonpage/signuppage.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:page_transition/page_transition.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:swipeable_button_view/swipeable_button_view.dart';
import '../../routes.dart';
class StartingPage extends StatefulWidget {
@override
State createState() => _StartingPageState();
}
class _StartingPageState extends State {
bool isFinished=false;
bool isFirstTime = true; // Flag to track if it's the first time
Future _checkFirstTime() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
bool firstTime = prefs.getBool('firstTime') ?? true;
setState(() {
  isFirstTime = firstTime;
});

}
Future _updateFirstTimeFlag() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setBool('firstTime', false);
}
@override
void initState() {
super.initState();
_checkFirstTime(); // Check if it's the first time
}
@override
Widget build(BuildContext context) {
if (isFirstTime) {
  TextStyle buttontextstyle;
  return Semantics(
    label: 'Starting page of the app',
    child: Scaffold(
      backgroundColor: Colors.white,
      body: SingleChildScrollView(
        child: SafeArea(
          child: Center(
            child: Column(
              children: [
                SizedBox(
                  height: 100.h,
                ),
                Semantics(
                  label: 'text written Ready to discover',
                  child: Text(
                    "Ready to discover",
                    semanticsLabel: 'text',
                    style:
                    TextStyle(fontSize: 20.sp, fontWeight: FontWeight.bold),
                  ),
                ),
            Semantics(
              label: 'text written your favourite food ',
                  child: Text(
                    " your favourite food ",
                    semanticsLabel: 'text',
                    style:
                    TextStyle(fontSize: 20.sp, fontWeight: FontWeight.bold),
                  ),
                ),
                Semantics(
                  label: 'text written with available ingredients? ',
                  child: Text(
                    "with available ingredients?",
                    style:
                    TextStyle(fontSize: 20.sp, fontWeight: FontWeight.bold),
                  ),
                ),
                Semantics(
                  child: Image(
                    image: AssetImage('assets/images/tt.avif'),
                    semanticLabel: 'Description of the image',

                    height: 260.h,
                  ),
                ),
                Semantics(
                  label: 'Sizedbox',
                  child: SizedBox(
                    height: 40,
                  ),
                ),
                Semantics(
                  label: 'text written Welcome to our culinary adventure! ',
                  child: Text(
                    "Welcome to our culinary adventure!",
                    style: TextStyle(fontSize: 17.sp),
                  ),
                ),
                Semantics(
                  label: 'text written Here are 1000 recipes for you to try. ',
                  child: Text(
                    "Here are 1000 recipes for you to try.",
                    style: TextStyle(fontSize: 17.sp),
                  ),
                ),
                Padding(
                  padding: EdgeInsets.symmetric(
                    horizontal: ScreenUtil().setWidth(20),
                    vertical: ScreenUtil().setHeight(40),
                  ),
                  child: Semantics(
                    label: 'Container',
                    child: Container(
                      decoration: BoxDecoration(
                        border: Border.all(
                          color: Colors.black, // Border color
                          width: 2.0, // Border width
                        ),
                        borderRadius: BorderRadius.circular(10.0), // Adjust the border radius as needed
                      ),
                      child: GestureDetector(
                        onLongPress: () {
                          // Handle long press on SwipeableButtonView
                        },
                        child: Semantics(
                          label: 'Slide button to get started',
                          child: SwipeableButtonView(
                            buttonText: 'SLIDE TO  GET STARTED',
                            buttontextstyle: buttontextstyle =  TextStyle(color: Colors.black,fontWeight: FontWeight.bold),

                            buttonWidget: Container(
                              child: Icon(
                                Icons.arrow_forward_ios_rounded,
                                color: Colors.black,
                              ),
                            ),
                            activeColor: Colors.white,
                            isFinished: isFinished,
                            onWaitingProcess: () {
                              Future.delayed(Duration(seconds: 1), () {
                                setState(() {
                                  isFinished = true;
                                });
                              });
                            },
                            onFinish: () async {
                              await _updateFirstTimeFlag(); // Update the flag
                              await Navigator.push(
                                context,
                                PageTransition(
                                  type: PageTransitionType.fade,
                                  child: SignPage(),
                                ),
                              );
                              setState(() {
                                isFinished = false;
                              });
                            },
                          ),
                        ),
                      ),
                    ),
                  ),

                )
              ],
            ),
          ),
        ),
      ),
    ),
  );
}else {
  if(FirebaseAuth.instance.currentUser!=null){
    WidgetsBinding.instance?.addPostFrameCallback((_) {
      Navigator.pushReplacementNamed(context, MyRoutes.navRoute);
    });
    return Container();

  }else{
    WidgetsBinding.instance?.addPostFrameCallback((_) {
      Navigator.pushReplacementNamed(context, MyRoutes.SignRoute);
    });
    return Container();

  }

}

}
}

Also have this annoying issue

I have the same problem.
The path of the element android:id/content/d0[1].

@ayan-gorain I don't think you need to wrap every widget like that with semantics. Text already have semantics, since it's text. Have you fixed the android app store console warnings though ?

I have the same problem. Did anyone ever find out what is causing this?

have de same problem.

any updates?

Need update info for this problem... @exaby73

I can confirm that issue appears with last flutter release

Same issue for me today, but my element path is different.  I have no idea which element is causing the issue.  I also tried wrapping some widgets in semantics but it didn't resolve the issue.
Element path: android:id/content/P[1]

any update anyone??
@HDLA-BG  from which version and after you mean?

Same issue for me today => android:id/content/w[1]
Thank you so much in advance if somebody finds a solution!

Hi @TetrixGauss
I am on 3.22.1

@HDLA-BG so in previous versions of 3.22.1 was ok for you? because i downgraded my flutter to 3.19.+ and i had the same problem.

@TetrixGauss
No I published my app with 3.22.1 I didn't tried with older version.

The same is here android:id/content/A[1]

Same problem here android:id/content/k[1]. I can't even update my app until I fix this. Google keeps rejecting my app and I don't know how to fix this. Using Semantics on widgets didn't help.

Same for me. We run the app  in flutter version 3.19.1. The app is already live and we have been able to upload updates until now. We just received it in the last update. I have sent an email to let them know that we did everything we could and added all the semantics needed. Their bot still complains. I mean this is ridiculous. Hopefully this fixes soon.

Upvote the original issue with a thumbs up to increase priority instead of "any updates?" and the likes which notify people needlessly.
So thumbs up this to increase the likelihood the flutter team looks into this: https://github.com/flutter/flutter/issues/109813#issue-1343737102

Right ✅ @cedvdb
Do thumbs up 👍 on the first comment so that flutter team could look into the issue as soon as possible: https://github.com/flutter/flutter/issues/109813#issue-1343737102

@reidbaker This issue has a recent uptick in reactions: 28 reactions in the last 90 days. Is this on the Android team's radar?

same problem. I have thumbed-up to the first comment as well

@reidbaker This issue has a recent uptick in reactions: 28 reactions in the last 90 days. Is this on the Android team's radar?

@loic-sharma and I talked in person but for everyone else in chat. We are escalating internally to figure out why this might be happening and will post an update here when we have something to share.

For googlers, this cl appears to have some special casing for flutter apps and how we use accessibility that assumes we are using apis that started to be available in api 33  cl/556056491. Looks like we added those apis here https://github.com/flutter/engine/pull/44452 but it was reverted.

sorry, I just realized i have relanded the change https://github.com/flutter/engine/pull/44589. so something else may be triggering the play store error. I will look into it further

I played around looks like it expect the FlutterView to have a content description, which is surprising because the android team does make an exception to skip flutter view.
If I hardcoded a content description in FlutterView in engine, the warning goes away.
will have to talk to Android team about this and see what may be the next step

Talked with android team. This should only happen for prelaunch report on devices below API 34. This also matches my local test. For those who have issues, can you verify if that is the case?
The next step is to talk to play console team to see if they can silence the false positive for below API 34.

I have the same problem. I get warnings on every page.
android:id/content/r[1]

recently post a new update of my app changing targetSdk to 34, every widget with semantic parent and still flagged for accesibility, Bug persist

I have same problem,,, play store give me warning that my whole screen has no label even though I have given sematic tag to root of my app , also root scaffold and body

recently post a new update of my app changing targetSdk to 34, every widget with semantic parent and still flagged for accesibility, Bug persist

Can you talk more about this? Do you still see the whole screen flagged as missing label? or just individual widgets. Do you have exact message that states what is wrong?

I have still this problem,,,, no other widget has problem,,,, the whole full screen is getting warning even I have updated app and added sematic tag to root widget...
Element path is
android:id/content/t[1]

If the issue came from the device below 34 please ignore it for now. Those are false positive and I am working with Android team to silence the warning. These false positive should all be full screen missing label warning. If you see something else below 34, please report here ideally with some screen shot.
For above 34, if you are seeing something not expected, please report here as well.
Here is how to check what API level from a warning

But google will reject app if it contains warning

If you see something else below 34, please report here ideally with some screen shot.

Did you mean "If you see something else equal to or above 34, please report here ideally with some screen shot."

If you see something else below 34, please report here ideally with some screen shot.

Did you mean "If you see something else equal to or above 34, please report here ideally with some screen shot."

No I meat if you see something that is not a full screen missing label warning and the device is below 34, please report.
I would like to know if there is something else that may not be a false positive below 34, though I doubt it. I just want to be safe that we are not missing anything.

If the issue came from the device below 34 please ignore it for now. Those are false positive and I am working with Android team to silence the warning. These false positive should all be full screen missing label warning. If you see something else below 34, please report here ideally with some screen shot.
For above 34, if you are seeing something not expected, please report here as well.
Here is how to check what API level from a warning

bump this, in my case its for that

After talking to some teams internally we found false positives on flutter apps targeting api less than 34 (33 and below). It is getting fixed on the server side.

No more accessibility warnings on appbundle uploaded today (Flutter 3.24.2). Thank you!

2 flutter apps uploaded one yesterday and one today on separate google play accounts : No more accessibility warnings anymore.
Thanks guys great job @reidbaker @chunhtai

I also deployed an app yesterday with zero warnings.  Thanks so much for resolving this issue!

I am still getting content labelling issues :-(

authors: FauconSpartiate Gul-Gohar HDLA-BG JaviColomo TetrixGauss Tutankhamun2018 adityaerlangga aminebelhassine arpitboss ayan-gorain blakeyblake cedvdb chunhtai duxor dvoloshyn erlangparasu exaby73 feschaffa harSofja khaven loic-sharma lsaudon matiasmarcodelpont moemejia nadveos reidbaker under3415 viva1005


text:
Test that flutter run doesn't introduce new debug spew

I think I'm right in saying that https://github.com/flutter/flutter/issues/110948 was able to emerge undetected in stable because we don't have a test that verifies flutter run does not spew out an unexpected error.
Can we add such a test? Here is the failing condition:
[C:\src\wintext] flutter run -d windows
Launching lib\main.dart on Windows in debug mode...
Building Windows application...
[ERROR:flutter/shell/platform/windows/direct_manipulation.cc(137)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed
[INFO:embedder.cc(136)] populate_existing_damage was not defined, disabling partial repaint. If you wish to enable partial repaint, please define this callback.
Syncing files to device Windows...                                  58ms

We should have been able to pick this up with CI by identifying unexpected text between the Build command and the Sync command. I suspect a test like this might pick up a whole category of potential failures that might only otherwise be detected with manual testing.
/cc @loic-sharma for thoughts.

This sort of test is going to fail a lot, because some of the output flutter run includes is not from the flutter tool or engine, but from the other platform tools that we depend on, like Gradle and the Android SDK. These can have messaging the slightly differs accross versions, and updates out of band with the Flutter SDK.

We recently added a test to the engine to ensure it doesn't have unexpected output:
https://github.com/flutter/engine/blob/2d62ba3e1b92beb6bbe90aabcbff2578ed551a11/shell/platform/windows/flutter_windows_unittests.cc#L43-L67
Ideally once https://github.com/flutter/flutter/issues/110948 is fixed we'd add a similar test to the Flutter tool.

This sort of test is going to fail a lot, because some of the output flutter run includes text that is not from the flutter tool or engine, but from the other platform tools that we depend on, like Gradle and the Android SDK.

This is a good point. Perhaps the test should check there aren't obvious errors? I'll give this some more thought

Its possible we could specifically grep for the engine prefixes for debug logs too

Added in https://github.com/flutter/flutter/pull/116798

authors: jonahwilliams loic-sharma timsneath


text:
Move the undocumented assetBase meta tag API to flutter.js

Flutter allows you to customize the location that assets will be loaded from by adding a tag like:
<meta name="assetBase" content="path/to/my/flutter/assets">

See the logic here: https://github.com/flutter/engine/blob/170cbea98cefa9e3a59e58286a68028b35b3635d/lib/web_ui/lib/src/engine/assets.dart#L45
If this tag isn't supplied, assets are loaded relative to the regular base URL.
I haven't actually found documentation for this anywhere.
I think configuration of the assetBase would be better moved to a parameter of the loadEntrypoint method as part of the flutter.js initialization process (see https://docs.flutter.dev/development/platform-integration/web/initialization). This would make it much easier for Google apps to figure out how to initialize Flutter properly. We rely on this, so the change would have to be non-breaking e.g. by using the loadEntrypoint value, else the meta tag value, else empty string.

Reopening because I had to revert this because of a small lint issue.

authors: ditman jacobsimionato


text:
The project MUST have a formal written policy that as major new functionality

The project MUST have a formal written policy that as major new functionality is added, tests for the new functionality MUST be added to an automated test suite.

Link to the policy docs: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests


text:
url_launcher crashes on iOS

Steps to Reproduce

Add url_launcher to pubspec.yaml pointing to head of git:

  url_launcher:
    git:
      url: git://github.com/flutter/plugins/
      path: packages/url_launcher

Add this to main.dart:

import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

void main() => runApp(new MaterialApp(home: new MyHomePage()));

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new RaisedButton(
        onPressed: () {
          launch('http://flutter.io');
        },
        child: new Text('Click me'),
      ),
    );
  }
}

Run the program against the iOS simulator
Click the button in the app
After the page has loaded, click the 'X' button in the top, right-hand corner

=> app crashes with:
PlatformException(Error, Error while launching http://flutter.io, null)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:514:7)
#1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:154:18)
<asynchronous suspension>
#2      launch (package:url_launcher/url_launcher.dart:19:19)
#3      MyHomePage.build.<anonymous closure> (/Users/mit/Library/Developer/CoreSimulator/Devices/A9635DDE-7C2D-4BD3-969D-279994B6E85E/data/Containers/Data/Application/22433235-D926-412A-A298-D243C8F64E65/tmp/urltestoAPtow/urltest/lib/main.dart:19:11)
#4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:323:14)
#5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:375:30)
#6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
#7      TapGestureRecognizer._checkUp (package:flutter/src/gestures/ta<…>

cc @mehmetf @xster

Apologies, I had not upgraded to the latest push of the package. It works great after doing that!


text:
[Release] Update wiki to reflect changes in the cherry-pick process

Items to clarify

[ ] Users should default to submitting the cherry-pick request.  Leave it up to the team to decide.
[ ] When do stable cherry-picks take priority.

I updated https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process with details on the policy

authors: CaseyHillers itsjustkevin


text:
ListView does not trigger a sound when scrolling while using VoiceOver on iOS

Steps to reproduce

Within the iOS settings app Accessibility > VoiceOver > Audio > Sounds & Haptics > Scrolled Page and enable both (they should be enabled by default)
Within the iOS settings app Accessibility > VoiceOver, enable VoiceOver
Run the linked demo app (or any other app that has a ListView)
Using 3 fingers scroll down the generated list view

Expected results
There is an audible sound made each time you scroll down.
Actual results
There is no sound or feedback to the user letting them know they have scrolled.
Code sample
https://github.com/jeremynorman89/flutter_listview_accessibility_bug_demo
(There is nothing particularly special about this, it's just a ListView with 500 items in it)
Screenshots or Video
No response
Logs
No response
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.16.5, on macOS 14.2.1 23C71 darwin-arm64, locale en-GB)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.85.1)
[✓] Connected device (4 available)
[✓] Network resources

! Doctor found issues in 1 category.

Thanks for the report. I was able to replicate the reported behavior.
Maybe this is related ? https://github.com/flutter/flutter/issues/22747

 stable, master flutter doctor -v
[!] Flutter (Channel stable, 3.16.7, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 3.16.7 on channel stable at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ef1af02aea (3 days ago), 2024-01-11 15:19:26 -0600
    • Engine revision 4a585b7929
    • Dart version 3.2.4
    • DevTools version 2.28.5
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

[!] Flutter (Channel master, 3.19.0-6.0.pre.21, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 3.19.0-6.0.pre.21 on channel master at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 65acd0728c (71 minutes ago), 2024-01-16 23:34:47 -0500
    • Engine revision 73a2de5da5
    • Dart version 3.4.0 (build 3.4.0-24.0.dev)
    • DevTools version 2.31.0
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/dhs/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 65.1.4
    • Dart plugin version 213.7228

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.29.0

[✓] Connected device (3 available)
    • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
      • iOS 15.3.1 19D52
    • macOS (desktop)           • macos                                    •
      darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)              • chrome                                   •
      web-javascript • Google Chrome 109.0.5414.119

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Thanks for the report. I was able to replicate the reported behavior.
Maybe this is related ? #22747

This does indeed seem to be the same thing, somehow missed that while looking through a lot of issues for a similar report.

@jonahwilliams I know https://github.com/flutter/flutter/issues/22747is ancient but is this a dupe?  By "accessibility scrolling announcements" did you mean the same feature turned on by Accessibility > VoiceOver > Audio > Sounds & Haptics > Scrolled Page?

I think that issue should be closed since it was fixed. That particular item was about announcements/labels when selecting items in a list "Item 1 of 50, item 2 of 50" et cetera. I'm not sure about the scrolled page notification, but it sounds similar to the routing based announcements we do (scopes/names route).

Hi framework team, can you take a look if this is something you can help out with? thanks!

What does iOS need to trigger the sound? In the accessibility bridge we'll have to dispatch the event/notification necessary to trigger it.

Is there a workaround for this?

authors: darshankawar goderbauer hellohuanlin jeremynorman89 jmagman jonahwilliams yuukiw00w