# App crashed when the initialization was done a second time

**URL:** <https://devforum.zoom.us/t/app-crashed-when-the-initialization-was-done-a-second-time/12640>\
**Category:** Ionic\
**Created:** [April 11, 2020, 12:04am UTC](https://devforum.zoom.us/t/app-crashed-when-the-initialization-was-done-a-second-time/12640 "2020-04-11T00:04:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin.camplone](https://avatars.discourse-cdn.com/v4/letter/k/9d8465/32.png) [@kevin.camplone](https://devforum.zoom.us/u/kevin.camplone)\
**Post date:** [April 11, 2020, 12:04am UTC](https://devforum.zoom.us/t/app-crashed-when-the-initialization-was-done-a-second-time/12640/1 "2020-04-11T00:04:25Z")

</div>

Hi guys,

I installed the SDK on my app, so in the first place I added the initialize code on my app component like the demo, I created a instant meeting successfully and invited a friend to test it, everything worked like expected until I clicked the end button, the app was reloaded and the initialization was done again and it got stuck so my app showed a blank screen indefinitively, not exception shown. I changed the initialization code to other custom component so when I end the meeting the app realoads and go back to home screen like I expected but if I try to go to this component again I get a exception:

```
Wait................................

```

V/\<------- ZoomCordovaPlugin ----------\>: _ **onZoomSDKLoginResult** _ result =====0  
W/cr\_AwContents: Application attempted to call on a destroyed WebView  
java.lang.Throwable  
at org.chromium.android\_webview.AwContents.a(PG:378)  
at org.chromium.android\_webview.AwContents.a(PG:707)  
at com.android.webview.chromium.WebViewChromium.evaluateJavaScript(PG:288)  
at android.webkit.WebView.evaluateJavascript(WebView.java:977)  
at com.getcapacitor.cordova.MockCordovaWebViewImpl$CapacitorEvalBridgeMode$1.run(MockCordovaWebViewImpl.java:80)  
at android.app.Activity.runOnUiThread(Activity.java:5815)  
at com.getcapacitor.cordova.MockCordovaWebViewImpl$CapacitorEvalBridgeMode.onNativeToJsMessageAvailable(MockCordovaWebViewImpl.java:76)  
at org.apache.cordova.NativeToJsMessageQueue.enqueueMessage(NativeToJsMessageQueue.java:249)  
at org.apache.cordova.NativeToJsMessageQueue.addPluginResult(NativeToJsMessageQueue.java:238)  
at com.getcapacitor.cordova.MockCordovaWebViewImpl.sendPluginResult(MockCordovaWebViewImpl.java:253)  
at org.apache.cordova.CallbackContext.sendPluginResult(CallbackContext.java:61)  
at cordova.plugin.zoom.Zoom.onZoomSDKLoginResult(Zoom.java:749)  
at us.zoom.sdk.ZoomSDK.onSDKLoginReturn(ZoomSDK.java:844)  
at us.zoom.sdk.ZoomSDK.access$100(ZoomSDK.java:49)  
at us.zoom.sdk.ZoomSDK$2.onPTAppEvent(ZoomSDK.java:107)  
at com.zipow.videobox.ptapp.PTUI.dispatchPTAppEventImpl(PTUI.java:769)  
at com.zipow.videobox.ptapp.PTUI.dispatchPTAppEvent(PTUI.java:707)  
at com.zipow.videobox.mainboard.Mainboard.heartBeat4SingleProcessImpl(Native Method)  
at com.zipow.videobox.mainboard.Mainboard.heartBeatForSDK(Mainboard.java:999)  
at com.zipow.videobox.ptapp.PTApp.dispatchIdleMessage(PTApp.java:341)  
at com.zipow.videobox.VideoBoxApplication$5.run(VideoBoxApplication.java:1202)  
at android.os.Handler.handleCallback(Handler.java:739)  
at android.os.Handler.dispatchMessage(Handler.java:95)  
at android.os.Looper.loop(Looper.java:145)  
at android.app.ActivityThread.main(ActivityThread.java:7007)  
at java.lang.reflect.Method.invoke(Native Method)  
at java.lang.reflect.Method.invoke(Method.java:372)  
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)  
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

can anyone help me?

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [April 14, 2020, 12:58am UTC](https://devforum.zoom.us/t/app-crashed-when-the-initialization-was-done-a-second-time/12640/2 "2020-04-14T00:58:35Z")

</div>

Hi [kevin.camplone](https://devforum.zoom.us/u/kevin.camplone),

Thanks for using Zoom SDK. If you have successfully initialized the SDK, you do not need to initialize several times. Please try only to initialize the SDK once.

Thanks!

---

<div class="post-metadata">

**Author:** ![kevin.camplone](https://avatars.discourse-cdn.com/v4/letter/k/9d8465/32.png) [@kevin.camplone](https://devforum.zoom.us/u/kevin.camplone)\
**Post date:** [April 14, 2020, 1:04am UTC](https://devforum.zoom.us/t/app-crashed-when-the-initialization-was-done-a-second-time/12640/3 "2020-04-14T01:04:54Z")

</div>

Hi carson! Thanks for your response, i initialize once in my app component, but when i click the end meeting button the app is reloaded so the initialization code is executed again. Its weird.

---

<div class="post-metadata">

**Author:** ![kevin.camplone](https://avatars.discourse-cdn.com/v4/letter/k/9d8465/32.png) [@kevin.camplone](https://devforum.zoom.us/u/kevin.camplone)\
**Post date:** [April 14, 2020, 3:08am UTC](https://devforum.zoom.us/t/app-crashed-when-the-initialization-was-done-a-second-time/12640/4 "2020-04-14T03:08:04Z")

</div>

Hi again,

Let me explain myself again, the initialization code is in my app.component.ts so every time the app is closed or reloaded it got executed. that’s the problem. I don’t know why but when the user end/quit the meeting, the app is reloaded so the app.component.ts is called again.

I fixed it adding this code in Zoom.java:

if (!this.mZoomSDK.isInitialized()) {  
this.initialize(appKey, appSecret, callbackContext);  
}

I think this ionic sdk should have the method isInitialized()

thanks!

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [April 14, 2020, 5:07am UTC](https://devforum.zoom.us/t/app-crashed-when-the-initialization-was-done-a-second-time/12640/5 "2020-04-14T05:07:35Z")

</div>

Hi [kevin.camplone](https://devforum.zoom.us/u/kevin.camplone),

Thanks for the reply and the info. I was not able to reproduce the second initialization on my end, I only experience the initialization once, however, I totally agree that enhancement you are suggesting. I will forward this info to the engineering team.

Thanks!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 8:27pm UTC](https://devforum.zoom.us/t/app-crashed-when-the-initialization-was-done-a-second-time/12640/6 "2020-08-21T20:27:27Z")

</div>


