Execution failed for task ':agora_rtc_engine:compileProfileKotlin'

Viewed 467

Generating flutter profile apk ends up getting agora related error: Execution failed for task ':agora_rtc_engine:compileProfileKotlin'.

Command: flutter build apk --profile

I am using the latest Android Studio version as well as all dependencies are up to date Agora Packages:

  • agora_rtc_engine: ^5.0.0
  • agora_rtm: ^1.0.1

Kotlin version: 211-1.6.10-release-923-AS7442.40

Note: App runs fine on debug

Expanded error message:

e: C:\Users\Ajay\Downloads\flutter.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-5.0.0\android\src\main\kotlin\io\agora\agora_rtc_engine\Agor
aRtcEnginePlugin.kt: (253, 18): Type mismatch: inferred type is String? but String was expected
e: C:\Users\Ajay\Downloads\flutter.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-5.0.0\android\src\main\kotlin\io\agora\agora_rtc_engine\Agor
aSurfaceViewFactory.kt: (16, 1): Class 'AgoraSurfaceViewFactory' is not abstract and does not implement abstract base class member public abstract
fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: C:\Users\Ajay\Downloads\flutter.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-5.0.0\android\src\main\kotlin\io\agora\agora_rtc_engine\Agor
aSurfaceViewFactory.kt: (20, 3): 'create' overrides nothing
e: C:\Users\Ajay\Downloads\flutter.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-5.0.0\android\src\main\kotlin\io\agora\agora_rtc_engine\Agor
aTextureViewFactory.kt: (12, 1): Class 'AgoraTextureViewFactory' is not abstract and does not implement abstract base class member public abstract
fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: C:\Users\Ajay\Downloads\flutter.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-5.0.0\android\src\main\kotlin\io\agora\agora_rtc_engine\Agor
aTextureViewFactory.kt: (17, 3): 'create' overrides nothing

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':agora_rtc_engine:compileProfileKotlin'.
Compilation error. See log for more details
1 Answers

This looks like an error from the Flutter build side. Which version of the Flutter SDK are you using? Make sure that you're using the latest stable version.

Also, you should use the latest version of the Agora Flutter SDK: v5.0.1

Related