# Flutter Plugin build failed - needs opt-in

**URL:** <https://community.dynatrace.com/t/flutter-plugin-build-failed-needs-opt-in/49149>\
**Category:** Real User Monitoring\
**Tags:** flutter, real-user-monitoring-classic\
**Created:** [December 2, 2024, 11:59am UTC](https://community.dynatrace.com/t/flutter-plugin-build-failed-needs-opt-in/49149 "2024-12-02T11:59:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lextech](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Lextech](https://community.dynatrace.com/u/Lextech)\
**Post date:** [December 2, 2024, 11:59am UTC](https://community.dynatrace.com/t/flutter-plugin-build-failed-needs-opt-in/49149/1 "2024-12-02T11:59:53Z")

</div>

Hi team,

I am trying to setup and build demo with Flutter plug-in version3.303.1 with this example,&nbsp;[dynatrace\_flutter\_plugin example | Flutter package](https://pub.dev/packages/dynatrace_flutter_plugin/example)

When I run flutter run, I get error with following messages:

Which codes should I add additionally to example?

------------------------------------------------

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode…  
e: file:///C:/Users/xxxxxxx/AppData/Local/Pub/Cache/hosted/pub.dev/dynatrace\_flutter\_plugin-3.303.1/android/src/main/kotlin/com/dynatrace/android/agent/SettingsApiImpl.kt:32:21 This declaration needs opt-in. Its usage must be marked with '@kotlin.ExperimentalStdlibApi’ or ‘@OptIn(kotlin.ExperimentalStdlibApi::class)’

e: file:///C:/Users/xxxxxxx/AppData/Local/Pub/Cache/hosted/pub.dev/dynatrace\_flutter\_plugin-3.303.1/android/src/main/kotlin/com/dynatrace/android/agent/SettingsApiImpl.kt:32:41 This declaration needs opt-in. Its usage must be marked with '@kotlin.ExperimentalStdlibApi’ or ‘@OptIn(kotlin.ExperimentalStdlibApi::class)’

e: file:///C:/Users/xxxxxxx/AppData/Local/Pub/Cache/hosted/pub.dev/dynatrace\_flutter\_plugin-3.303.1/android/src/main/kotlin/com/dynatrace/android/agent/SettingsApiImpl.kt:32:41 The feature “enum entries” is only available since language version 1.9

FAILURE: Build failed with an exception.

-------------------------------------------------

---

<div class="post-metadata">

**Author:** ![Kimhak](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@Kimhak](https://community.dynatrace.com/u/Kimhak)\
**Post date:** [December 3, 2024, 7:24am UTC](https://community.dynatrace.com/t/flutter-plugin-build-failed-needs-opt-in/49149/2 "2024-12-03T07:24:53Z")

</div>

I have resolved this by upgrading Kotlin plugin to version 1.9.25 in android/settings.gradle file.

```java
plugins {
    // Other plugins
    id "org.jetbrains.kotlin.android" version "1.9.25" apply false
}

```

---

<div class="post-metadata">

**Author:** ![Lextech](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Lextech](https://community.dynatrace.com/u/Lextech)\
**Post date:** [December 3, 2024, 9:14am UTC](https://community.dynatrace.com/t/flutter-plugin-build-failed-needs-opt-in/49149/3 "2024-12-03T09:14:59Z")

</div>

Thank you, now I can build app&nbsp;:grin:
