nstudio / nativescript-camera-plus

MIT License
79 stars 50 forks source link

[Error] Closing library #103

Closed PabloPG closed 5 years ago

PabloPG commented 5 years ago

When I close the gallery without selecting any images occours the error:

Unhandled Promise rejection: Image picker activity result code 0 ; Zone: <root> ; Task: null ; Value: Image picker activity result code 0 undefined System.err: An uncaught Exception occurred on "main" thread. System.err: Unable to resume activity {br.com.autoglass.flow/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onViewAttachedToWindow failed System.err: Error: java.lang.IllegalStateException: Cannot detach Fragment attached to a different FragmentManager. Fragment FragmentBase_vendor_132225_32_TabFragmentImplementation{e8892ce (6e9ec065-1ebf-4b89-9d55-331a6008046b) id=0x3 android:bottomnavigation:3:0} is already attached to a FragmentManager. System.err: androidx.fragment.app.BackStackRecord.detach(BackStackRecord.java:221) System.err: com.tns.Runtime.callJSMethodNative(Native Method) System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209) System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:1096) System.err: com.tns.Runtime.callJSMethod(Runtime.java:1083) System.err: com.tns.Runtime.callJSMethod(Runtime.java:1063) System.err: com.tns.Runtime.callJSMethod(Runtime.java:1055) System.err: java.lang.Object_vendor_132294_32_AttachListener.onViewAttachedToWindow(Unknown Source:10) System.err: android.view.View.dispatchAttachedToWindow(View.java:20015) System.err: android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3589) System.err: android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3596) System.err: android.view.ViewGroup.addViewInner(ViewGroup.java:5307) System.err: android.view.ViewGroup.addView(ViewGroup.java:5085) System.err: android.view.ViewGroup.addView(ViewGroup.java:5025) System.err: android.view.ViewGroup.addView(ViewGroup.java:4998) System.err: androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:880) System.err: androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1228) System.err: androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1293) System.err: androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) System.err: androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2066) System.err: androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1856) System.err: androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1811) System.err: androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1717) System.err: androidx.fragment.app.FragmentController.execPendingActions(FragmentController.java:446) System.err: androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:459) System.err: android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1416) System.err: android.app.Activity.performResume(Activity.java:7585) System.err: android.app.ActivityThread.performResumeActivity(ActivityThread.java:4017) System.err: android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4057) System.err: android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51) System.err: android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145) System.err: android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1960) System.err: android.os.Handler.dispatchMessage(Handler.java:106) System.err: android.os.Looper.loop(Looper.java:214) System.err: android.app.ActivityThread.main(ActivityThread.java:7097) System.err: java.lang.reflect.Method.invoke(Native Method) System.err: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) System.err: System.err: StackTrace: System.err: java.lang.RuntimeException: Unable to resume activity {br.com.autoglass.flow/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onViewAttachedToWindow failed System.err: Error: java.lang.IllegalStateException: Cannot detach Fragment attached to a different FragmentManager. Fragment FragmentBase_vendor_132225_32_TabFragmentImplementation{e8892ce (6e9ec065-1ebf-4b89-9d55-331a6008046b) id=0x3 android:bottomnavigation:3:0} is already attached to a FragmentManager. System.err: androidx.fragment.app.BackStackRecord.detach(BackStackRecord.java:221) System.err: com.tns.Runtime.callJSMethodNative(Native Method) System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209) System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:1096) System.err: com.tns.Runtime.callJSMethod(Runtime.java:1083) System.err: com.tns.Runtime.callJSMethod(Runtime.java:1063) System.err: com.tns.Runtime.callJSMethod(Runtime.java:1055) System.err: java.lang.Object_vendor_132294_32_AttachListener.onViewAttachedToWindow(Unknown Source:10) System.err: android.view.View.dispatchAttachedToWindow(View.java:20015) System.err: android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3589) System.err: android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3596) System.err: android.view.ViewGroup.addViewInner(ViewGroup.java:5307) System.err: android.view.ViewGroup.addView(ViewGroup.java:5085) System.err: android.view.ViewGroup.addView(ViewGroup.java:5025) System.err: android.view.ViewGroup.addView(ViewGroup.java:4998) System.err: androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:880) System.err: androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1228) System.err: androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1293) System.err: androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) System.err: androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2066) System.err: androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1856) System.err: androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1811) System.err: androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1717) System.err: androidx.fragment.app.FragmentController.execPendingActions(FragmentController.java:446) System.err: androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:459) System.err: android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1416) System.err: android.app.Activity.performResume(Activity.java:7585) System.err: android.app.ActivityThread.performResumeActivity(ActivityThread.java:4017) System.err: android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4057) System.err: android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51) System.err: android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145) System.err: android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1960) System.err: android.os.Handler.dispatchMessage(Handler.java:106) System.err: android.os.Looper.loop(Looper.java:214) System.err: android.app.ActivityThread.main(ActivityThread.java:7097) System.err: java.lang.reflect.Method.invoke(Native Method) System.err: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) System.err: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4025) System.err: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4057) System.err: at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51) System.err: at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145) System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1960) System.err: at android.os.Handler.dispatchMessage(Handler.java:106) System.err: at android.os.Looper.loop(Looper.java:214) System.err: at android.app.ActivityThread.main(ActivityThread.java:7097) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) System.err: Caused by: com.tns.NativeScriptException: Calling js method onViewAttachedToWindow failed System.err: Error: java.lang.IllegalStateException: Cannot detach Fragment attached to a different FragmentManager. Fragment FragmentBase_vendor_132225_32_TabFragmentImplementation{e8892ce (6e9ec065-1ebf-4b89-9d55-331a6008046b) id=0x3 android:bottomnavigation:3:0} is already attached to a FragmentManager. System.err: androidx.fragment.app.BackStackRecord.detach(BackStackRecord.java:221) System.err: com.tns.Runtime.callJSMethodNative(Native Method) System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209) System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:1096) System.err: com.tns.Runtime.callJSMethod(Runtime.java:1083) System.err: com.tns.Runtime.callJSMethod(Runtime.java:1063) System.err: com.tns.Runtime.callJSMethod(Runtime.java:1055) System.err: java.lang.Object_vendor_132294_32_AttachListener.onViewAttachedToWindow(Unknown Source:10) System.err: android.view.View.dispatchAttachedToWindow(View.java:20015) System.err: android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3589) System.err: android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3596) System.err: android.view.ViewGroup.addViewInner(ViewGroup.java:5307) System.err: android.view.ViewGroup.addView(ViewGroup.java:5085) System.err: android.view.ViewGroup.addView(ViewGroup.java:5025) System.err: android.view.ViewGroup.addView(ViewGroup.java:4998) System.err: androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:880) System.err: androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1228) System.err: androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1293) System.err: androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) System.err: androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2066) System.err: androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1856) System.err: androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1811) System.err: androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1717) System.err: androidx.fragment.app.FragmentController.execPendingActions(FragmentController.java:446) System.err: androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:459) System.err: android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1416) System.err: android.app.Activity.performResume(Activity.java:7585) System.err: android.app.ActivityThread.performResumeActivity(ActivityThread.java:4017) System.err: android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4057) System.err: android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51) System.err: android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145) System.err: android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1960) System.err: android.os.Handler.dispatchMessage(Handler.java:106) System.err: android.os.Looper.loop(Looper.java:214) System.err: android.app.ActivityThread.main(ActivityThread.java:7097) System.err: java.lang.reflect.Method.invoke(Native Method) System.err: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1083) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1063) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1055) System.err: at java.lang.Object_vendor_132294_32_AttachListener.onViewAttachedToWindow(Unknown Source:10) System.err: at android.view.View.dispatchAttachedToWindow(View.java:20015) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3589) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3596) System.err: at android.view.ViewGroup.addViewInner(ViewGroup.java:5307) System.err: at android.view.ViewGroup.addView(ViewGroup.java:5085) System.err: at android.view.ViewGroup.addView(ViewGroup.java:5025) System.err: at android.view.ViewGroup.addView(ViewGroup.java:4998) System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:880) System.err: at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1228) System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1293) System.err: at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) System.err: at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2066) System.err: at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1856) System.err: at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1811) System.err: at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1717) System.err: at androidx.fragment.app.FragmentController.execPendingActions(FragmentController.java:446) System.err: at androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:459) System.err: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1416) System.err: at android.app.Activity.performResume(Activity.java:7585) System.err: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4017) System.err: ... 11 more System.err: Caused by: java.lang.IllegalStateException: Cannot detach Fragment attached to a different FragmentManager. Fragment FragmentBase_vendor_132225_32_TabFragmentImplementation{e8892ce (6e9ec065-1ebf-4b89-9d55-331a6008046b) id=0x3 android:bottomnavigation:3:0} is already attached to a FragmentManager. System.err: at androidx.fragment.app.BackStackRecord.detach(BackStackRecord.java:221) System.err: ... 38 more

Bezlepkin commented 3 years ago

Hi! How did you solve this problem?