flutter-radar icon indicating copy to clipboard operation
flutter-radar copied to clipboard

Multiple main() functions being called

Open ConnorDykes opened this issue 1 year ago • 1 comments

When I follow the docs and add the Application.kt then add the tag android:name=".Application" to application to my manifest it its causing my app to spawn two main functions which crashed my app. am I doing something wrong?

 <application
        android:label="SIX"
         android:name=".Application"
        android:allowBackup="false"
        tools:replace="android:allowBackup"
        android:icon="@mipmap/ic_six_2_launcher"
        android:alwaysRetainTaskState="true"
        android:enableOnBackInvokedCallback="false"
        >
import io.flutter.app.FlutterApplication
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.GeneratedPluginRegistrant

import io.radar.sdk.Radar

class Application : FlutterApplication(), PluginRegistry.PluginRegistrantCallback {

  override fun onCreate() {
      super.onCreate()
      Radar.initialize(this, "prj_test_pk_...")
  }

  override fun registerWith(registry: PluginRegistry) {
      GeneratedPluginRegistrant.registerWith(FlutterEngine(this))
  }
}

ConnorDykes avatar Feb 14 '25 05:02 ConnorDykes

I face the same error with Flutter 3.27.1

codestronaut avatar Feb 17 '25 15:02 codestronaut