Skip to content

Conversation

@justinmc
Copy link
Contributor

@justinmc justinmc commented Feb 9, 2023

This PR aims to support Android's predictive back gesture when popping the entire Flutter app. Predictive route transitions between routes inside of a Flutter app will come later.

Trying it out

If you want to try this feature yourself, here are the necessary steps:

  1. Run Android 33 or above.
  2. Enable the feature flag for predictive back on the device under "Developer
    options".
  3. Create a Flutter project, or clone my example project.
  4. Set android:enableOnBackInvokedCallback="true" in
    android/app/src/main/AndroidManifest.xml (already done in the example project).
  5. Check out this branch.
  6. Run the app. Perform a back gesture (swipe from the left side of the
    screen).

You should see the predictive back animation like in the animation above and be able to commit or cancel it.

go_router support

go_router works with predictive back out of the box because it uses a Navigator internally that dispatches NavigationNotifications!

go_router can be supported by adding a listener to the router and updating SystemNavigator.setFrameworkHandlesBack.

Similar to with nested Navigators, nested go_routers is supported by using a PopScope widget.

Full example of nested go_routers
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:go_router/go_router.dart';

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

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

class _MyApp extends StatelessWidget {
  final GoRouter router = GoRouter(
    routes: <RouteBase>[
      GoRoute(
        path: '/',
        builder: (BuildContext context, GoRouterState state) => _HomePage(),
      ),
      GoRoute(
        path: '/nested_navigators',
        builder: (BuildContext context, GoRouterState state) => _NestedGoRoutersPage(),
      ),
    ],
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerConfig: router,
    );
  }
}

class _HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Nested Navigators Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('Home Page'),
            const Text('A system back gesture here will exit the app.'),
            const SizedBox(height: 20.0),
            ListTile(
              title: const Text('Nested go_router route'),
              subtitle: const Text('This route has another go_router in addition to the one used with MaterialApp above.'),
              onTap: () {
                context.push('/nested_navigators');
              },
            ),
          ],
        ),
      ),
    );
  }
}

class _NestedGoRoutersPage extends StatefulWidget {
  @override
  State<_NestedGoRoutersPage> createState() => _NestedGoRoutersPageState();
}

class _NestedGoRoutersPageState extends State<_NestedGoRoutersPage> {
  late final GoRouter _router;
  final GlobalKey<NavigatorState> _nestedNavigatorKey = GlobalKey<NavigatorState>();

  // If the nested navigator has routes that can be popped, then we want to
  // block the root navigator from handling the pop so that the nested navigator
  // can handle it instead.
  bool get _popEnabled {
    // canPop will throw an error if called before build. Is this the best way
    // to avoid that?
    return _nestedNavigatorKey.currentState == null ? true : !_router.canPop();
  }

  void _onRouterChanged() {
    // Here the _router reports the location correctly, but canPop is still out
    // of date.  Hence the post frame callback.
    SchedulerBinding.instance.addPostFrameCallback((Duration duration) {
      setState(() {});
    });
  }

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

    final BuildContext rootContext = context;
    _router = GoRouter(
      navigatorKey: _nestedNavigatorKey,
      routes: [
        GoRoute(
          path: '/',
          builder: (BuildContext context, GoRouterState state) => _LinksPage(
            title: 'Nested once - home route',
            backgroundColor: Colors.indigo,
            onBack: () {
              rootContext.pop();
            },
            buttons: <Widget>[
              TextButton(
                onPressed: () {
                  context.push('/two');
                },
                child: const Text('Go to another route in this nested Navigator'),
              ),
            ],
          ),
        ),
        GoRoute(
          path: '/two',
          builder: (BuildContext context, GoRouterState state) => _LinksPage(
            backgroundColor: Colors.indigo.withBlue(255),
            title: 'Nested once - page two',
          ),
        ),
      ],
    );

    _router.addListener(_onRouterChanged);
  }

  @override
  void dispose() {
    _router.removeListener(_onRouterChanged);
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return PopScope(
      popEnabled: _popEnabled,
      onPopped: (bool success) {
        if (success) {
          return;
        }
        _router.pop();
      },
      child: Router<Object>.withConfig(
        restorationScopeId: 'router-2',
        config: _router,
      ),
    );
  }
}

class _LinksPage extends StatelessWidget {
  const _LinksPage ({
    required this.backgroundColor,
    this.buttons = const <Widget>[],
    this.onBack,
    required this.title,
  });

  final Color backgroundColor;
  final List<Widget> buttons;
  final VoidCallback? onBack;
  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: backgroundColor,
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(title),
            //const Text('A system back here will go back to Nested Navigators Page One'),
            ...buttons,
            TextButton(
              onPressed: onBack ?? () {
                context.pop();
              },
              child: const Text('Go back'),
            ),
          ],
        ),
      ),
    );
  }
}

Resources

Fixes #109513
Depends on engine PR flutter/engine#39208 ✔️
Design doc: https://docs.google.com/document/d/1BGCWy1_LRrXEB6qeqTAKlk-U2CZlKJ5xI97g45U7azk/edit#
Migration guide: flutter/website#8952

@justinmc justinmc added platform-android Android applications specifically f: routes Navigator, Router, and related APIs. labels Feb 9, 2023
@justinmc justinmc self-assigned this Feb 9, 2023
@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Feb 9, 2023
@justinmc justinmc force-pushed the predictive-back-root branch from 2e3afaa to 998a251 Compare March 6, 2023 21:14
@flutter-dashboard flutter-dashboard bot added the f: material design flutter/packages/flutter/material repository. label Mar 13, 2023
@justinmc justinmc force-pushed the predictive-back-root branch from 7939a36 to a391efa Compare March 27, 2023 19:39
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 7, 2023
tarrinneal pushed a commit to flutter/packages that referenced this pull request Aug 7, 2023
flutter/flutter@2ba9f7b...ad0aa8d

2023-08-07 [email protected] Roll Flutter Engine from
b10891e0d8d8 to 5b47c0577060 (1 revision) (flutter/flutter#132040)
2023-08-07 [email protected] Roll Flutter Engine from
4304d6180264 to b10891e0d8d8 (1 revision) (flutter/flutter#132037)
2023-08-07 [email protected] Roll Flutter Engine from
eb91441398a1 to 4304d6180264 (1 revision) (flutter/flutter#132031)
2023-08-07 [email protected] Constrain
_RenderScaledInlineWidget child size in computeDryLayout
(flutter/flutter#131765)
2023-08-07 [email protected] Roll Flutter Engine from
15b5707af406 to eb91441398a1 (1 revision) (flutter/flutter#132025)
2023-08-07 [email protected] Roll Flutter Engine from
a1d513f78bbb to 15b5707af406 (2 revisions) (flutter/flutter#132020)
2023-08-06 [email protected] Roll Flutter Engine from
c9bd380ccbb0 to a1d513f78bbb (1 revision) (flutter/flutter#132015)
2023-08-06 [email protected] Roll Flutter Engine from
060c95f94364 to c9bd380ccbb0 (1 revision) (flutter/flutter#132008)
2023-08-06 [email protected] Roll Flutter Engine from
af7aaae2f1f9 to 060c95f94364 (1 revision) (flutter/flutter#132006)
2023-08-06 [email protected] Roll Flutter Engine from
cdafc05a7217 to af7aaae2f1f9 (2 revisions) (flutter/flutter#132004)
2023-08-05 [email protected] Roll Flutter Engine from
b512df490c94 to cdafc05a7217 (1 revision) (flutter/flutter#131996)
2023-08-05 [email protected] Take paint offset
into account for inline children hit test in Editable
(flutter/flutter#131675)
2023-08-05 [email protected] Roll Flutter Engine from
d26b8c8fb60c to b512df490c94 (1 revision) (flutter/flutter#131987)
2023-08-05 [email protected] Roll Flutter Engine from
2ce2913acbe4 to d26b8c8fb60c (1 revision) (flutter/flutter#131986)
2023-08-05 [email protected] Roll Flutter Engine from
628b086265f2 to 2ce2913acbe4 (1 revision) (flutter/flutter#131983)
2023-08-05 [email protected] Roll Flutter Engine from
7302a678e58e to 628b086265f2 (1 revision) (flutter/flutter#131976)
2023-08-05 [email protected] Roll Flutter Engine from
138a1ea9a692 to 7302a678e58e (2 revisions) (flutter/flutter#131975)
2023-08-05 [email protected] Roll Flutter Engine from
a0d650e37f5d to 138a1ea9a692 (2 revisions) (flutter/flutter#131972)
2023-08-05 [email protected] Add TODO to refactor error handling.
(flutter/flutter#131878)
2023-08-05 [email protected] Manual roll Flutter Engine
from 4f4734cd48da to a0d650e37f5d (3 revisions) (flutter/flutter#131967)
2023-08-05 [email protected] Mark the
ci_yaml roller task so that it is not backfilled.
(flutter/flutter#131966)
2023-08-05 [email protected] mark linux packages_autoroller
flaky because of token issue (flutter/flutter#131970)
2023-08-04 [email protected] Sped up the time
to find macrobenchmarks. (flutter/flutter#131959)
2023-08-04 [email protected] Roll Flutter Engine from
c254deb8fbda to 4f4734cd48da (2 revisions) (flutter/flutter#131955)
2023-08-04 [email protected] Roll Flutter Engine from
a7bea8621f4b to c254deb8fbda (3 revisions) (flutter/flutter#131950)
2023-08-04 [email protected] Predictive back support for root
routes (flutter/flutter#120385)
2023-08-04 [email protected] Roll Flutter Engine from
e9f80bff0703 to a7bea8621f4b (3 revisions) (flutter/flutter#131948)
2023-08-04 [email protected] Roll Flutter Engine from
badca1f7f8c9 to e9f80bff0703 (6 revisions) (flutter/flutter#131943)
2023-08-04 [email protected] Mention `showTimePicker` function be can
be used to show dialog with the time picker in the `TimePickerDialog`
docs (flutter/flutter#131932)
2023-08-04 [email protected] Check for
simulator runtime in flutter doctor (flutter/flutter#131795)
2023-08-04 [email protected] Roll Packages from
d00c1f9 to ce53da1 (3 revisions) (flutter/flutter#131935)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC
[email protected],[email protected],[email protected] on the
revert to ensure that a human
is aware of the problem.

To file a bug in Packages:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@Jasguerrero Jasguerrero mentioned this pull request Aug 8, 2023
Jasguerrero added a commit that referenced this pull request Aug 8, 2023
Breaking google testing 
revert of: #120385
b/295065534
@CaseyHillers CaseyHillers mentioned this pull request Aug 9, 2023
8 tasks
CaseyHillers pushed a commit that referenced this pull request Aug 9, 2023
Breaking google testing
revert of: #120385 b/295065534

*Replace this paragraph with a description of what this PR is changing
or adding, and why. Consider including before/after screenshots.*

*List which issues are fixed by this PR. You must list at least one
issue.*

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

Co-authored-by: Jesús S Guerrero <[email protected]>
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request Aug 9, 2023
Breaking google testing
revert of: flutter#120385
b/295065534
justinmc added a commit that referenced this pull request Aug 9, 2023
auto-submit bot pushed a commit that referenced this pull request Aug 17, 2023
Root predictive back (#120385) was reverted in #132167.  This PR is an attempt to reland it.

The reversion happened due to failed Google tests (b/295073110).
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2023
github-merge-queue bot pushed a commit to SharezoneApp/sharezone-app that referenced this pull request Dec 8, 2023
## Description

This PR upgrades to Flutter v3.16.3. We faced the following breaking
changes:

* [Deprecated just-in-time navigation pop APIs for Android Predictive
Back](https://docs.flutter.dev/release/breaking-changes/android-predictive-back)
* [The ThemeData.useMaterial3 property is now set to true by
default](https://docs.flutter.dev/release/breaking-changes/material-3-default)

## Material 3

For now, we just opt out of Material 3 because it requires some more
manual migration and isn't our current focus (#1159).

## Predictive Back

> Android 14 introduced the [Predictive Back
feature](https://developer.android.com/guide/navigation/predictive-back-gesture),
which allows the user to peek behind the current route during a valid
back gesture and decide whether to continue back or to cancel the
gesture. This was incompatible with Flutter’s navigation APIs that allow
the developer to cancel a back gesture after it is received.
>
> With predictive back, the back animation begins immediately when the
user initiates the gesture and before it has been committed. There is no
opportunity for the Flutter app to decide whether it’s allowed to happen
at that time. It must be known ahead of time.
>
> For this reason, all APIs that allow a Flutter app developer to cancel
a back navigation at the time that a back gesture is received are now
deprecated. They have been replaced with equivalent APIs that maintain a
boolean state at all times that dictates whether or not back navigation
is possible. When it is, the predictive back animation happens as usual.
Otherwise, navigation is stopped. In both cases, the app developer is
informed that a back was attempted and whether it was successful.

From
https://docs.flutter.dev/release/breaking-changes/android-predictive-back#background

We mostly have used `WillPopScope` for confirmation dialogs, so the
migration looked like this:

```dart
WillPopScope(
  onWillPop: () async {
    final bool? shouldPop = await _showBackDialog();
    return shouldPop ?? false;
  },
  child: child,
)
```

to

```dart
return PopScope(
  canPop: false,
  onPopInvoked: (bool didPop) async {
    if (didPop) {
      return;
    }
    final NavigatorState navigator = Navigator.of(context);
    final bool? shouldPop = await _showBackDialog();
    if (shouldPop ?? false) {
      navigator.pop();
    }
  },
  child: child,
)
```


https://docs.flutter.dev/release/breaking-changes/android-predictive-back#migrating-a-back-confirmation-dialog

### Run the application with predictive back

1. Run Android 33 or above.
2. Enable the feature flag for predictive back on the device under
“Developer options”. This will be unnecessary on future versions of
Android.
3. Set `android:enableOnBackInvokedCallback="true"` in
android/app/src/main/AndroidManifest.xml. If needed, refer to [Android’s
full
guide](https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture)
for migrating Android apps to support predictive back.
4. Make sure you’re using version 3.14.0-7.0.pre of Flutter or greater.
5. Run the app and perform a back gesture (swipe from the left side of
the screen).


https://docs.flutter.dev/release/breaking-changes/android-predictive-back#supporting-predictive-back

Unfortunately, I wasn't able to get predictive back animations running
in a Flutter app. They work for me in the native settings app, but not
in a Flutter app (even with the example app). I think it shouldn't be
that a big deal because it should work that way as we have it. Here is a
demo of how it should look:
flutter/flutter#120385.

## Testing

I tested the changes manually.

---------

Co-authored-by: Jonas Sander <[email protected]>
nilsreichardt added a commit to SharezoneApp/sharezone-app that referenced this pull request Dec 8, 2023
## Description

This PR upgrades to Flutter v3.16.3. We faced the following breaking
changes:

* [Deprecated just-in-time navigation pop APIs for Android Predictive
Back](https://docs.flutter.dev/release/breaking-changes/android-predictive-back)
* [The ThemeData.useMaterial3 property is now set to true by
default](https://docs.flutter.dev/release/breaking-changes/material-3-default)

## Material 3

For now, we just opt out of Material 3 because it requires some more
manual migration and isn't our current focus (#1159).

## Predictive Back

> Android 14 introduced the [Predictive Back
feature](https://developer.android.com/guide/navigation/predictive-back-gesture),
which allows the user to peek behind the current route during a valid
back gesture and decide whether to continue back or to cancel the
gesture. This was incompatible with Flutter’s navigation APIs that allow
the developer to cancel a back gesture after it is received.
>
> With predictive back, the back animation begins immediately when the
user initiates the gesture and before it has been committed. There is no
opportunity for the Flutter app to decide whether it’s allowed to happen
at that time. It must be known ahead of time.
>
> For this reason, all APIs that allow a Flutter app developer to cancel
a back navigation at the time that a back gesture is received are now
deprecated. They have been replaced with equivalent APIs that maintain a
boolean state at all times that dictates whether or not back navigation
is possible. When it is, the predictive back animation happens as usual.
Otherwise, navigation is stopped. In both cases, the app developer is
informed that a back was attempted and whether it was successful.

From
https://docs.flutter.dev/release/breaking-changes/android-predictive-back#background

We mostly have used `WillPopScope` for confirmation dialogs, so the
migration looked like this:

```dart
WillPopScope(
  onWillPop: () async {
    final bool? shouldPop = await _showBackDialog();
    return shouldPop ?? false;
  },
  child: child,
)
```

to

```dart
return PopScope(
  canPop: false,
  onPopInvoked: (bool didPop) async {
    if (didPop) {
      return;
    }
    final NavigatorState navigator = Navigator.of(context);
    final bool? shouldPop = await _showBackDialog();
    if (shouldPop ?? false) {
      navigator.pop();
    }
  },
  child: child,
)
```


https://docs.flutter.dev/release/breaking-changes/android-predictive-back#migrating-a-back-confirmation-dialog

### Run the application with predictive back

1. Run Android 33 or above.
2. Enable the feature flag for predictive back on the device under
“Developer options”. This will be unnecessary on future versions of
Android.
3. Set `android:enableOnBackInvokedCallback="true"` in
android/app/src/main/AndroidManifest.xml. If needed, refer to [Android’s
full
guide](https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture)
for migrating Android apps to support predictive back.
4. Make sure you’re using version 3.14.0-7.0.pre of Flutter or greater.
5. Run the app and perform a back gesture (swipe from the left side of
the screen).


https://docs.flutter.dev/release/breaking-changes/android-predictive-back#supporting-predictive-back

Unfortunately, I wasn't able to get predictive back animations running
in a Flutter app. They work for me in the native settings app, but not
in a Flutter app (even with the example app). I think it shouldn't be
that a big deal because it should work that way as we have it. Here is a
demo of how it should look:
flutter/flutter#120385.

## Testing

I tested the changes manually.

---------

Co-authored-by: Jonas Sander <[email protected]>
auto-submit bot pushed a commit that referenced this pull request Jan 29, 2024
onNavigationNotification was not being passed through when using the router in MaterialApp and CupertinoApp. I believe this was just an oversight on my part when I wrote #120385. This PR passes them through.

Fixes #139903

@maRci0002 Would this totally fix your issue #139903?
@parthpatel-simbiotik
Copy link

This may've caused issues in new flutter app supposed to run on android 7.

Issues are as below

2024-02-13 13:28:31.588 7001-7001 art pid-7001 I Rejecting re-init on previously-failed class java.lang.Class<io.flutter.embedding.android.f$a>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/window/OnBackInvokedCallback;
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at java.lang.Object java.lang.Class.newInstance!() (Class.java:-2)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at android.app.Activity android.app.Instrumentation.newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) (Instrumentation.java:1078)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2557)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2726)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1477)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.os.Looper.loop() (Looper.java:154)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6119)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:886)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:776)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I Caused by: java.lang.ClassNotFoundException: Didn't find class "android.window.OnBackInvokedCallback" on path: DexPathList[[zip file "/data/app/com.dashparking.displayapp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.dashparking.displayapp-2/lib/arm64, /data/app/com.dashparking.displayapp-2/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at java.lang.Object java.lang.Class.newInstance!() (Class.java:-2)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at android.app.Activity android.app.Instrumentation.newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) (Instrumentation.java:1078)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2557)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2726)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1477)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.os.Looper.loop() (Looper.java:154)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6119)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:886)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:776)
2024-02-13 13:28:31.589 7001-7001 art pid-7001 I

@justinmc
Copy link
Contributor Author

@parthpatel-simbiotik Can you file a new issue for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App c: contributor-productivity Team-specific productivity, code health, technical debt. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How will Flutter implement Android 13's predictive back gesture?

5 participants