Blank Screen when using a build apk


#1

Hi there, keep in mind im kind noob.
I have created an app and tested successfully with:

  • “ionic serve”
  • “ionic cordova run android --device --livereload --consolelogs”
  • Creating a debug build and installing in my phone “ionic cordova buil android --device --debug”

But if a create a production build using

I have tried a lot of the solutions here and nothing so far.

Here is my “ionic info”:

cli packages: (C:\Users\bemhu\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 6.3.0 ios 4.4.0
    Ionic Framework    : ionic-angular 3.7.0

System:

    Android SDK Tools : 26.1.1
    Node              : v6.12.3
    npm               : 3.10.10
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\bemhu\AppData\Local\Android\Sdk

Misc:

    backend : pro

And my package.json:

{
  "name": "sticks",
  "version": "0.0.2",
  "author": "Argus Computação",
  "homepage": "http://www.arguscomputacao.com.br/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.4.3",
    "@angular/compiler": "4.4.3",
    "@angular/compiler-cli": "4.4.3",
    "@angular/core": "4.4.3",
    "@angular/forms": "4.4.3",
    "@angular/http": "4.4.3",
    "@angular/platform-browser": "4.4.3",
    "@angular/platform-browser-dynamic": "4.4.3",
    "@ionic-native/core": "^4.5.2",
    "@ionic-native/native-storage": "^4.5.2",
    "@ionic-native/network": "^4.5.2",
    "@ionic-native/splash-screen": "^4.5.2",
    "@ionic-native/status-bar": "^4.5.2",
    "@ionic/storage": "^2.1.3",
    "bignumber.js": "^4.1.0",
    "cordova-android": "~6.3.0",
    "cordova-ios": "^4.5.4",
    "cordova-plugin-add-swift-support": "^1.6.1",
    "cordova-plugin-device": "^1.1.7",
    "cordova-plugin-ionic": "^2.0.3",
    "cordova-plugin-nativestorage": "^2.2.2",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-splashscreen": "^4.1.0",
    "cordova-plugin-statusbar": "^2.4.1",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "^2.2.0",
    "ionic-angular": "3.7.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "rxjs": "5.4.3",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.17"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.0.0",
    "typescript": "2.3.4"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-whitelist": {},
      "ionic-plugin-keyboard": {},
      "cordova-plugin-ionic": {
        "APP_ID": "9e11c661",
        "CHANNEL_NAME": "Master",
        "UPDATE_METHOD": "auto",
        "UPDATE_API": "https://api.ionicjs.com",
        "MAX_STORE": "2"
      },
      "cordova-plugin-nativestorage": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-statusbar": {},
      "cordova-sqlite-storage": {}
    },
    "platforms": [
      "ios",
      "android"
    ]
  }
}

Can somebody help? (sorry if my english is bad)


#2

Same here. Have you find out any solution?


#3

What’s the version of your android device ?


#4

Android 8, OnePlus 3


#5

My package.json:

{
    "name": "template-simple-apps",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "5.0.0",
        "@angular/compiler": "5.0.0",
        "@angular/compiler-cli": "5.0.0",
        "@angular/core": "5.0.0",
        "@angular/forms": "5.0.0",
        "@angular/http": "5.0.0",
        "@angular/platform-browser": "5.0.0",
        "@angular/platform-browser-dynamic": "5.0.0",
        "@ionic-native/camera": "^4.5.2",
        "@ionic-native/core": "4.4.0",
        "@ionic-native/email-composer": "^4.5.2",
        "@ionic-native/file": "^4.5.2",
        "@ionic-native/image-picker": "^4.5.2",
        "@ionic-native/onesignal": "^4.5.2",
        "@ionic-native/splash-screen": "4.3.2",
        "@ionic-native/status-bar": "4.3.2",
        "@ionic/storage": "^2.1.3",
        "cordova-android": "^6.3.0",
        "cordova-ios": "^4.4.0",
        "cordova-plugin-camera": "^3.0.0",
        "cordova-plugin-compat": "^1.2.0",
        "cordova-plugin-device": "^1.1.7",
        "cordova-plugin-ionic-webview": "^1.1.16",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.4.1",
        "cordova-plugin-whitelist": "^1.3.1",
        "cordova-sqlite-storage": "^2.2.0",
        "ionic-angular": "3.9.2",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "onesignal-cordova-plugin": "^2.2.4",
        "rxjs": "5.5.2",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.18"
    },
    "devDependencies": {
        "@angular/cli": "^1.5.5",
        "@ionic/app-scripts": "3.1.7",
        "@ionic/cli-plugin-cordova": "^1.4.1",
        "@ionic/cli-plugin-ionic-angular": "1.4.1",
        "typescript": "^2.6.2",
        "uglify-es": "3.2.2"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-device": {},
            "cordova-plugin-ionic-webview": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-camera": {},
            "cordova-sqlite-storage": {},
            "onesignal-cordova-plugin": {}
        },
        "platforms": [
            "android",
            "browser",
            "ios"
        ]
    }
}

My ionic info:

cli packages: (/home/pablo/.nvm/versions/node/v8.9.3/lib/node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.0.1 

local packages:

@ionic/app-scripts : 3.1.7
Cordova Platforms  : android 6.2.3 browser 4.1.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.0.2
Node              : v8.9.3
npm               : 5.5.1 
OS                : Linux 4.10

Environment Variables:

ANDROID_HOME : /home/pablo/Android/Sdk

Misc:

backend : pro

#6

Use console debug of chrome and see if there is an exception
Remote Debugging Android Devices with Chrome :


#7

I belive i found the problem. I was only getting the blank screen with a compiled --release build, that dont pops up in Chrome debug console. During the development i had to format my notebook to install a SSD, so i had to reinstall Android Studio, Java, Node, Ionic … and i belive that broke my project somehow, i had createad a new one and copied all the code and dependencies and now it works. The new project it is the same and it works, and i have tryed a lot of fixes and nothing was working, i have deleted my node_modules and installed again, i had remove all of the pluggins and nothing, so i belive that my original project broke


#8

Hey @ArgusComputacao
I believe I have the same issue.
--release build shows blank screen the first time user opens the app.
I’m not sure what the reason is.
What was your solution?


#9

In my case the project somehow broke when i formated my notebook and re-installed node, ionic, java, android studio… So my fix was to create a new project and copy all the code, i know that this is not realy a soluction, but it solved for me


#10

I have the same problem and I didnt know how it happen. So I tested a lot of versions of different packages. I have find out that it was problem with new typescript and angular. It works well with typescritp 2.8.4 and angular 6.1.10.