Skip to content

[add-to-app] multi-engine loading assets throws exception when loading assets after hot restarting when using flutter attach #107091

@impeiwei

Description

@impeiwei

Steps to Reproduce

source code: https://github.com/impeiwei/flutter-samples/tree/main-assets-attach/add_to_app/multiple_flutters

  1. open Multiple Flutter Apps
  2. Run the android module
  3. exec flutter attach in Android Studio IDE attach icon
  4. run hot restart when at FlutterActivity
  5. asset images load exception
flutter-attach.mp4

Logs

Logs
══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
The following assertion was thrown while resolving an image:
Unable to load asset: AssetManifest.json

When the exception was thrown, this was the stack:
#0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:237:7)
<asynchronous suspension>
#1      AssetBundle.loadString (package:flutter/src/services/asset_bundle.dart:72:27)
<asynchronous suspension>

Image provider: ScrollAwareImageProvider<Object>()
Image configuration: ImageConfiguration(bundle: PlatformAssetBundle#b9419(), devicePixelRatio: 2.8,
  locale: en_US, textDirection: TextDirection.ltr, size: Size(100.0, 100.0), platform: android)
════════════════════════════════════════════════════════════════════════════════════════════════════
we found in flutter 2.10.5  and also found at Flutter 3.1.0-0.0.pre.1467

Flutter 3.1.0-0.0.pre.1467 • channel main • https://github.com/flutter/flutter.git
Framework • revision 64a73a7a5f (4 days ago) • 2022-06-30 22:19:08 -0400
Engine • revision b9547182c3
Tools • Dart 2.18.0 (build 2.18.0-241.0.dev) • DevTools 2.14.1

Metadata

Metadata

Assignees

Labels

a: assetsPackaging, accessing, or using assetsa: existing-appsIntegration with existing apps via the add-to-app flowc: crashStack traces logged to the consoleengineflutter/engine related. See also e: labels.found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions