Search code examples
androidcordovaionic-frameworkionic2genymotion

ionic android white screen after showing the splash screen


I have built an apk file using ionic cordova build android. And I have opened that app using Genymotion emulator. When I opened the app, it starts and displays the splash screen. After that a white screen appears forever (I can close the app. But when I start that again, same thing happens).

I have captured the error in the android studio console.

Here they are,

Error with White Screen

And then I have opened the main.js file in that apk. In line 40, I have found this code.

Error source -main.js line 40

Then I browsed the scanner.ts in pages (./pages/scanner/scanner.ts) folder. I did not find anything wrong. It works when I run that using cordova run browser.

scanner.ts scanner.ts file content

Here are some more information on my setup:

npm list -g --depth=0
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
-- [email protected]

Installed platforms:
  android 4.0.0
  browser 4.1.0
Available platforms:
  blackberry10 ~3.8.0 (deprecated)
  webos ~3.7.0
  windows ~5.0.0

Thanks for reading this post. If you know what causes this. Or how to resolve this issue, Please let me know.


Solution

  • Changing the target value in the tsconfig.json from es6 to es5 has worked.
    Eg. "target": "es6" >>> "target": "es5"


    Note: This problem will not automatically happen to the project unless you declare that explicitly.