Skip to content

DWARF stack traces and deferred units. #137527

@Dolar1

Description

@Dolar1

Is there an existing issue for this?

Steps to reproduce

  1. We have made two dynamic components in our app
  • dynamicGallery
  • dynamicGallery2
  1. Follow the docs from Deferred components.

  2. Was able to build and test apk locally via local testing commands given in doc.

  • Local Testing Commands
     java -jar bundletool.jar build-apks --bundle=<your_app_project_dir>/build/app/outputs/bundle/release/app-release.aab --output=<your_temp_dir>/app.apks --local-testing
     java -jar bundletool.jar install-apks --apks=<your_temp_dir>/app.apks
  1. When we put dynamic delivery project folder inside android in the root of flutter project
  • i.e. => flutter_project/android/dynamicallery & dynamicallery2
    The folder structure as given below.

    .
    |── flutter_project/
    |── android/
    |── dynamicGallery/
    │ |── src/
    │ │ └── AndroidManifest.xml
    │ |── build.gradle
    │ |── dexguards-config.gradle
    |── dynamicGallery2/
    │ |── src/
    │ │ └── AndroidManifest.xml
    │ |── build.gradle
    │ |── dexguards-config.gradle

  1. We are able to compile with dexguard configs too.

  2. It results in generating extra symbols for dynamicallery & dynamicallery2 based on the .part.so which is the content for the aab file. [check image below]

image-20231030-061501
  1. Content of symbol file with & without adding deferred components check image below
Screenshot 2023-10-30 at 2 30 13 PM
  1. As a result we are not able to upload .symbols-x.part.so file to firebase, as it results in error.
  • saying native library found
  1. And the crashes are not able to be symbolicated for deferred component part of the android app.

Expected results

result on Firebase on crash in debug mode without dexguard

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError
LateInitializationError: Field 'dog' has not been initialized.

Actual results

result on Firebase on crash with dexguard

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError
LateInitializationError: Field 'hxm' has not been initialized.

Code sample

This code is defined in dynamicGallery to just simulate a crash

Code sample
import 'package:flutter/material.dart';
import 'package:deferred_widget/deferred_widget.dart';
import 'package:dynamic_gallery_2/dynamic_gallery_2.dart' deferred as gallery2;

class Dog {
  var weight;

  void bark() {
    print("bhaw bhaw");
  }
}

class SamplePage extends StatelessWidget {
  SamplePage({super.key});

  late Dog dog;
  void testCrash() {
    dog.bark();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Deferred Component [dynamic_gallery]"),
      ),
      body: SizedBox(),
      floatingActionButton: Column(
        mainAxisAlignment: MainAxisAlignment.end,
        children: <Widget>[
          FloatingActionButton(
            onPressed: () {
              testCrash();
            },
            tooltip: 'Crash',
            child: const Text("Crsh"),
          ),
        ],
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs are followed simply as crash happened and the stack trace.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.13.8, on macOS 13.6 22G120 darwin-arm64, locale en-IN)
    • Flutter version 3.13.8 on channel stable at /Users/test_computer/Downloads/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6c4930c4ac (12 days ago), 2023-10-18 10:57:55 -0500
    • Engine revision 767d8c75e8
    • Dart version 3.1.4
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/test_computer/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/test_computer/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

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

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 13 (API 33) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 13.6 22G120 darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 118.0.5993.117

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listblockedIssue is blocked by another issuedependency: dartDart team may need to help usdependency:dart-triagedTriaged by Dart teamengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions