Image flickering when I auto-refresh the component ( Ionic angular ) - ionic-framework

For my app requires auto-refresh for every 5 sec. I have implemented in Ionic with angular. Initial page is loading the image URL ,but when I refresh the page automatically ,image is loading but it is flickering and again it is flickering after 5 sec and it is repeating for every 5 sec. but in android it is working fine flickering is not happening for every 5 sec image is replacing with new image or existing image without flickering. but for IOS only when I’m trying to refresh it is flickering.
example code:
1. Html file: tab1.page.html
<ion-grid class="dashgrid" *ngIf="roomApp != 0">
<div class="col-12">
<div class="row">
<div *ngFor="let item of roomApp">
<div class="box" style="width:155px;" [ngClass]="{
'redBorder':item.current_status == 0,
'greenBorder':item.current_status == 1,
'amberBorder':item.current_status == 2
}">
<div class="text-right">
<ion-icon (click)="editName(item.id,item.custom_appliance_name);" name="create"></ion-icon>
</div>
<p *ngIf="!item.custom_appliance_name" class='data font12 hometitle'>{{item.appliance_name}}</p>
<p *ngIf="item.custom_appliance_name" class='data font12 hometitle'>{{item.custom_appliance_name}}</p>
<img src="{{item.off_icon}}" *ngIf="item.current_status == 0" alt="" class="cardimg" />
<img src="{{item.on_icon}}" *ngIf="item.current_status == 1" alt="" class="cardimg" />
<img src="{{item.off_icon}}" *ngIf="item.current_status == 2" alt="" class="cardimg" />
<div class="d-flex justify-content-between">
<div *ngIf="item.current_status == 1 || item.current_status == 0">
<ion-toggle color="primary" style="padding-bottom: 4px;"
(click)="checkStatus(item.id,item.current_status)"
[checked]="item.current_status == 1 ? 'true' : 'false'"></ion-toggle>
<div *ngIf="item.current_status == 1" class="font10">On</div>
<div *ngIf="item.current_status == 0" class="font10">Off</div>
</div>
<div *ngIf="item.current_status == 2" class="d-flex align-items-center">
<div *ngIf="item.current_status == 2" class="font10 p-2"
style="background-color:red; color:#fff;border-radius:6px;">FAULTY</div>
</div>
<div>
<ion-toggle class="custom-toggle" (click)="checkNotification(item.id,item.notification_status)"
[checked]="item.notification_status == 1 ? 'true' : 'false'" style="padding-bottom: 4px;">
</ion-toggle>
<div class="font10">Notification</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ion-grid>
<ion-grid *ngIf="roomApp== 0" class="d-flex justify-content-center align-items-center red">
No Appliances found
</ion-grid>
2. TS file: tab1.page.ts
doRefresh() {
this.apiService.rooms(this.uid).subscribe(response => {
if (!response[‘error’]) {
localStorage.setItem(“appliances”, JSON.stringify(response[‘appliances’]));
this.allAppliance = response[‘appliances’];
this.roomApp = this.allAppliance[this.room_id];
}
else {
this.resError = response[‘error’];
}
},
(err) => {
console.log("error==> ", err);
if (err[‘status’] == 401) {
this.navController.navigateForward(’/login’);
localStorage.setItem(‘loginValue’, ‘logout’);
}
})
}
3. scss file: tab1.page.scss
ion-content ion-toolbar {
–background: transparent;
}
.box {
box-shadow: 0 2px 4px rgba(var(–ion-color-dark-rgb), 0.24);
margin: 10px;
text-align: center;
padding: 6px;
min-height: 190px;
}
.cardimg {
width: 84px;
height: 84px;
}
.data {
margin: 0;
}
.font12{
font-size:12px;
}
.font10{
font-size:10px;
}
.red{
color:gray;
height: 100vh;
}
.greenBorder{
border-bottom:4px solid green;
}
.redBorder{
border-bottom:4px solid gray;
}
.amberBorder{
border-bottom:4px solid red;
}
.loading{
background-color:transparent !important;
}
Package.json
{
"name": "vidut",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/common": "~8.2.14",
"#angular/core": "~8.2.14",
"#angular/forms": "~8.2.14",
"#angular/platform-browser": "~8.2.14",
"#angular/platform-browser-dynamic": "~8.2.14",
"#angular/router": "~8.2.14",
"#ionic-native/core": "^5.0.0",
"#ionic-native/device": "^5.24.0",
"#ionic-native/keyboard": "^5.25.0",
"#ionic-native/preview-any-file": "^5.30.0",
"#ionic-native/screen-orientation": "^5.26.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^5.0.0",
"bootstrap": "^4.4.1",
"cordova-browser": "6.0.0",
"cordova-ios": "6.1.1",
"cordova-plugin-ionic-webview": "^5.0.0",
"cordova-plugin-screen-orientation": "^3.0.2",
"core-js": "^2.5.4",
"es6-promise-plugin": "^4.2.2",
"highcharts": "^8.1.0",
"highcharts-angular": "^2.4.0",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.803.29",
"#angular/cli": "~8.3.23",
"#angular/compiler": "~8.2.14",
"#angular/compiler-cli": "~8.2.14",
"#angular/language-service": "~8.2.14",
"#ionic/angular-toolkit": "^2.1.1",
"#ionic/lab": "3.2.10",
"#types/jasmine": "~3.3.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"cordova-android": "^9.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-fcm-with-dependecy-updated": "^7.7.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-preview-any-file": "^0.1.7",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-preview-any-file": {},
"cordova-plugin-fcm-with-dependecy-updated": {}
},
"platforms": [
"android",
"browser",
"ios"
]
}
}
In Android it is working fine without flickering below you can see Gif.
In IOS it is not working ,it is flickering
can anyone help me from this issue

Related

Ionic App crashes on RazorpayCheckout.open razorpay gateway in android 10.0.0

When I attempt to open the Razorpay payment gateway for an online transaction, my application immediately crashes when function is execute.
Before accessing the gateway portal, the app crashes.
Used plugin: cordova plugin add com.razorpay.cordova --save
Plugin version : "com.razorpay.cordova": "1.4.14",
Android platform version : android 10.0.0
Package.json
{
"name": "My App",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/common": "~13.2.2",
"#angular/core": "~13.2.2",
"#angular/forms": "~13.2.2",
"#angular/platform-browser": "~13.2.2",
"#angular/platform-browser-dynamic": "~13.2.2",
"#angular/router": "~13.2.2",
"#awesome-cordova-plugins/core": "^5.43.0",
"#awesome-cordova-plugins/onesignal": "^5.44.0",
"#awesome-cordova-plugins/status-bar": "^5.43.0",
"#capacitor/app": "1.1.1",
"#capacitor/haptics": "1.1.4",
"#capacitor/keyboard": "1.2.2",
"#capacitor/status-bar": "1.0.8",
"#ionic-native/core": "^5.36.0",
"#ionic/angular": "^6.0.0",
"#ionic/cordova-builders": "^6.1.0",
"#ionic/storage": "^2.2.0",
"com.razorpay.cordova": "1.4.14",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^5.0.0",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"rxjs": "~6.6.0",
"tslib": "^2.2.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "~13.2.3",
"#angular-eslint/builder": "~13.0.1",
"#angular-eslint/eslint-plugin": "~13.0.1",
"#angular-eslint/eslint-plugin-template": "~13.0.1",
"#angular-eslint/template-parser": "~13.0.1",
"#angular/cli": "~13.2.3",
"#angular/compiler": "~13.2.2",
"#angular/compiler-cli": "~13.2.2",
"#angular/language-service": "~13.2.2",
"#ionic/angular-toolkit": "^6.0.0",
"#types/jasmine": "~3.6.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"#typescript-eslint/eslint-plugin": "5.3.0",
"#typescript-eslint/parser": "5.3.0",
"cordova-android": "^10.0.0",
"cordova-browser": "^6.0.0",
"cordova-sqlite-storage": "^6.0.0",
"eslint": "^7.6.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"onesignal-cordova-plugin": "^3.1.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"typescript": "~4.4.4"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-sqlite-storage": {},
"onesignal-cordova-plugin": {},
"com.razorpay.cordova": {}
},
"platforms": [
"browser",
"android"
]
}
}
Razorpay function
payWithRazor(res) {
var options = {
description: 'Credits towards consultation',
image: 'image.png',
currency: res.currency, // your 3 letter currency code
key: this.globalVar.razorpayKey, // your Key Id from Razorpay dashboard
amount: res.amount, // Payment amount in smallest denomiation e.g. cents for USD
name: this.globalVar.loginInfo.firstName + ' ' + this.globalVar.loginInfo.lastName,
order_id: res.id,
prefill: {
email: '',
contact: '9825098250',
name: this.globalVar.loginInfo.firstName + ' ' + this.globalVar.loginInfo.lastName
},
theme: {
color: '#ff6657'
},
modal: {
ondismiss: function () {
alert('dismissed')
}
}
};
RazorpayCheckout.open(options);
var successCallback = (payment_id) => {
alert('payment_id: ' + JSON.stringify(payment_id));
this.razorPaymentDetails = payment_id;
console.log(this.razorPaymentDetails);
this.fnPlaceOrderAPI();
};
var cancelCallback = (error) => {
// alert(error.description + ' (Error ' + error.code + ')');
this.toast.toastShow(error.description + ' (Error ' + error.code + ')')
};
RazorpayCheckout.on('payment.success', successCallback);
RazorpayCheckout.on('payment.cancel', cancelCallback);
}
Need help !!

How to get base64 file size while choosing image from mobile device in ionic with #ionic-native/camera

// in Component
pickImage(sourceType) {
const options: CameraOptions = {
quality: 100,
sourceType: sourceType,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
correctOrientation:true
}
this.camera.getPicture(options).then((imageData) => {
console.log("imageData", imageData);
this.base64Image = 'data:image/jpeg;base64,' + imageData;
// I want to get file size here
// because i want to validate image of size 2MB or less
}, async (err) => {
console.log("err", err);
const toast = await this.toastController.create({
message: 'Error Occurs',
duration: 3000,
position: 'bottom',
color: "danger",
animated: true,
});
toast.present();
});
}
my package.json
{
"name": "ionic-conference-app",
"version": "0.0.0",
"description": "Ionic Conference App",
"author": "Ionic Team <hi#ionicframework.com>",
"license": "Apache-2.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "webdriver-manager update --standalone false --gecko false"
},
"repository": {
"type": "git",
"url": "https://github.com/ionic-team/ionic-conference-app.git"
},
"private": true,
"dependencies": {
"#angular/animations": "^8.2.14",
"#angular/cdk": "~8.2.3",
"#angular/common": "^8.2.14",
"#angular/core": "^8.2.14",
"#angular/forms": "^8.2.14",
"#angular/material": "^8.2.3",
"#angular/platform-browser": "^8.2.14",
"#angular/platform-browser-dynamic": "^8.2.14",
"#angular/pwa": "^0.803.23",
"#angular/router": "^8.2.14",
"#angular/service-worker": "^8.2.14",
"#capacitor/android": "^1.5.1",
"#capacitor/core": "1.5.1",
"#ionic-native/camera": "^5.24.0",
"#ionic-native/core": "5.0.0-beta.15",
"#ionic-native/file": "^5.24.0",
"#ionic-native/google-plus": "^5.23.0",
"#ionic-native/in-app-browser": "5.0.0-beta.15",
"#ionic-native/native-storage": "^5.23.0",
"#ionic-native/social-sharing": "^5.24.0",
"#ionic-native/splash-screen": "5.0.0-beta.15",
"#ionic-native/status-bar": "5.0.0-beta.15",
"#ionic/angular": "^5.0.4",
"#ionic/storage": "^2.1.3",
"angularfire2": "^5.4.2",
"chart.js": "^2.9.3",
"cordova-android": "^7.0.0",
"cordova-browser": "^6.0.0",
"cordova-ios": "^5.1.1",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-inappbrowser": "^3.2.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-socialsharing": "^5.6.5",
"core-js": "^3.6.4",
"es6-promise-plugin": "^4.2.2",
"firebase": "^7.13.2",
"hammerjs": "^2.0.8",
"ng-payment-card": "0.0.8",
"rxjs": "^6.5.4",
"sw-toolbox": "3.6.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"#angular-devkit/architect": "^0.803.23",
"#angular-devkit/build-angular": "^0.803.23",
"#angular-devkit/core": "^8.3.23",
"#angular-devkit/schematics": "^8.3.23",
"#angular/cli": "^8.3.23",
"#angular/compiler": "^8.2.14",
"#angular/compiler-cli": "^8.2.14",
"#angular/language-service": "^8.2.14",
"#capacitor/cli": "1.5.1",
"#ionic/angular-toolkit": "^2.1.2",
"#ionic/lab": "^2.0.19",
"#types/jasmine": "3.4.6",
"#types/jasminewd2": "2.0.8",
"#types/node": "^12.12.26",
"codelyzer": "^5.2.1",
"jasmine-core": "^3.5.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-reporter": "2.1.1",
"karma-jasmine": "2.0.1",
"karma-jasmine-html-reporter": "1.4.2",
"protractor": "^5.4.3",
"puppeteer": "^1.20.0",
"ts-node": "8.5.0",
"tslint": "^5.20.1",
"typescript": "~3.5.3"
},
"cordova": {
"platforms": [
"ios",
"browser",
"android"
],
"plugins": {
"cordova-plugin-device": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-file": {}
}
}
}
Your application seems to be built on capacitor, so you can use the capacitor inbuilt camera plugin.
https://capacitor.ionicframework.com/docs/apis/camera/
You can specify under CameraOptions - resultType:CameraResultType.Base64, how data is returned.

d3 bar chart using ionic 4 failed to load on device on -- prod mode

i am building bar charts using D3, it runs fine when i run with ionic cordova run/build android but it gives error when i run with --prod mode i.e ionic cordova run/build android --prod. The app opens fine but the bar chart do not draw. The x-axis draws fine but it is unable to draw y- axis. can someone please help. I have attached the image of my error message below. I am stuck in this for the past few days, any help would be really helpful. Thanks in advance
**here is mycode** //
import { Component } from '#angular/core';
import { Platform } from '#ionic/angular';
import * as d3 from 'd3-selection';
import * as d3Scale from 'd3-scale';
import * as d3Array from 'd3-array';
import * as d3Axis from 'd3-axis';
#Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
barData = [
{ season: 'S1', viewers: 250000 },
{ season: 'S2', viewers: 380000 },
{ season: 'S3', viewers: 500000 },
{ season: 'S4', viewers: 690000 },
{ season: 'S5', viewers: 690000 },
{ season: 'S6', viewers: 750000 },
{ season: 'S7', viewers: 1000000 },
{ season: 'S8', viewers: 1700000 }
];
title = 'originals';
subtitle = 'Viewers per season for';
width: number;
height: number;
margin = { top: 20, right: 20, bottom: 30, left: 40 };
x: any;
y: any;
svg: any;
g: any;
constructor(private _platform: Platform) {
this.width = 900 - this.margin.left - this.margin.right;
this.height = 500 - this.margin.top - this.margin.bottom;
}
ionViewDidEnter() {
this.init();
this.initAxes();
this.drawAxes();
this.drawChart();
}
init() {
this.svg = d3.select('#barChart')
.append('svg')
.attr('width', '100%')
.attr('height', '100%')
.attr('viewBox', '0 0 900 500');
this.g = this.svg.append('g')
.attr('transform', 'translate(' + this.margin.left + ',' + this.margin.top + ')');
}
initAxes() {
this.x = d3Scale.scaleBand().rangeRound([0, this.width]).padding(0.1);
this.y = d3Scale.scaleLinear().rangeRound([this.height, 0]);
this.x.domain(this.barData.map((d) => d.season));
this.y.domain([0, d3Array.max(this.barData, (d) => d.viewers)]);
}
drawAxes() {
this.g.append('g')
.attr('class', 'axis axis--x')
.attr('transform', 'translate(0,' + this.height + ')')
.call(d3Axis.axisBottom(this.x))
.attr('font-size', '30');
this.g.append('g')
.attr('class', 'axis axis--y')
.call(d3Axis.axisLeft(this.y))
.append('text')
.attr('class', 'axis-title')
.attr('transform', 'rotate(-90)')
.attr('y', 6)
.attr('dy', '0.71em')
.attr('text-anchor', 'end')
.attr('fill', 'rgb(34, 167, 240)')
.attr('font-size', '50')
.text('viewers');
}
drawChart() {
this.g.selectAll('.bar')
.data(this.barData)
.enter()
.append('rect')
.attr('class', 'bar')
.attr('fill', 'rgb(34, 167, 240)')
.attr('x', (d) => this.x(d.season))
.attr('y', (d) => this.y(d.viewers))
.attr('width', this.x.bandwidth())
.attr('height', (d) => this.height - this.y(d.viewers));
}
}
**pacjage.json**
{
"name": "example",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/common": "~8.1.2",
"#angular/core": "~8.1.2",
"#angular/forms": "~8.1.2",
"#angular/platform-browser": "~8.1.2",
"#angular/platform-browser-dynamic": "~8.1.2",
"#angular/router": "~8.1.2",
"#ionic-native/android-permissions": "^5.17.1",
"#ionic-native/camera": "^5.17.1",
"#ionic-native/core": "^5.0.0",
"#ionic-native/document-viewer": "^5.17.0",
"#ionic-native/file": "^5.17.0",
"#ionic-native/file-opener": "^5.17.0",
"#ionic-native/file-transfer": "^5.17.0",
"#ionic-native/local-notifications": "^5.17.1",
"#ionic-native/network": "^5.17.0",
"#ionic-native/screen-orientation": "^5.17.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^4.7.1",
"#ionic/storage": "^2.2.0",
"cordova-android": "8.1.0",
"cordova-browser": "6.0.0",
"cordova-plugin-android-permissions": "^1.0.2",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-document-viewer": "^0.9.13",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener2": "^2.2.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-network-information": "^2.0.2",
"cordova-plugin-screen-orientation": "^3.0.2",
"cordova-sqlite-storage": "^3.4.0",
"core-js": "^2.5.4",
"d3": "^5.14.2",
"es6-promise-plugin": "^4.2.2",
"jquery": "^3.4.1",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"#angular-devkit/architect": "~0.801.2",
"#angular-devkit/build-angular": "~0.801.2",
"#angular-devkit/core": "~8.1.2",
"#angular-devkit/schematics": "~8.1.2",
"#angular/cli": "~8.1.2",
"#angular/compiler": "~8.1.2",
"#angular/compiler-cli": "~8.1.2",
"#angular/language-service": "~8.1.2",
"#ionic/angular-toolkit": "^2.1.1",
"#types/jasmine": "~3.3.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-network-information": {},
"cordova-sqlite-storage": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-document-viewer": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-file-transfer": {},
"cordova-plugin-file": {},
"cordova-plugin-file-opener2": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-android-permissions": {},
"cordova-plugin-local-notification": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
}
},
"platforms": [
"browser",
"android"
]
}
}
**here is the image of my error message**
[1]: https://i.stack.imgur.com/zs5KM.png
Finally it started working after i added
this.g.append('g')
.call(d3Axis.axisLeft(this.y).tickFormat ((d: any) => {
return d;
})
)
It seemed tickformat is necessary while running in production mode. anyway still thanks.

How to solve Source path does not exist: resources/android/xml/network_security_config.xml

I do build with ionic 4.
ionic cordova build android
Got this error
cordova build android
Source path does not exist:
resources/android/xml/network_security_config.xml [ERROR] An error
occurred while running subprocess cordova.
I removed this part from config.xml. Is it fine?
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="#xml/network_security_config" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
package.json
{
"name": "morenito",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "~8.0.1",
"#angular/cdk": "8.0.1",
"#angular/material": "8.0.1",
"#angular/common": "~8.1.2",
"#angular/compiler": "~8.1.2",
"#angular/core": "~8.1.2",
"#angular/forms": "~8.1.2",
"#angular/http": "^7.2.2",
"#angular/platform-browser": "~8.1.2",
"#angular/platform-browser-dynamic": "~8.1.2",
"#angular/router": "~8.1.2",
"#ionic-native/base64": "^5.5.1",
"#ionic-native/base64-to-gallery": "^5.6.0",
"#ionic-native/camera": "^5.10.0",
"#ionic-native/camera-preview": "^5.4.0",
"#ionic-native/core": "^5.0.0",
"#ionic-native/file": "^5.4.0",
"#ionic-native/file-chooser": "^5.4.0",
"#ionic-native/file-path": "^5.5.1",
"#ionic-native/file-transfer": "^5.5.1",
"#ionic-native/image-picker": "^5.5.1",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^4.7.1",
"browser": "^0.2.6",
"cordova-android": "^8.0.0",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-ionic-webview": "^4.1.1",
"cordova-plugin-telerik-imagepicker": "^2.3.3",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"highcharts": "^7.1.1",
"highcharts-angular": "^2.4.0",
"highcharts-more": "^0.1.7",
"highcharts-more-node": "^5.0.13",
"moment": "^2.24.0",
"ng2-charts": "^2.0.3",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"#angular-devkit/architect": "~0.801.2",
"#angular-devkit/build-angular": "~0.801.2",
"#angular-devkit/core": "~8.1.2",
"#angular-devkit/schematics": "~8.1.2",
"#angular/cli": "~8.1.2",
"#angular/compiler": "~8.1.2",
"#angular/compiler-cli": "~8.1.2",
"#angular/language-service": "~8.1.2",
"#ionic/angular-toolkit": "~2.0.0",
"#types/jasmine": "~3.3.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
}
,
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-telerik-imagepicker": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
}
},
"platforms": [
"android"
]
}
}
FOR VALIDATOR ONLY: Is it a stackoverflow or an art competition? Hello validator - you bother me day by day. This post contains enough of text.
Examine the resources folder if the xml folder exists in /android, if it doesn't just create it like..
resources/
android/
xml/
network_security_config.xml
Enter the following inside the file
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>
I also got that error check this
https://github.com/ionic-team/starters/issues/758
in android platform in ionic
<platform name="android">
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="#xml/network_security_config" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="res/xml/network_security_config.xml" />
<allow-intent href="market:*" />
within your project: resources => android => create folder "xml" create file.xml:
network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>`
H guys, I did have also this problem, my fix to It was, in config.xml remove this line <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" /> and It works for me.

Ionic 2 form wont capture form values

So I have a form that looks like this. Each input field is the same so theres no need to post all 241 of them.
My problem is that I cant access the from values through something like formData.general_information_first_name because it return "" nothing.
All of my fields are returning invalid even when the requirements have been met.
<ion-content>
<form #formData="authForm" (submit)="onSubmit(authForm.value)">
<ion-item-group>
<!-- <button light block >{{'HOME | translate'}}</button> -->
<ion-item-divider light>{{'INFORMATION_TO_COMPLETE_LOAN_APPLICATION' | translate}}</ion-item-divider>
<ion-item>
<ion-label fixed="first_name">{{'FIRST_NAME' | translate}}</ion-label>
<ion-input ngControl="general_information_first_name" type="text" value=""></ion-input>
</ion-item>
</ion-content>
My corresponding .ts file
import {Component} from "#angular/core";
import {TranslatePipe} from "ng2-translate/ng2-translate";
import {FORM_DIRECTIVES, FormBuilder, ControlGroup, Validators, AbstractControl} from '#angular/common';
import {CustomValidators} from './custom-validators';
#Component({
templateUrl: 'build/pages/us-loan/us-loan.html',
pipes: [TranslatePipe],
directives: [FORM_DIRECTIVES]
})
export class UsCitizenPage {
authForm: ControlGroup;
general_information_first_name: AbstractControl;
constructor(private fb: FormBuilder) {
this.authForm = this.fb.group({
'general_information_first_name': ['', Validators.compose([Validators.required, CustomValidators.onlyLetters])]
});
this.general_information_first_name = this.authForm.controls['general_information_first_name'];
}
onSubmit(formData) {
console.log('Form submitted is ', formData);
debugger;
if(this.authForm.valid) {
console.log('Submitted value: ', formData);
debugger;
}
}
my angular and ionic version information :
{
"dependencies": {
"#angular/common": "2.0.0-rc.3",
"#angular/compiler": "2.0.0-rc.3",
"#angular/core": "2.0.0-rc.3",
"#angular/http": "2.0.0-rc.3",
"#angular/platform-browser": "2.0.0-rc.3",
"#angular/platform-browser-dynamic": "2.0.0-rc.3",
"es6-shim": "^0.35.0",
"ionic-angular": "2.0.0-beta.10",
"ionic-native": "1.3.2",
"ionicons": "3.0.0",
"ng2-translate": "^2.2.2",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12"
},
"devDependencies": {
"del": "2.2.0",
"gulp": "^3.9.1",
"gulp-uglify": "^2.0.0",
"gulp-watch": "4.3.5",
"ionic-gulp-browserify-typescript": "2.0.0",
"ionic-gulp-fonts-copy": "^1.0.0",
"ionic-gulp-html-copy": "^1.0.0",
"ionic-gulp-sass-build": "^1.0.0",
"ionic-gulp-scripts-copy": "^2.0.0",
"run-sequence": "1.1.5"
},
}