Blank Screen after installing ionic project into android " ionic cordova run android --device "


#1

I’m getting Blank Screen after installing ionic project application manullay by installing " /ionic/platforms/android/build/outputs/apk/android-debug.apk " by running command " ionic cordova build " and also i run my project by " ionic cordova run android ". I’m getting blank screen please help me anyone with my problem.


#2

What is your ionic info output?


#3

cli packages: (C:\Users\MyPC\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.1.2
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.4.0
npm               : 5.3.0
OS                : Windows 10

Environment Variables:

ANDROID_HOME : C:\Android\sdk

Misc:

backend : pro

#4

There is a newer version 6.4.0 available. Install that one and see if this fixes anything.


#5

Hello Sujan, i tried to update Cordova but its not updating.


#6

ionic cordova platform remove android
ionic cordova platform add android@6.4.0


#7

----------------------------------------------------------------------------------------------------------------------------------------------
home.ts

import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import { storage, initializeApp } from ‘firebase’;
import {firebase_config} from “…/…/app/firebase.config”;
import {Camera, CameraOptions} from “@ionic-native/camera”;
@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’
})
export class HomePage {

constructor(private cam:Camera, public navCtrl: NavController) {
initializeApp(firebase_config);
}
async cap(){
try
{
const options: CameraOptions ={
quality:50,
targetHeight:1920,
targetWidth:1080,
destinationType: this.cam.DestinationType.DATA_URL,
encodingType: this.cam.EncodingType.JPEG,
mediaType:this.cam.MediaType.PICTURE,
correctOrientation: true
}
const result = await this.cam.getPicture(options);
const image = data:image/jpeg;base64,${result};
const pictures = storage().ref(‘pictures/myphoto’);
pictures.putString(image,‘data_url’);
}
catch(e){
console.error(e);

}

}
getinf(sname,pname,ph,buss,eid,appli,exp,df,dt,tf,tt,add) {
/this.contactList.push({
name: name,
address: address,
phone: phone,
city: city
}).then( newContact => {
this.navCtrl.pop();
}, error => {
console.log(error);
});
/
console.log(sname)
}

}

----------------------------------------------------------------------------------------------------------------------------------------------

home.html

Spetinfo Data Entry

Bussiness Details

Category Select ATM Bank Bar Courier Cool Drink Dhabha Electrical Store Xerox Shop Name Prop Name Ph.no Bussiness Email ID If Applicable Experience Address

Working Hours in Day (Monday to Friday)

from to

Working Hours in Time

from to

Payment Methods

Cash Credit/Debit Card Paytm Capture Get Location Submit

----------------------------------------------------------------------------------------------------------------------------------------------
if i remove these 3 lines then i’m getting output otherwise not

  1. import { storage, initializeApp } from ‘firebase’;
  2. import {firebase_config} from “…/…/app/firebase.config”;
  3. import {Camera, CameraOptions} from “@ionic-native/camera”;

#8

Only if you remove all three? Doesn’t really make sense that both Firebase and the Camera plugin break it.


#9


#10

Have you added Camera to your providers array?

As talked about here.


#11

Thanks SigmundFroyd its solved.