cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flutter Plugin build failed - needs opt-in

Lextech
Dynatrace Advocate
Dynatrace Advocate

Hi team,

I am trying to setup and build demo with Flutter plug-in version3.303.1 with this example, 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.

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

2 REPLIES 2

Kimhak
Newcomer_

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

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

 

Lextech
Dynatrace Advocate
Dynatrace Advocate

Thank you, now I can build app 😁

Featured Posts