Blank White Screen: Android apk

Am using:
Cordova 5.1.1
Ionic 1.6.4
Device: Nexus 5
Android version: 5.1.1

Have installed cordova-plugin-whitelist plugin too - so there is no issue with application accessing outside data(API).

When I use ionic run android -lcs everything works file, with no errors, and it gets installed on to the device(am using Nexus 5) and it works perfectly fine.

Problem
But when I follow this http://ionicframework.com/docs/guide/publishing.html and get my .apk file and install it on to the device, it stops working. After the splash screen there is a white screen and it never goes away!

Iā€™ve tried the following
1. Itā€™s not an issue with internet connection.
2. Iā€™ve used adb uninstall com.myapp.myapp_id and then have installed the app, but still the probelm persists.
3. Iā€™ve removed ionic and cordova and reinstalled it - still no use.
4. Iā€™ve removed the platform(android) and added again, then compiled. - still no use.

Anyone else faced/facing the issue? Did you find the solutions?
Please share your findings.

1 Like

You donā€™t see in anything in console?
Have you tried to set a breakpoint in debugger at the beginning of your app and step until you get the problem?

There are no errors in the log. I checked it thoroughly. And it runs very smoothly when I use ionic run android -lcs but it shows blank white screen only when I build the apk file and install it.

1 Like

Ok but what about my suggestion to put a breakpointā€¦

Ya ā€¦presently working on it from 3hrs, but with no luck :frowning:
Yes, am trying to put breakpoints and check.

Itā€™s more than 10hrs now ā€¦and am still trying :frowning:

so far have tried hundreds of testsā€¦ now looks like Xoilac TV - Website Trį»±c Tiįŗæp BĆ³ng ĐƔ Sį»‘ 1 VN XoilacTV is causing the problem. I have not yet found the solution.

When I add these lines:

var androidConfig = {
    "senderID": "replace_with_sender_id",
  };
  document.addEventListener("deviceready", function(){
    $cordovaPush.register(androidConfig).then(function(result) {
      // Success
    }, function(err) {
      // Error
    })

the problem shows up. Iā€™ve added ngCordova dependency and also have injected $cordovaPush.

Still investigating the issue. Any help much appreciated.

Hi, any update here ?
Thanks

Hi!

I Have the same problem. Could be a lot of things, like the policy meta tag on index and other thing that was my problem.
In index.html I added this:

<script src="/js/ng-cordova.min.js"></script>

the ng-cordova.min.js was copied manually to my js folder.
Thatā€™s the mistake!

You should put this file into: lib/ngCordova/dist/ng-cordova.min.js
and in index.html must to be like that:

<script src="lib/ngCordova/dist/ng-cordova.min.js"></script>

Before

 <script src="cordova.js"></script>

and after

<script src="lib/ionic/js/ionic.bundle.js"></script>

See this topic: https://github.com/driftyco/ng-cordova/issues/172
And look up for: ā€œmaikokuppe commented on 29 Mayā€

Looks like iā€™m having nearly same problem. Just after i have installed ionic push plugin, android app stop showing anything. It goes smoothly on iOS, but on android app shows white screen.

When using ionic run android -l -c -s, ionic CLI builds my app, and thenā€¦ NOTHING) Absolutely)

Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v0.12.7
Xcode version: Xcode 7.2.1 Build version 7C1002

Have tried reinstall push plugin and ionic-platform-web-client

in my code i use:

.run(function($ionicPlatform, $ionicPopup, $ionicPush) {
    $ionicPlatform.ready(function() {
        $ionicPush.init({
            "debug": true,
            "onNotification": function(notification) {
                var payload = notification.payload;
                console.log(notification, payload);
                $ionicPopup.alert({
                    title: 'Payload is',
                    template: payload
                });
            },
            "onRegister": function(data) {
                console.log('onRegister', data.token);
                $ionicPush.saveToken(data);
            }
        });
        $ionicPush.register();
    });
})

Hereā€™s something, that i dug in there:

Android version of push plugin need a gcm_key that it takes from settings, but when i checked .io-config, i havenā€™t saw any gcm_key :smiley: even considering that I have specified the key while installation with --variable.

For now, i have specified it again with $ ionic config set gcm_key "MY_KEY" and waiting for emulator.

YEAH! Thatā€™s why it has been crashing.

I donā€™t know why, but i think that push plugin developers missed, the variable, which is inputed while installation.

Solved with $ionic config set gcm_key "MY_KEY" in console