New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android Emulator] Child pages are not rendered after exiting a nested initial page with the back gesture and launching from the Android launcher. #148347
Comments
In my case, i had to downgrade to this version of dart sdk. environment:
sdk: ">=3.1.3 <4.0.0" I was using this one. environment:
sdk: ">=3.2.0 <4.0.0" |
@kouroku-room Thanks for the report. Does the same occur in any physical android device or is it specific to emulators only ? |
@darshankawar I have never implemented screen transitions, etc. using anything other than the auto_route library, so it is difficult to provide code. I'm so Sorry. |
Can you try using https://docs.flutter.dev/ui/navigation and see if you are able to replicate this ? |
@darshankawar flutter doctor -vPS C:\projects\sampleForIssue> flutter doctor -v
[√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.22631.3593], locale ja-JP)
• Flutter version 3.22.0 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5dcb86f68f (7 days ago), 2024-05-09 07:39:20 -0500
• Engine revision f6344b75dc
• Dart version 3.4.0
• DevTools version 2.34.3
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\sugur\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.10+0--11572160)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.9.34714.143
• Windows 10 SDK version 10.0.22000.0
[√] Android Studio (version 2023.3)
• 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 17.0.10+0--11572160)
[√] VS Code (version 1.89.1)
• VS Code at C:\Users\sugur\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (5 available)
• SH M25 (mobile) • adb-SX3LHMB420105423-I4myh9._adb-tls-connect._tcp • android-arm64 • Android 14 (API 34)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 14 (API 34) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3593]
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.158
• Edge (web) • edge • web-javascript • Microsoft Edge 124.0.2478.105
! Device SX3LHMB420105423 is offline.
[√] Network resources
• All expected network resources are available.
• No issues found! Example CodeExample Codepubspec.yaml: name: sample_for_issue
description: "A new Flutter project."
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: '>=3.3.3 <4.0.0'
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.8
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^3.0.2
flutter:
uses-material-design: true main.dart: import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
useMaterial3: true,
),
routes: {
'/': (_) => const ParentPage(),
},
);
}
}
class ParentPage extends StatelessWidget {
const ParentPage({super.key});
@override
Widget build(BuildContext context) {
return Stack(
fit: StackFit.expand,
children: [
Container(
color: Theme.of(context).colorScheme.secondaryContainer,
),
Navigator(
pages: const [
MaterialPage(
key: ValueKey('ChildPage'),
child: ChildPage(),
),
],
onPopPage: (route, result) {
return true;
},
),
],
);
}
}
class ChildPage extends StatelessWidget {
const ChildPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
title: const Text('Child'),
),
body: const Center(
child: Column(
children: [
Text(
'Child',
),
],
),
),
);
}
} This code also caused issue with the Android emulator, and not caused issue with the physical Android device. |
@kouroku-room 148347.mov |
@darshankawar I tried with Android 14 (API 34) (emulator). |
If it is specific to Android 14, then you might be hitting #146499 which you can check and confirm. |
I also tried it with Pixel XL API 33 Emulator and reproduce this issue... sample_for_issue.main.dart.sample_for_issue.2024-05-17.19-51-57.mp4Therefore, #146499 may not be relevant. I'll share my sample project (rev. 26946eca is the sample without auto_route) where the problem occurs, just in case. |
@darshankawar I was facing #146499 before on my Samsung Galaxy A53 5G device (Android 14), and after latest Flutter 3.22.0, that issue is resolved but I still see the issue mentioned here for the platform view. Please check comment #146499 (comment) @kouroku-room, after you see this issue, if you open the app from recent apps launcher, does the child page start showing up again? |
@mr-pant No. Once this issue occurs, it seems to start in the state in which it occurs, even if opened from the recent apps launcher. I also tried Once this issue occurs, "Uninstall" or "Deleting app data (Settings app -> Storage & cache => Clear storage)" seems to make it appear correctly. I confirmed with "Pixel 8 API 33", "Pixel 8 API 34" and "Pixel XL API 33" in Android emulator and same reproduce. |
I tried again on Pixel XL api 33 but wasn't able to replicate the reported error and also per my earlier verification. |
I understand. Thanks for team's cooperation. If someone have the same problem and find this Issue, I would be glad if you could report your environment (flutter doctor -v, Android Studio Version, Emulator Version, Emulator Device Info, etc.) here. |
same problem On a real device the problem does not occur at all. flutter doctor • No issues found! |
I am experiencing the same problem with Android emulator version 34.2.13. Switching back to 34.1.20 resolves the problem. Tested with Android API version 34 and 32. It's reproducible with the example from #148347 (comment) Please let me know if I can give any further detail. flutter doctor -v[√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.22631.3593], locale de-DE) • Flutter version 3.22.0 on channel stable at C:\ProgramData\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5dcb86f (11 days ago), 2024-05-09 07:39:20 -0500 • Engine revision f6344b75dc • Dart version 3.4.0 • DevTools version 2.34.3 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.7) [√] Android Studio (version 2023.3) [√] VS Code, 64-bit edition (version 1.89.1) [√] Connected device (4 available) [√] Network resources • No issues found! |
thank you very much! |
I tried to downgrade to Android Emulator 34.1.20. When I did so, this problem did not occur! Reference: How to manually install a select version of emulator https://developer.android.com/studio/emulator_archive Note: Android emulator versions 34.2.13 (Stable) and latest 35.1.9 (Canary) occur this problem. |
Assigning to myself to try to reproduce for now |
At first I thought it was a bug on the library side (https://pub.dev/packages/auto_route), but I am reporting it here because it probably only occurs in the Android Emulator.
Please check Issue (Milad-Akarie/auto_route_library#1947) for the results of defect verification by several other people.
I also reported it to Google's Issue Tracker (https://issuetracker.google.com/issues/338667188), but they commented that I should submit it here.
Environment
Android Emulator version 34.2.13
Android Emulator hypervisor driver (installer) version 2.2.0
flutter doctor -v
Example Code
Example Code
pubspec.yaml:
app_router.dart:
main.dart:
Procedure
Install the app and launch it (either by using the Run button in Android Studio or by installing the built Release APK, in both cases the problem occurred).
ChildPage is displayed at this time.
Perform the back process (whether by back key or gesture by swiping, the bug occurred in both cases).
Tap the app in the launcher.
-> ParentPage is rendered, but ChildPage is not.
issue.mp4
Log(~ parts is my added)
This may be related to a bug in the emulator, as the following logs are displayed.
#146890
According to this Issue (#146890), Android Emulator version 35 is the cause of the bug and that version has already been removed.
However, I am encountering this bug with Android Emulator version 34.2.13.
The text was updated successfully, but these errors were encountered: