dnaextrim / flutter_ironsource_x

IronSource Ads & Mediation Plugin for Flutter
https://pub.dev/packages/flutter_ironsource_x
Apache License 2.0
10 stars 17 forks source link

Crash when call onDetachedFromActivity #14

Closed whyym closed 2 years ago

whyym commented 3 years ago

at com.metamorfosis_labs.flutter_ironsource_x.FlutterIronsource_xPlugin.onDetachedFromActivity(FlutterIronsource_xPlugin.kt:311) at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.detachFromActivity(FlutterEngineConnectionRegistry.java:389) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:560) at io.flutter.embedding.android.FlutterActivity.release(FlutterActivity.java:595) at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:616)

In FlutterIronsource_xPlugin.kt should not be write TODO, like this:

override fun onDetachedFromActivityForConfigChanges() { //TODO("Not yet implemented") }

override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { //TODO("Not yet implemented") }

override fun onDetachedFromActivity() { //TODO("Not yet implemented") }

hvesuk commented 2 years ago

The same problem A lot of crashes on production

kotlin.NotImplementedError: 
  at com.metamorfosis_labs.flutter_ironsource_x.FlutterIronsource_xPlugin.onDetachedFromActivity (FlutterIronsource_xPlugin.kt:311)
  at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.detachFromActivity (FlutterEngineConnectionRegistry.java:389)
  at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach (FlutterActivityAndFragmentDelegate.java:632)
  at io.flutter.embedding.android.FlutterActivity.release (FlutterActivity.java:651)
  at io.flutter.embedding.android.FlutterActivity.onDestroy (FlutterActivity.java:672)
  at android.app.Activity.performDestroy (Activity.java:8048)
  at android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1342)
  at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:4927)
  at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:4971)
  at android.app.servertransaction.DestroyActivityItem.execute (DestroyActivityItem.java:44)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2017)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7397)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:935)
ahammamlho commented 2 years ago

The same error on production

mzarhou commented 2 years ago

I have the same problem

debugerer commented 2 years ago

The same problem A lot of crashes on production in google play console.

How to fix this?

ahammamlho commented 2 years ago

@debugerer look at up and change \: flutter_ironsource_x: ^0.0.5 to \: flutter_ironsource_x: git: url: https://github.com/dnaextrim/flutter_ironsource_x ref: c7dbb552c5ede544a34d8d0eda89622fdbba394e

dnaextrim commented 2 years ago

Sorry for my slow response. I forgot to publish this fix to pub.dev. Thanks to @bylbaboy for the solution of this problem, this problem probably happened because I accidentally did todo in AndroidStudio. You can update pubspec.yaml to version 0.0.6 for fix this problem