neckaros / secure_application

Secure your application from prying eyes
MIT License
103 stars 61 forks source link

Crash upon exiting app [onDetachedFromActivity causing kotlin.NotImplementedError] #2

Closed patuoynageek closed 4 years ago

patuoynageek commented 4 years ago

Hi,

There seems to be an unimplemented method causing a crash when you exit the Android app. I was able to reproduce it using the provided example main.dart

SecureApplicationPlugin.kt Line 27:

override fun onDetachedFromActivity() {
    TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}

Error log:

D/FlutterView( 3985): Detaching from a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@f9aac6e
D/FlutterActivityAndFragmentDelegate( 3985): Detaching FlutterEngine from the Activity that owns this Fragment.
D/AndroidRuntime( 3985): Shutting down VM
E/AndroidRuntime( 3985): FATAL EXCEPTION: main
E/AndroidRuntime( 3985): Process: com.[redacted], PID: 3985
E/AndroidRuntime( 3985): kotlin.NotImplementedError: An operation is not implemented: not implemented
E/AndroidRuntime( 3985):    at org.jezequel.secure_application.SecureApplicationPlugin.onDetachedFromActivity(SecureApplicationPlugin.kt:27)
E/AndroidRuntime( 3985):    at io.flutter.embedding.engine.FlutterEnginePluginRegistry.detachFromActivity(FlutterEnginePluginRegistry.java:339)
E/AndroidRuntime( 3985):    at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:453)
E/AndroidRuntime( 3985):    at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:588)
E/AndroidRuntime( 3985):    at android.app.Activity.performDestroy(Activity.java:7218)
E/AndroidRuntime( 3985):    at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1249)
E/AndroidRuntime( 3985):    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4370)
E/AndroidRuntime( 3985):    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4401)
E/AndroidRuntime( 3985):    at android.app.ActivityThread.-wrap5(Unknown Source:0)
E/AndroidRuntime( 3985):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
E/AndroidRuntime( 3985):    at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 3985):    at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime( 3985):    at android.app.ActivityThread.main(ActivityThread.java:6494)
E/AndroidRuntime( 3985):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3985):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/AndroidRuntime( 3985):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
neckaros commented 4 years ago

Thanks for the report! I did not know TODO would cause a crash.

Should be fixed in 3.3.2 secure_application: ^3.3.2

Do not hesitate to reopen if you still have an issue