1

While building apk for my flutter app I need to avoid from files in building . I have tried by below code in build.yaml but it does not work

targets:
$default:
sources:
  exclude:
    - lib/widgets/hotel.dart
    - lib/widgets/hotel_list_view.dart
    - lib/widgets/hotel_list_data.dart
    - lib/widgets/smooth_star_rating.dart
PRATHIV
  • 352
  • 2
  • 10
  • 1
    Welcome to Stackoverflow. Some inquiries for your posted question: Please provide a [minimal-reproducible-example](https://stackoverflow.com/help/minimal-reproducible-example), i.e., the code to reproduce the problem you describe, as well as a clear description of the Problem: ["It doesn't work" isn't descriptive enough to help people understand your problem](http://meta.stackoverflow.com/q/284236). Instead, tell other readers what the expected behavior should be. Furthermore, you could add on what you already try to solve the error. – Björn Jul 27 '21 at 09:07
  • Does this answer your question? [Exclude certain file/lib for building in flutter web](https://stackoverflow.com/questions/58188511/exclude-certain-file-lib-for-building-in-flutter-web) – Björn Jul 27 '21 at 09:07

1 Answers1

0

you need to specify it in build.gradle

android {
    packagingOptions {
        exclude '{path}'
    }
}
Tolga Kartal
  • 617
  • 4
  • 12