text:
No such file or directory

exception
String: Exit code 127 from: /Volumes/Work/Flutter Development Data/Flutter Project/footware/android/gradlew -v:
env: bash\r: No such file or directory

#0      runCheckedAsync (package:flutter_tools/src/base/process.dart:251:5)
<asynchronous suspension>
#1      _initializeGradle (package:flutter_tools/src/android/gradle.dart:181:9)
<asynchronous suspension>
#2      _ensureGradle (package:flutter_tools/src/android/gradle.dart:162:37)
<asynchronous suspension>
#3      _readGradleProject (package:flutter_tools/src/android/gradle.dart:95:31)
<asynchronous suspension>
#4      _gradleProject (package:flutter_tools/src/android/gradle.dart:87:34)
<asynchronous suspension>
#5      getGradleAppOut (package:flutter_tools/src/android/gradle.dart:81:29)
<asynchronous suspension>
#6      AndroidApk.fromAndroidProject (package:flutter_tools/src/application_package.dart:96:23)
<asynchronous suspension>
#7      getApplicationPackageForPlatform (package:flutter_tools/src/application_package.dart:283:30)
<asynchronous suspension>
#8      FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:270:21)
<asynchronous suspension>
#9      HotRunner.run (package:flutter_tools/src/run_hot.dart:261:39)
<asynchronous suspension>
#10     RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:391:37)
<asynchronous suspension>
#11     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:372:18)
#12     _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#13     _rootRunUnary (dart:async/zone.dart:1132:38)
#14     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#15     _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#16     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#17     Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#18     Future._complete (dart:async/future_impl.dart:476:7)
#19     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#20     _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
#21     _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:295:13)
#22     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#23     _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#24     _rootRunUnary (dart:async/zone.dart:1132:38)
#25     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#26     _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#27     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#28     Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#29     Future._complete (dart:async/future_impl.dart:476:7)
#30     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#31     _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#32     _rootRun (dart:async/zone.dart:1124:13)
#33     _CustomZone.run (dart:async/zone.dart:1021:19)
#34     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#35     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#36     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#37     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#38     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

flutter doctor
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-IN)
    • Flutter version 0.8.2 at /Volumes/Work/Flutter Development Data/flutter
    • Framework revision 5ab9e70727 (4 weeks ago), 2018-09-07 12:33:05 -0700
    • Engine revision 58a1894a1c
    • Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
    • Android SDK at /Users/akashjagtap/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 29.0.2
    • Dart plugin version 181.5540.11
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

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

[✓] Connected devices (3 available)
    • SM G930T                  • c94536d1                             • android-arm64 • Android 8.0.0 (API 26)
    • Android SDK built for x86 • emulator-5554                        • android-x86   • Android 8.1.0 (API 27) (emulator)
    • iPhone XS Max             • 970BF107-AADF-4648-BBC4-B15911C18360 • ios           • iOS 12.0 (simulator)

• No issues found!

Can you please elaborate on what steps to take to reproduce?
What command produced this output?
Did this work before (previous Flutter version)?
Did this work on another project?

Just installed flutter on my Mac machine (unzip the flutter 1.0.0 stable version to a folder and added that folder to the $PATH) and issued the command flutter doctor which threw the error - env: bash: No such file or directory. Please help out here to resolve this issue.
Looks like it is not able to identify the bash command.

https://stackoverflow.com/questions/29045140/env-bash-r-no-such-file-or-directory
indicates that this is an issue with line endings.
Are you sure you downloaded the MacOS zip file?

Could also be Git config https://stackoverflow.com/questions/22301956/error-with-gradlew-usr-bin-env-bash-no-such-file-or-directory/22301957

I downloaded "flutter_windows_v1.0.0-stable.zip". After setting PATH, I came across the same issue when I ran flutter.I have tried :set fileformat=unix in vim, but it seemed not work

restarting  mac maybe help.

Make sure using flutter_macos_v1.0.0-stable.zip instead of flutter_windows_v1.0.0-stable.zip on mac. I made such a very stupid mistake!!

Try the below and that should fix it:

Clean build

flutter clean

Make the gradlew bin runnable in unix.

vim gradlew
:set fileformat=unix
:wq

Fix the flutter pub packages cache built from earlier session in windows

flutter pub cache repair

authors: RonelYin akash1223 robinjohn taojigu venkateshatr zoechi


text:
Invalid signature file digest for manifest main attributes

Hi,
I want to add the flutter module to my project , so I add the flutter_module.arr to my project.
But when I run the app.  the gradle task ":app:transformClassesWithPreJackPackagedLibrariesForBananaDebug" throw the exception as follow:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithPreJackPackagedLibrariesForBananaDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at com.android.sched.util.config.ReflectFactory.create(ReflectFactory.java:98)
at com.android.jack.Jack.buildSession(Jack.java:1035)
at com.android.jack.Jack.run(Jack.java:550)
at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:124)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.java:1816)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJack(AndroidBuilder.java:1643)
at com.android.builder.internal.compiler.JackConversionCache.convertLibrary(JackConversionCache.java:99)
at com.android.build.gradle.tasks.JackPreDexTransform.runJack(JackPreDexTransform.java:174)
at com.android.build.gradle.tasks.JackPreDexTransform.transform(JackPreDexTransform.java:119)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 17 more
Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:330)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:263)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:316)
at java.util.jar.JarVerifier.update(JarVerifier.java:228)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
at java.util.jar.JarFile.getInputStream(JarFile.java:450)
at com.android.jill.frontend.java.JavaTransformer.transformJavaFiles(JavaTransformer.java:242)
at com.android.jill.frontend.java.JavaTransformer.transform(JavaTransformer.java:162)
at com.android.jill.Jill.process(Jill.java:55)
at com.android.jack.incremental.CommonFilter.convertJarWithJill(CommonFilter.java:403)
at com.android.jack.incremental.CommonFilter.getImportedLibraries(CommonFilter.java:303)
at com.android.jack.incremental.NoInputFilter.(NoInputFilter.java:59)
at sun.reflect.GeneratedConstructorAccessor267.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.android.sched.util.config.ReflectFactory.create(ReflectFactory.java:90)
... 40 more

Thanks for you help~

Any way we can reproduce this issue locally?

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

source: gharchive/issue

authors: Hixie LNeway xster

repo: flutter/flutter

license_type: permissive

license_source: github-api


text:
[google_maps_flutter] - Change MyLocation icon

Hello,
I need to change the MyLocation icon. Today the plugin just change Marks icons.
I need to change the blue Circle icon to another, like Marks.
I believe I don't need to post my Doctor -v because it's not a bug, but a change.

@git-xbits what is the challenge you facing?

The Plugin don't have a method to do this.

Any solution?

Create a flat Marker which changes its location while listening to the location Data. Then Draw the accuracy as Circles around.

Hello @git-xbits !
Did you manage to solve the issue?

Hi, unfortunatelly my actual project don't work with Maps, but, have any method to do this easy in plugin? I opened this issue in april, so I don't check this plugin since then.

authors: BumbleeLin Menelphor git-xbits janmoppel phelipepalte


text:
TextField property  autofocus: true ，Don't show ‘cut paste’ view

Steps to Reproduce

input string is null
autofocus: true
long click not show ‘paste cut’ view

Code
TextField(
                    autofocus: true,
                    onSubmitted: _invitationCommit,
                    enabled: true,
                    controller: _textController,
                    maxLength: 8,
                    maxLines: 1,
                    style: TextStyle(
                      fontSize: flexible(context, 18.0),
                      height: 1.0,
                      color: Colors.black,
                      fontWeight: FontWeight.bold,
                    ),
                    decoration: InputDecoration.collapsed(
                      hintText: '',
                      filled: true,
                      fillColor: Colors.white,
                      border: InputBorder.none,
                    ).copyWith(counterText: ''),
                    keyboardType: TextInputType.numberWithOptions(),
                  ),

flutter --version
Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (3 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

You're right, I was able to reproduce this.  Thanks for submitting an issue!
It seems like any empty TextField with autofocus: true will not show the selection menu on long press.  Setting autofocus: false makes it show up again.
Here's my code:
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Autofocus bug'),
        ),
        body: Center(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              TextField(
                autofocus: true,
              ),
            ],
          ),
        ),
      ),
    );
  }
}

You're right, I was able to reproduce this. Thanks for submitting an issue!
It seems like any empty TextField with autofocus: true will not show the selection menu on long press. Setting autofocus: false makes it show up again.
Here's my code:
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Autofocus bug'),
        ),
        body: Center(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              TextField(
                autofocus: true,
              ),
            ],
          ),
        ),
      ),
    );
  }
}

some page ,  autofocus: true  & empty TextField  ,at the same time I want show the selection menu on long press，How to do？

I don't know of a workaround.  There will probably have to be a change made to Flutter to fix this bug.

This issue was introduced by commit "Material Long Press Text Handle Flash (#32911)" (SHA: 6031c56d4ccfc70656d1a7aff93b913b4476e1bc.).
Other ways to reproduce this issue: type some text in a TextField and get rid of it all. Then long press the field; the options won't show.
Quick fix (do note, this brings back the handle flicker/flash!):
Open packages/flutter/lib/src/rendering/editable.dart, method _handlePotentialSelectionChange, remove this check:
      return;
    }```
Again, this is by no means a fix, just a workaround to restore the broken functionality for now.

This should be fixed in the next release (1.8.1+) with the PR referenced above.  Make sure you're on the right channel to get it.

@justinmc Tried the changes, there still seems to be an issue; when the user clears a text field containing text, they can't long press to paste. It works just fine if you long press an empty text field, but not when you long press a text field after clearing it's text. I made 2 changes here sort of fix it; not sure if it's the right way to do things, though.

@AgentFabulous You're right, I can reproduce that even by just using backspace.  I'll create a new issue to track this.
After taking a quick look, I'm hoping we can come up with a way to fix the root problem.  There is some really fragile dependencies between the selection menu being shown, the selection overlay being created, and setting new selections.

Good to know, thanks :)

authors: AgentFabulous dansunhappy justinmc


text:
Is there a way to backup sqlite Database to Google Drive or Dropbox?

Hi, I've searched everywhere for a solution but I can find nothing that will back up my Users data that is stored in a sqlite database.
Alternatively, is it possible to Migrate their data to Firebase and seemlessly move their data to Firestore with it's built in backup?
regards
Shaun

Back up to users' own Google Drive or Dropbox? If so, look at this for Google Drive at least: https://stackoverflow.com/questions/52793359/how-to-integrate-google-drive-in-flutter-app
You'd have to write your own migration steps for migrating the data from SQLite on to Firestore.

@jv5000 did you find a solution?

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

You can have a look at AutoBackup for Android. Just need to add a tag autoBackup true in maifest and boila!.


text:
Failed assertion: line 1773 pos 12: '_elements.contains(element)': is not true.

Hi,
I was just playing a bit around to test the new structured errors.
So I added a SingleChildScrollViewaround the column of the default counter app and placed a Expanded around the Column which lead to an exception. I removed the Expanded again and saved and got this error here.

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Listener:
'package:flutter/src/widgets/framework.dart': Failed assertion: line 1773 pos 12: '_elements.contains(element)': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=BUG.md

User-created ancestor of the error-causing widget was
    SingleChildScrollView
lib\main.dart:70
When the exception was thrown, this was the stack
#2      _InactiveElements.remove
package:flutter/…/widgets/framework.dart:1773
#3      Element._retakeInactiveElement
package:flutter/…/widgets/framework.dart:3059
#4      Element.inflateWidget
package:flutter/…/widgets/framework.dart:3082
#5      Element.updateChild
package:flutter/…/widgets/framework.dart:2897
#6      SingleChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:5129

This is the code while the error happens:
    return Scaffold(
      appBar: AppBar(

        title: Text(widget.title),
      ),
      body: Center(

        child: SingleChildScrollView(
                  child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '$_counter',
                style: Theme.of(context).textTheme.display1,
              ),
            ],
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ),
    );
  }
}

Removing the SingleChildScrollView and adding it again clears the exception.

I use VS code with;
[√] Flutter (Channel master, v1.10.1-pre.41, on Microsoft Windows [Version 10.0.18362.295], locale de-DE)
• Flutter version 1.10.1-pre.41 at C:\Entwicklung\flutter
• Framework revision 5a3a46ada2 (4 days ago), 2019-09-07 18:37:41 -0400
• Engine revision c9ea4dba8d
• Dart version 2.5.0 (build 2.5.0-dev.4.0 ec7ec4ecf7)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\escam\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] IntelliJ IDEA Community Edition (version 2018.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.5
• Flutter plugin version 29.1.3
• Dart plugin version 182.4892.25
[√] VS Code, 64-bit edition (version 1.38.0)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.4.1
[√] Connected device (1 available)
• Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 7.1.1 (API 25) (emulator)

Fyi @InMatrix
Example of hard to understand exceptions after a hot reload. Likely this case is due to a Flutter framework assertion that at minimum should get a detailed error message.

I had the same error when changing in Dart DevTools from Android to IOS view.  The error persisted even when I changed back. After restarting the debugger it worked again. It happened only once. I wasn't able to reproduce the error afterwards.

I am getting this error when I attempt to add AutomaticKeepAliveClientMixin to a view that is used in a TabBar.  It occurs consistently at a point where one of the (tabbed) views pushes a secondary view and then it returns.

I am getting this error when I attempt to add AutomaticKeepAliveClientMixin to a view that is used in a TabBar. It occurs consistently at a point where one of the (tabbed) views pushes a secondary view and then it returns.

Have you fixed this issue yet?

I had the same error when I tried to add ( theme in MaterialApp ) ,
when I stopped the debugging and re-run it again everything worked fine.

════════ (2) Exception caught by widgets library ═══════════════════════════════════════════════════
'package:flutter/src/widgets/framework.dart': Failed assertion: line 1786 pos 12: '_elements.contains(element)': is not true.
The relevant error-causing widget was:
MaterialApp file:///Users/limi/Desktop/installnew/install_master/lib/main.dart:117:24
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ (3) Exception caught by widgets library ═══════════════════════════════════════════════════
'package:flutter/src/widgets/framework.dart': Failed assertion: line 1786 pos 12: '_elements.contains(element)': is not true.
The relevant error-causing widget was:
MaterialApp file:///Users/limi/Desktop/installnew/install_master/lib/main.dart:117:24
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ (4) Exception caught by widgets library ═══════════════════════════════════════════════════
The getter 'userGestureInProgress' was called on null.
Receiver: null
Tried calling: userGestureInProgress
The relevant error-causing widget was:
MaterialApp file:///Users/limi/Desktop/installnew/install_master/lib/main.dart:117:24
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (2) Exception caught by widgets library ═══════════════════════════════════════════════════
'package:flutter/src/widgets/framework.dart': Failed assertion: line 1786 pos 12: '_elements.contains(element)': is not true.
The relevant error-causing widget was:
MaterialApp file:///Users/limi/Desktop/installnew/install_master/lib/main.dart:117:24
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ (3) Exception caught by widgets library ═══════════════════════════════════════════════════
'package:flutter/src/widgets/framework.dart': Failed assertion: line 1786 pos 12: '_elements.contains(element)': is not true.
The relevant error-causing widget was:
MaterialApp file:///Users/limi/Desktop/installnew/install_master/lib/main.dart:117:24
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ (4) Exception caught by widgets library ═══════════════════════════════════════════════════
The getter 'userGestureInProgress' was called on null.
Receiver: null
Tried calling: userGestureInProgress
The relevant error-causing widget was:
MaterialApp file:///Users/limi/Desktop/installnew/install_master/lib/main.dart:117:24
════════════════════════════════════════════════════════════════════════════════════════════════════

Anyone can show how to solve this issue.

yes i am having same error when i naviget between diffrent screens in my application

did anyone was able to solve this issue? I also have the same problem

I can't reproduce the original issue on the latest master 1.22.0-2.0.pre.59.

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

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

class MyApp extends StatelessWidget {
  // 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,
        // This makes the visual density adapt to the platform that you run
        // the app on. For desktop platforms, the controls will be smaller and
        // closer together (more dense) than on mobile platforms.
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // 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
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  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
  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: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: SingleChildScrollView(
          child: Expanded(
            child: Column(
              // Column is also a layout widget. It takes a list of children and
              // arranges them vertically. By default, it sizes itself to fit its
              // children horizontally, and tries to be as tall as its parent.
              //
              // Invoke "debug painting" (press "p" in the console, choose the
              // "Toggle Debug Paint" action from the Flutter Inspector in Android
              // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
              // to see the wireframe for each widget.
              //
              // Column has various properties to control how it sizes itself and
              // how it positions its children. Here we use mainAxisAlignment to
              // center the children vertically; the main axis here is the vertical
              // axis because Columns are vertical (the cross axis would be
              // horizontal).
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(
                  'You have pushed the button this many times:',
                ),
                Text(
                  '$_counter',
                  style: Theme.of(context).textTheme.headline4,
                ),
              ],
            ),
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

flutter doctor -v
[√] Flutter (Channel master, 1.22.0-2.0.pre.59, on Microsoft Windows [Version 10.0.19041.450], locale en-US)
    • Flutter version 1.22.0-2.0.pre.59 at C:\Development\flutter_master
    • Framework revision be7c7faee6 (7 hours ago), 2020-08-24 22:31:02 -0400
    • Engine revision 8107b36c7b
    • Dart version 2.10.0 (build 2.10.0-56.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at C:\Users\marku\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.1
    • Java binary at: C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\193.6626763\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • 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 2019 16.6.5)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.6.30320.27
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.0)
    • Android Studio at C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\193.6626763
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (4 available)
    • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)           • windows       • windows-x64    • Microsoft Windows [Version 10.0.19041.450]
    • Web Server (web)            • web-server    • web-javascript • Flutter Tools
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 84.0.4147.135

• No issues found!

Could anyone who is still experiencing this issue please provide a minimal complete reproducible code sample with your flutter doctor -v

`FlutterPainter
lib/…/ViewCard/screen_fact_viewCard.dart:1580
When the exception was thrown, this was the stack
#2      _InactiveElements.remove
package:flutter/…/widgets/framework.dart:1964
#3      Element._retakeInactiveElement
package:flutter/…/widgets/framework.dart:3746
...     Normal element mounting (39 frames)
#42     Element.inflateWidget
package:flutter/…/widgets/framework.dart:3790
#43     MultiChildRenderObjectElement.inflateWidget
package:flutter/…/widgets/framework.dart:6422
#44     MultiChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:6433
...     Normal element mounting (24 frames)
#68     Element.inflateWidget
package:flutter/…/widgets/framework.dart:3790
#69     Element.updateChild
package:flutter/…/widgets/framework.dart:3540
#70     RenderObjectToWidgetElement._rebuild
package:flutter/…/widgets/binding.dart:1198
#71     RenderObjectToWidgetElement.mount
package:flutter/…/widgets/binding.dart:1167
#72     RenderObjectToWidgetAdapter.attachToRenderTree.
package:flutter/…/widgets/binding.dart:1112
#73     BuildOwner.buildScope
package:flutter/…/widgets/framework.dart:2600
#74     RenderObjectToWidgetAdapter.attachToRenderTree
package:flutter/…/widgets/binding.dart:1111
#75     ScreenshotController.captureFromWidget
package:screenshot/screenshot.dart:158
#76     Constants.downloadWithScreenshot
package:psychology_facts/constants.dart:219
#77     ShareAndDownloadDialog.showQualityDialog..
package:psychology_facts/Dialogs/share_and_download_dialog.dart:204
#78     GestureRecognizer.invokeCallback
package:flutter/…/gestures/recognizer.dart:198
#79     TapGestureRecognizer.handleTapUp
package:flutter/…/gestures/tap.dart:608
#80     BaseTapGestureRecognizer._checkUp
package:flutter/…/gestures/tap.dart:296
#81     BaseTapGestureRecognizer.handlePrimaryPointer
package:flutter/…/gestures/tap.dart:230
#82     PrimaryPointerGestureRecognizer.handleEvent
package:flutter/…/gestures/recognizer.dart:563
#83     PointerRouter._dispatch
package:flutter/…/gestures/pointer_router.dart:94
#84     PointerRouter._dispatchEventToRoutes.
package:flutter/…/gestures/pointer_router.dart:139
#85     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:539:8)
#86     PointerRouter._dispatchEventToRoutes
package:flutter/…/gestures/pointer_router.dart:137
#87     PointerRouter.route
package:flutter/…/gestures/pointer_router.dart:123
#88     GestureBinding.handleEvent
package:flutter/…/gestures/binding.dart:439
#89     GestureBinding.dispatchEvent
package:flutter/…/gestures/binding.dart:419
#90     RendererBinding.dispatchEvent
package:flutter/…/rendering/binding.dart:322
#91     GestureBinding._handlePointerEventImmediately
package:flutter/…/gestures/binding.dart:374
#92     GestureBinding.handlePointerEvent
package:flutter/…/gestures/binding.dart:338
#93     GestureBinding._flushPointerEventQueue
package:flutter/…/gestures/binding.dart:296
#94     GestureBinding._handlePointerDataPacket
package:flutter/…/gestures/binding.dart:279
#98     _invoke1 (dart:ui/hooks.dart:170:10)
#99     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:331:7)
#100    _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)
(elided 5 frames from class _AssertionError and dart:async)
════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by widgets library ═══════════════════════════════════
Duplicate GlobalKey detected in widget tree.
══════════════════════════════════════════════════════════════════════════════`

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building ValueListenableBuilder<PainterControllerValue>(state: _ValueListenableBuilderState<PainterControllerValue>#f31a1):
'package:flutter[/src/widgets/framework.dart]()': Failed assertion: line 1964 pos 12: '_elements.contains(element)': is not true.
package:flutter/…/widgets/framework.dart:1964
2

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  [https://github.com/flutter/flutter/issues/new?template=2_bug.md]()

same error

authors: Hannyul Xentraxx anilpandey071999 chaochaox1990 escamoteur harsh-joflee jacob314 markusaksli-nc mdddj patniemeyer rohitsainik tharit-haup


text:
ScrollController not attached to any scroll views.

Steps to Reproduce

...
...
...

Target Platform:
Target OS version/browser:
Devices:
Logs

Hi @HowardJJ
opening an issue please try to provide
all or some of the information indicated in the template

Issue Template
If you are looking for support, please check out our documentation
or consider asking a question on Stack Overflow:
- https://flutter.dev/
- https://api.flutter.dev/
- https://stackoverflow.com/questions/tagged/flutter?sort=frequent

If you have found a bug or if our documentation doesn't have an answer
to what you're looking for, then fill our the template below. Please read
our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports

Steps to Reproduce

Please tell us exactly how to reproduce the problem you are running into.

Please attach a small application (ideally just one main.dart file) that
reproduces the problem. You could use https://gist.github.com/ for this.

If the problem is with your application's rendering, then please attach
a screenshot and explain what the problem is.

1. ...
2. ...
3. ...

Please tell us which target platform(s) the problem occurs (Android / iOS / Web / macOS / Linux / Windows)
Which target OS version, for Web, browser, is the test system running?
Does the problem occur on emulator/simulator as well as on physical devices?

Target Platform:
Target OS version/browser:
Devices:

Run your application with `flutter run --verbose` and attach all the
log output below between the lines with the backticks. If there is an
exception, please see if the error message includes enough information
to explain how to solve the issue.

Run `flutter analyze` and attach any output of that command below.
If there are any analysis errors, try resolving them before filing this issue.

Finally, paste the output of running `flutter doctor -v` here.

Closing this issue, since no information has been provided.
Thank you.

authors: HowardJJ iapicca


text:
WidgetTester.pageBack only work in an english application

WidgetTester has a method pageBack that tries to find a Back button.
    await tester.pumpWidget(MyWidget());
    await tester.tap(find.text('Button'));
    await tester.pageBack();

The implementation as shown here: https://api.flutter.dev/flutter/flutter_test/WidgetTester/pageBack.html, look for a tooltip with text "Back".
This doesn't work when the application is translated with MaterialLocalizations and the test runned in a language other than english.
The pageBack method should use an other technique to locate the button (ie. use a semantic label or search for a BackButton widget).

Logs

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.2 19C57, locale en-BE)
    • Flutter version 1.12.13+hotfix.8 at /Users/xavier/projects/flutter_stable
    • Framework revision 0b8abb4724 (9 days ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/xavier/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 43.0.3
    • Dart plugin version 193.6015.53

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

[✓] Connected device (2 available)
    • Moto G 5 Plus   • ZY224FKBCL                • android-arm • Android 8.1.0 (API 27)
    • Xavier’s iPhone • 00008030-00012D9C0212802E • ios         • iOS 13.3.1

• No issues found!

i have facing same issue too, any tips about this

I'm using this workaround
await driver.tap(find.byType('BackButtonIcon'));

But it work only if You have one BackButtonIcon  into the tree.

Reproducible on the latest master 1.22.0-10.0.pre.269.

flutter doctor -v
[√] Flutter (Channel master, 1.22.0-10.0.pre.269, on Microsoft Windows [Version 10.0.19041.508], locale en-US)
    • Flutter version 1.22.0-10.0.pre.269 at C:\Development\flutter_master
    • Framework revision 51fa704642 (2 days ago), 2020-09-19 11:27:04 -0700
    • Engine revision 4b8477d115
    • Dart version 2.10.0 (build 2.10.0-142.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at C:\Users\marku\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.1
    • Java binary at: C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\193.6626763\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • 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 2019 16.6.5)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.6.30320.27
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.0)
    • Android Studio at C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\193.6626763
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (6 available)
    • SM G950F (mobile)           • ce12171c51cc001c03 • android-arm64  • Android 9 (API 28)
    • sdk gphone x86 arm (mobile) • emulator-5554      • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)           • windows            • windows-x64    • Microsoft Windows [Version 10.0.19041.508]
    • Web Server (web)            • web-server         • web-javascript • Flutter Tools
    • Chrome (web)                • chrome             • web-javascript • Google Chrome 85.0.4183.102
    • Edge (web)                  • edge               • web-javascript • Microsoft Edge 85.0.564.51

• No issues found!

Minimal reproducible code sample
main.dart
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      //This will break the test
      /*locale: Locale('he',''),
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
      ],
      supportedLocales: [
        const Locale('he', ''), // Hebrew, no country code
      ],*/
      title: 'Navigation Basics',
      home: FirstRoute(),
    );
  }
}

class FirstRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('First Route'),
      ),
      body: Center(
        child: RaisedButton(
          child: Text('Open route'),
          onPressed: () {
            Navigator.push(
              context,
              MaterialPageRoute(builder: (context) => SecondRoute()),
            );
          },
        ),
      ),
    );
  }
}

class SecondRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Second Route"),
      ),
      body: Center(
        child: RaisedButton(
          onPressed: () {
            Navigator.pop(context);
          },
          child: Text('Go back!'),
        ),
      ),
    );
  }
}

widget_test.dart
import 'package:bug/main.dart';
import 'package:flutter_test/flutter_test.dart';

void main () {

  testWidgets("Navigation test", (WidgetTester tester) async {
    await tester.pumpWidget(MyApp());
    expect(find.text("First Route"), findsOneWidget);

    await tester.tap(find.text("Open route"));

    await tester.pumpAndSettle()
    expect(find.text("Second Route"), findsOneWidget);

    await tester.pageBack(); //Test fails here

    await tester.pumpAndSettle();
    expect(find.text("First Route"), findsOneWidget);
  });
}

Logs
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure object was thrown running a test:
  Expected: exactly one matching node in the widget tree
  Actual: _WidgetTypeFinder:<zero widgets with type "CupertinoNavigationBarBackButton" (ignoring
offstage widgets)>
   Which: means none were found but one was expected
One back button expected on screen

When the exception was thrown, this was the stack:
#0      fail (package:test_api/src/frontend/expect.dart:155:31)
#1      _expect (package:test_api/src/frontend/expect.dart:150:3)
#2      expect (package:test_api/src/frontend/expect.dart:59:3)
#3      expectSync (package:flutter_test/src/widget_tester.dart:446:3)
#4      WidgetTester.pageBack.<anonymous closure> (package:flutter_test/src/widget_tester.dart:1062:7)
#7      TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:72:41)
#8      WidgetTester.pageBack (package:flutter_test/src/widget_tester.dart:1056:27)
#9      main.<anonymous closure> (file:///C:/Users/marku/Desktop/triage/master/test/widget_test.dart:12:18)
<asynchronous suspension>
#10     main.<anonymous closure> (file:///C:/Users/marku/Desktop/triage/master/test/widget_test.dart)
#11     testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:144:29)
<asynchronous suspension>
#12     testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart)
#13     TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:791:19)
<asynchronous suspension>
#16     TestWidgetsFlutterBinding._runTest (package:flutter_test/src/binding.dart:771:14)
#17     AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:1180:24)
#18     FakeAsync.run.<anonymous closure>.<anonymous closure> (package:fake_async/fake_async.dart:178:54)
#23     withClock (package:clock/src/default.dart:48:10)
#24     FakeAsync.run.<anonymous closure> (package:fake_async/fake_async.dart:178:22)
#29     FakeAsync.run (package:fake_async/fake_async.dart:178:7)
#30     AutomatedTestWidgetsFlutterBinding.runTest (package:flutter_test/src/binding.dart:1177:15)
#31     testWidgets.<anonymous closure> (package:flutter_test/src/widget_tester.dart:136:24)
#32     Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:175:19)
<asynchronous suspension>
#33     Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart)
#38     Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:173:13)
#39     Invoker.waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:231:15)
#44     Invoker.waitForOutstandingCallbacks (package:test_api/src/backend/invoker.dart:228:5)
#45     Invoker._onRun.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/invoker.dart:383:17)
<asynchronous suspension>
#46     Invoker._onRun.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/invoker.dart)
#51     Invoker._onRun.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/invoker.dart:370:9)
#52     Invoker._guardIfGuarded (package:test_api/src/backend/invoker.dart:415:15)
#53     Invoker._onRun.<anonymous closure> (package:test_api/src/backend/invoker.dart:369:7)
#60     Invoker._onRun (package:test_api/src/backend/invoker.dart:368:11)
#61     LiveTestController.run (package:test_api/src/backend/live_test_controller.dart:153:11)
#62     RemoteListener._runLiveTest.<anonymous closure> (package:test_api/src/remote_listener.dart:256:16)
#67     RemoteListener._runLiveTest (package:test_api/src/remote_listener.dart:255:5)
#68     RemoteListener._serializeTest.<anonymous closure> (package:test_api/src/remote_listener.dart:208:7)
#86     _GuaranteeSink.add (package:stream_channel/src/guarantee_channel.dart:125:12)
#87     new _MultiChannel.<anonymous closure> (package:stream_channel/src/multi_channel.dart:159:31)
#91     CastStreamSubscription._onData (dart:_internal/async_cast.dart:85:11)
#125    new _WebSocketImpl._fromSocket.<anonymous closure> (dart:_http/websocket_impl.dart:1145:21)
#133    _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:338:23)
#134    _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:232:46)
#144    _Socket._onData (dart:io-patch/socket_patch.dart:2044:41)
#153    new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1580:33)
#154    _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1076:14)
(elided 113 frames from dart:async and package:stack_trace)

The test description was:
  Navigation test
════════════════════════════════════════════════════════════════════════════════════════════════════

The issue is the hardcoded tooltip here:
https://github.com/flutter/flutter/blob/7f3c9b6bdab5a38cfa9eb4ba5aa5d7c5378282f3/packages/flutter_test/lib/src/widget_tester.dart#L1057

  Future<void> pageBack() async {
    return TestAsyncUtils.guard<void>(() async {
      Finder backButton = find.byTooltip('Back');
      if (backButton.evaluate().isEmpty) {
        backButton = find.byType(CupertinoNavigationBarBackButton);
      }
      expectSync(backButton, findsOneWidget, reason: 'One back button expected on screen');
      await tap(backButton);
    });
  }

I had similar problem when trying to go back in an app that the main language is not English. I went to the "pageBack" implementation, and saw that it is working with find.byTooltip('Back');  I am guessing this is the reason that it's working with English only.
I did a simple and not that elegant workaround and copy that function, and changed the "Back" tooltip to the one that I have, and it worked.

Is there any ETA for a fix for this issue?

This issue is reproducible on the latest stable and master channels with below test result:

Logs (test result: failed with exception)
════════════════════════════════════════════════════════════════════════════════════════════════════
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: exactly one matching node in the widget tree
  Actual: _WidgetTypeFinder:<zero widgets with type "CupertinoNavigationBarBackButton" (ignoring
offstage widgets)>
   Which: means none were found but one was expected
One back button expected on screen

When the exception was thrown, this was the stack:
#0      fail (package:test_api/src/expect/expect.dart:134:31)
#1      _expect (package:test_api/src/expect/expect.dart:129:3)
#2      expect (package:test_api/src/expect/expect.dart:46:3)
#3      expectSync (package:flutter_test/src/widget_tester.dart:477:16)
#4      WidgetTester.pageBack.<anonymous closure> (package:flutter_test/src/widget_tester.dart:1118:7)
#7      TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:71:41)
#8      WidgetTester.pageBack (package:flutter_test/src/widget_tester.dart:1112:27)
#9      main.<anonymous closure> (file:///Users/huynq/Documents/NEVERCODE.IO/RepoduceProjects/reproduce_issues/test/test_pageback_51121.dart:15:18)
<asynchronous suspension>
<asynchronous suspension>
(elided 3 frames from dart:async and package:stack_trace)

The test description was:
  Navigation test
════════════════════════════════════════════════════════════════════════════════════════════════════
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following message was thrown:
Multiple exceptions (2) were detected during the running of the current test, and at least one was
unexpected.
════════════════════════════════════════════════════════════════════════════════════════════════════

Test failed. See exception logs above.
The test description was: Navigation test

Sample code (be compatible with the new flutter version)
main.dart
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      //This will break the test
      locale: Locale('he',''),
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
      ],
      supportedLocales: [
        const Locale('he', ''), // Hebrew, no country code
      ],
      title: 'Navigation Basics',
      home: FirstRoute(),
    );
  }
}

class FirstRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('First Route'),
      ),
      body: Center(
        child: TextButton(
          child: Text('Open route'),
          onPressed: () {
            Navigator.push(
              context,
              MaterialPageRoute(builder: (context) => SecondRoute()),
            );
          },
        ),
      ),
    );
  }
}

class SecondRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Second Route"),
      ),
      body: Center(
        child: TextButton(
          onPressed: () {
            Navigator.pop(context);
          },
          child: Text('Go back!'),
        ),
      ),
    );
  }
}

test_file.dart
import 'package:flutter_test/flutter_test.dart';
import 'package:reproduce_issues/pre2.0/test_pageback_51121.dart';

void main () {

  testWidgets("Navigation test", (WidgetTester tester) async {
    await tester.pumpWidget(MyApp());
    expect(find.text("First Route"), findsOneWidget);

    await tester.tap(find.text("Open route"));

    await tester.pumpAndSettle();
    expect(find.text("Second Route"), findsOneWidget);

    await tester.pageBack(); //Test fails here

    await tester.pumpAndSettle();
    expect(find.text("First Route"), findsOneWidget);
  });
}

flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.7.1, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
    • Flutter version 3.7.1 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7048ed95a5 (11 hours ago), 2023-02-01 09:07:31 -0800
    • Engine revision 800594f1f4
    • Dart version 2.19.1
    • DevTools version 2.20.1

[✓] 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 Dolphin 2021.3.1.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio Dolphin 2021.3.1.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.13+0-b1751.21-8125866)

[!] Android Studio (version 2022.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] 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.74.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (4 available)
    • RMX2001 (mobile) • EUYTFEUSQSRGDA6D                         • android-arm64  • Android 11 (API 30)
    • iPhone (mobile)  • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.7.2 19H218
    • macOS (desktop)  • macos                                    • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)     • chrome                                   • web-javascript • Google Chrome 109.0.5414.119

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

! Doctor found issues in 1 category.

[!] Flutter (Channel master, 3.8.0-1.0.pre.32, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
    • Flutter version 3.8.0-1.0.pre.32 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f9daa9aac4 (11 minutes ago), 2023-02-01 22:59:24 -0500
    • Engine revision 679c4b42e2
    • Dart version 3.0.0 (build 3.0.0-192.0.dev)
    • DevTools version 2.21.1
    • 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 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 Dolphin 2021.3.1.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio Dolphin 2021.3.1.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.13+0-b1751.21-8125866)

[!] Android Studio (version 2022.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] 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.74.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (4 available)
    • RMX2001 (mobile) • EUYTFEUSQSRGDA6D                         • android-arm64  • Android 11 (API 30)
    • iPhone (mobile)  • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.7.2 19H218
    • macOS (desktop)  • macos                                    • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)     • chrome                                   • web-javascript • Google Chrome 109.0.5414.119

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

! Doctor found issues in 2 categories.

authors: bluego-joe bud-mo duongtruong12 huycozy markusaksli-nc xvrh yodatk


text:
Flutter 1.12.13+hotfix.8 : Problem with R8 shrinker and plugin flutter_inappwebview

Environment
**Flutter version: Flutter 1.12.13+hotfix.8
**Plugin version: Master branch
Description
Expected behavior:
initialOptions should be set when running in release mode
Current behavior:
options.crossplatform.useShouldOverrideUrlLoading = null even if set to true in the initialOptions.
Steps to reproduce

set minifyEnabled true in android/app/build.gradle:

buildTypes {
  release {
    minifyEnabled true
  }
}

in the inappwebview widget add in initialOptions:
useShouldOverrideUrlLoading: true,

and  add :
shouldOverrideUrlLoading: (InAppWebViewController controller,
             ShouldOverrideUrlLoadingRequest request) async {
           print("Override available: ${request.url}");
          return ShouldOverrideUrlLoadingAction.ALLOW;
},

Then run flutter run --release
shouldOverrideUrlLoading will never been called because useShouldOverrideUrlLoading is null

If minifyEnabled is set to false, it works as expected
Same issue when using :

flutter build appbundle
Using:
flutter build appbundle --no-shrink solves the problem, seems like R8 is messing with something.
doc: flutter.dev

[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.14.6 18G3020, locale en-ES)
    • Flutter version 1.12.13+hotfix.9 at /Users/arnaud/dev/flutter
    • Framework revision f139b11009 (4 days ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at /Users/arnaud/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0
    • ANDROID_HOME = /Users/arnaud/Library/Android/sdk
    • Java binary at: /Users/arnaud/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.6010548/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
    • Android Studio at /Users/arnaud/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.6010548/Android Studio.app/Contents
    • Flutter plugin version 41.1.2
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

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

[✓] Connected device (2 available)
    • Redmi Note 8 Pro          • jjkrdyir8l4s8ls4 • android-arm64 • Android 9 (API 28)
    • Android SDK built for x86 • emulator-5554    • android-x86   • Android 8.1.0 (API 27) (emulator)

• No issues found!

I've open an issue also on the github project of the plugin, but i'm not sure if the error is from R8 or the plugin himself: plugin  issue#315

Hi @arnaudelub
This is 3rd party plugin and  you've already raised the issue on theirgithub
Closing, as this isn't an issue with Flutter itself,
if you disagree please write in the comments and I will reopen it
Thank you

well, as the issue occurs only when minification is used, yes, i disagree, the third party plugin is working fine.
There are the same probabilities that the issue is coming from flutter as from the plugin in my opinion.
Thank you for your help

Hi @arnaudelub
R8 is enabled by default and  you don't need to add
minifyEnabled true
if you're experiencing this issue without third party plugin and without addingminifyEnabled true, please comment below and i will reopen it
Thank you

i know it's enabled by default, that's why i said in the issue that flutter build appbundle --no-shrink   can be used as workaround

authors: TahaTesser arnaudelub


text:
Regression in web_size__compile_test hello_world_dart2js_size, hello_world_dart2js_size_gzip benchmarks...

My gut assessment since these are new is that the baseline's a little low --- maybe rebaseline?

Checked in with @yjbanov; looks like this is expected as he tightened thresholds. Rebaselining.

These have regressed again since https://github.com/flutter/flutter/pull/56379. Canb we rebaseline again?

/cc @mdebbar just FYI, I believe this reflects the code size impact of the ICU data. I rebaselined the benchmarks.

hello_world_dart2js_size still shows red:

cc @yjbanov

The recent PRs that caused increases in code size are:

https://github.com/flutter/flutter/pull/54227 (+4KB)
https://github.com/flutter/flutter/pull/55405 (+4KB)
https://github.com/flutter/flutter/pull/56379 (+24KB ?)
https://github.com/flutter/flutter/pull/56485 (+4KB)

@yjbanov the ICU data is still being tree-shaken out because the code that exercises it hasn't landed yet :) Locally, I had to add a few lines of code that exercise the data in order to measure the size impact.

Rebaselined

authors: kf6gpe mdebbar yjbanov