Skip to content

Release build fails with dynamic install-time module on Flutter 3.35.0+ due to compileOnly dependencies #175713

@devhpmobile

Description

@devhpmobile

Steps to reproduce

  1. Create a new Flutter project (flutter create my_app or create via IntelliJ/Android Studio).
  2. Add a dynamic install-time module to the Android project (e.g., using Android App Bundles and Dynamic Delivery features).
  3. Attempt to build the project in release mode with Flutter version 3.35.0 or later (e.g., flutter build appbundle --release, or by selecting the release build variant in IntelliJ IDEA/Android Studio).

Expected results

The project should build successfully in release mode without any errors, as it functions with Flutter versions 3.32.6 and below.

Actual results

The release build process fails with the following error:

The following Android dependencies are set to compileOnly which is not supported:
 -> io.flutter:arm64_v8a_debug:1.0.0-c29809135135e262a912cf583b2c90deb9ded610
 -> io.flutter:armeabi_v7a_debug:1.0.0-c29809135135e262a912cf583b2c90deb9ded610
 -> io.flutter:flutter_embedding_debug:1.0.0-c29809135135e262a912cf583b2c90deb9ded610
 -> io.flutter:x86_64_debug:1.0.0-c29809135135e262a912cf583b2c90deb9ded610.

Code sample

// main.dart (minimal Flutter app)
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(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Dynamic Module Test'),
        ),
        body: const Center(
          child: Text('Hello, Dynamic Module!'),
        ),
      ),
    );
  }
}

And the Android configuration to add the dynamic module (typically involves modifying the app's build.gradle.kts and creating a new module directory).

Screenshots or Video

Image Image

Logs

No response

Flutter Doctor output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.35.4, on macOS 26.0 25A354 darwin-arm64, locale en-VN)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.0)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Ultimate Edition (version 2025.1.3)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for DS iPhone 15 PM. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: buildBuilding flutter applications with the toolc: regressionIt was better in the past than it is nowfound in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: solvedIssue is closed as solvedteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions