Skip to content

[Android Add2App] Crash when trying to create a flutter fragment with RenderMode.texture #53857

@dannyvalentesonos

Description

@dannyvalentesonos

When trying to create a Flutter fragment with RenderMode.texture, I get a crash at launch of the flutter view.

From code inspection, I found this in FlutterView.java

private FlutterView(
      @NonNull Context context,
      @Nullable AttributeSet attrs,
      @NonNull FlutterSurfaceView flutterSurfaceView) {
    super(context, attrs);

    this.flutterSurfaceView = flutterSurfaceView;
    this.renderSurface = flutterSurfaceView;

    init();
  }

  private FlutterView(
      @NonNull Context context,
      @Nullable AttributeSet attrs,
      @NonNull FlutterTextureView flutterTextureView) {
    super(context, attrs);

    this.flutterTextureView = flutterTextureView;
    this.renderSurface = flutterSurfaceView;

    init();
  }

In the second constructor, the second line should be this instead:

this.renderSurface = flutterTextureView;

Metadata

Metadata

Assignees

Labels

engineflutter/engine related. See also e: labels.platform-androidAndroid applications specifically

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions