Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 230493 articles
Browse latest View live

Ionic build for Browser core dumps

$
0
0

I have see this a couple of times but more building for android (I think) this is now core dumping building for browser.

Removed and added browser plugin back in.
Removed and added Node Models back in.

I get this

Running app-scripts build: --prod --platform browser --target cordova
[09:46:17] build prod started …
[09:46:17] clean started …
[09:46:17] clean finished in 2 ms
[09:46:17] copy started …
[09:46:17] deeplinks started …
[09:46:17] deeplinks finished in 61 ms
[09:46:17] ngc started …
[09:46:54] ngc finished in 37.13 s
[09:46:54] preprocess started …
[09:46:54] preprocess finished in 1 ms
[09:46:54] webpack started …
Platform is browser
no

[09:46:56]  copy finished in 38.53 s

<--- Last few GCs --->

 131239 ms: Mark-sweep 1353.7 (1434.6) -> 1353.6 (1434.6) MB, 1134.2 / 0.0 ms [allocation failure] [scavenge might not succeed].
 132414 ms: Mark-sweep 1353.7 (1434.6) -> 1353.7 (1434.6) MB, 1175.4 / 0.0 ms [allocation failure] [scavenge might not succeed].
 133595 ms: Mark-sweep 1353.7 (1434.6) -> 1353.7 (1434.6) MB, 1180.8 / 0.0 ms [allocation failure] [scavenge might not succeed].


<--- JS stacktrace --->
Cannot get stack trace in GC.
FATAL ERROR: MarkCompactCollector: semi-space copy, fallback in old gen Allocation failed - JavaScript heap out of memory
1: node::Abort() [ionic]
2: 0x7d017c [ionic]
3: v8::Utils::ReportApiFailure(char const*, char const*) [ionic]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [ionic]
5: v8::internal::MarkCompactCollector::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject*) [ionic]
6: v8::internal::MarkCompactCollector::VisitLiveObjects(v8::internal::MemoryChunk*, v8::internal::MarkCompactCollector::HeapObjectVisitor*, v8::internal::MarkCompactCollector::IterationMode) [ionic]
7: v8::internal::PageParallelJob<v8::internal::EvacuationJobTraits>::Task::RunInternal() [ionic]
8: v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [ionic]
9: v8::internal::MarkCompactCollector::EvacuateNewSpaceAndCandidates() [ionic]
10: v8::internal::MarkCompactCollector::CollectGarbage() [ionic]
11: v8::internal::Heap::MarkCompact() [ionic]
12: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [ionic]
13: v8::internal::Heap::CollectGarbage(v8::internal::GarbageCollector, char const*, char const*, v8::GCCallbackFlags) [ionic]
14: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [ionic]
15: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [ionic]
16: 0xf2914b079a7
Aborted (core dumped)

How to add header/footer to all pages (automatically)?

$
0
0

Can a forum admin please add “ionic-v4” category to this forum?

I have seen numerous posts asking about this but most require adding the code to the .page.ts of every page. Coming from a web CMS world, this obviously seems ridiculous.

As a test, i have set up my app.componet.html like this:

[header code here] [tab code here]

And sure enough this works perfectly. However, i have then added a back button into my header and it does not work/show. I will eventually also be adding a hamburger slide-out menu to the header; would it be safe to assume that will not work either?

My guess would be certain ionic functionality does not work outside of the component. Is this correct?

Is there a proper way to have a common header/footer without having to duplicate code in dozens of places?

Input cursor caret bug on IOS

Ionic cordova run android (native run issue)

$
0
0

@jusliong guess this is one way to fix someone else’s mistakes or backwards incompatibility. Thanks!

Big problem with ionic 1 push notification deep linking - need to log in each time after click the push

$
0
0

I develop a app with ionic 1, but from some reason, almost each time user get push notification, and click On it, the user should log-in again. something with the cookie i think… please help

Ionic 4 - Correct way of using Local Storage Variables

$
0
0

Sorry for my ignorance, but i have a question does the this.platform.ready() loads up on every route change?

Can I use sha256 function in Ionic?

$
0
0

Gracias, me ayudó mucho tu código. Solo que en ionic 4 tuve que usar

import * as CryptoJS from 'crypto-js';

Muchas gracias.

Ionic 4 App doesn't work properly on Android 9.X.X (V4)

$
0
0

Hi,

I have de following config in my ionic project

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (C:\Users\Dani\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.2.0
   @angular-devkit/build-angular : 0.13.8
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.8
   @ionic/angular-toolkit        : 1.4.1

Cordova:

   cordova (Cordova CLI) : 9.0.0
   Cordova Platforms     : android 8.0.0, browser 6.0.0, ios 5.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 10 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\Dani\AppData\Local\Android\sdk)
   NodeJS            : v10.15.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.4.1
   OS                : Windows 10

The app is not chrasing but for example I can’t use the gps. So i see that “Cordova Platforms : android 8.0.0” is pointing to 8.0. I was wondering how to update the platform to android 9.0.0.


ERR_CLEARTEXT_NOT_PERMITTED in debug app on Android

$
0
0

That seems to totally screw things up.

Unable to load PlatfromApi from platform. Error [Err_UNHANDLED_ERROR]" Unhandled error. (Does not appear to implement platform Api.)
Unhandled error. (The platform “cordova” does not appear to be a valid cordova platform. It is missing API.js. cordova not supported.)

And now I can re-install it.

Oh joy.

Error: Can not find module "core-js/features/array/find"

$
0
0

Hello, I have got some problems with my ionic-3 app. Firs of all everything was working good then I wanted to make some unit tests. Now, I am getting the error in the title when I make ionic serve

First of all I installed jasmine/karma etc. Then I got some test examples from https://github.com/ionic-team/ionic-unit-testing-example . Then when I run the test I got erros that say

Can not find module core-js/es6
Can not find module core-js/es7/reflect

Those where dependencies in the config file of test. Then I installed core-js but I got the same error, then I learned the right version should be core-js@2.5.x. After that this error is gone but another one came.

Your webpack version is too old use at least 4

Then as a result of this stackoverflow thread https://stackoverflow.com/questions/50973494/ionic-unit-testing-webpack-version instead of updating webpack version I downgraded the ts-loader and ts-node to the folllowing versons

"ts-loader": "^3.0.3",
 "ts-node": "^3.0.2",

And I got the following

kind of compiler errors but it worked. I mean tests got executed and passed.

But still I though I should not get these compiling errors and this time I tried instead of downgrading ts-loader and ts-node I updated the webpack to the latest without even knowing the current version because it wasn’t in my packeage.json file but it was loaded. Anyways, After updating webpack version nothing worked.

Jasmine/karma gave the same errors Can not find module core-js/es6 etc because I updated ts-node and ts-loader to their original/latest versions. BUt even worse even ionic serve gives me the error in the title.

What I tried:

  • Downgrade webpack back to 3.12.0

  • Install core-js latest and/or core-js@2.5.0

None of them worked again .I made a new project with same ionic version and checked the versions of webpack and core-js. Resullts were :

`-- @ionic/app-scripts@3.2.2
  `-- webpack@3.12.0

and for core-js

`-- (empty)

although it’s package.json doesn’t have webpack and core-js. and mine for webpack :

`-- @ionic/app-scripts@3.2.1
  `-- webpack@3.12.0

and for core-js

+-- core-js@2.5.0
+-- firebase@5.11.1
| `-- @firebase/polyfill@0.3.13
|   `-- core-js@3.0.1
+-- karma@4.1.0
| `-- core-js@2.6.9
`-- karma-webpack@3.0.5
  `-- babel-runtime@6.26.0
    `-- core-js@2.6.

And my current package.json is :

{
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "test": "karma start ./test-config/karma.conf.js",
    "test-ci": "karma start ./test-config/karma.conf.js --single-run",
    "test-coverage": "karma start ./test-config/karma.conf.js --coverage",
    "e2e": "npm run e2e-update && npm run e2e-test",
    "e2e-test": "protractor ./test-config/protractor.conf.js",
    "e2e-update": "webdriver-manager update --standalone false --gecko false"
  },
  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/camera": "^4.20.0",
    "@ionic-native/core": "~4.18.0",
    "@ionic-native/crop": "^4.20.0",
    "@ionic-native/file": "^4.20.0",
    "@ionic-native/file-path": "^4.20.0",
    "@ionic-native/file-transfer": "^4.20.0",
    "@ionic-native/firebase": "^4.20.0",
    "@ionic-native/geolocation": "^4.20.0",
    "@ionic-native/keyboard": "^4.20.0",
    "@ionic-native/native-storage": "^4.20.0",
    "@ionic-native/network": "^4.20.0",
    "@ionic-native/splash-screen": "~4.18.0",
    "@ionic-native/status-bar": "~4.18.0",
    "@ionic/storage": "^2.2.0",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "@scaffold-digital/ionic-hardware-buttons": "^1.1.0",
    "angularfire2": "^5.1.2",
    "cordova": "^8.1.2",
    "cordova-android": "7.1.4",
    "cordova-android-support-gradle-release": "3.0.0",
    "cordova-ios": "4.5.5",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-crop": "git+https://github.com/obeza/cordova-plugin-crop-with-ratio.git",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-filepath": "^1.5.1",
    "cordova-plugin-firebase": "git+https://github.com/dpa99c/cordova-plugin-firebase.git#GH-1057-April-05-android-build-issue",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^3.1.2",
    "cordova-plugin-nativestorage": "^2.3.2",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "core-js": "^2.5.0",
    "firebase": "^5.9.1",
    "ionic-angular": "3.9.3",
    "ionicons": "3.0.0",
    "promise-polyfill": "^8.1.0",
    "rxjs": "^6.3.3",
    "rxjs-compat": "^6.4.0",
    "sw-toolbox": "3.6.0",
    "time-ago-pipe": "^1.3.2",
    "webpack": "^3.0.0",
    "zone.js": "0.8.29"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.1",
    "@types/jasmine": "^3.3.13",
    "@types/node": "^12.0.4",
    "angular2-template-loader": "^0.6.2",
    "html-loader": "^0.5.5",
    "istanbul-instrumenter-loader": "^3.0.1",
    "jasmine": "^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.5",
    "karma-jasmine": "^2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-webpack": "^3.0.5",
    "null-loader": "^2.0.0",
    "protractor": "^5.4.2",
    "ts-loader": "^3.0.3",
    "ts-node": "^3.0.2",
    "typescript": "~2.6.2"
  },
  "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-geolocation": {},
      "cordova-plugin-camera": {},
      "com-badrit-base64": {},
      "cordova-plugin-file": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-filepath": {},
      "cordova-plugin-nativestorage": {},
      "cordova-plugin-crop": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-firebase": {},
      "cordova-android-support-gradle-release": {
        "ANDROID_SUPPORT_VERSION": "27.+"
      }
    },
    "platforms": [
      "ios",
      "android"
    ]
  }
}

Any help would be much appericaed. Thanks.

TypeError: undefined is not an object (evaluating 'this.variable')

$
0
0

This page is supposed to read a JSON and get the array I have stored but for whatever reason I cannot access a variable from within my constructor().

private recGalleries = new Array;

  constructor(private menu: MenuService, private nav: NavController) {
    GalleryData.Galleries.forEach(function(element) {
      this.recGalleries.push(element.name);         //<--ERR HERE
    });
    console.log(this.recGalleries);
  }

This is the error output:

Error: Uncaught (in promise): TypeError: undefined is not an object (evaluating 'this.recGalleries') http://localhost:8100/Pages-home-home-module.js:107:17 forEach@[native code] HomePage@http://localhost:8100/Pages-home-home-module.js:106:83 createClass@http://localhost:8100/vendor.js:58072:28 createDirectiveInstance@http://localhost:8100/vendor.js:57949:31 createViewNodes@http://localhost:8100/vendor.js:59175:59 createRootView@http://localhost:8100/vendor.js:59089:20 callWithDebugContext@http://localhost:8100/vendor.js:60097:30 create@http://localhost:8100/vendor.js:57428:43 createComponent@http://localhost:8100/vendor.js:57539:51 activateWith@http://localhost:8100/vendor.js:84220:68 activateRoutes@http://localhost:8100/vendor.js:72703:52 http://localhost:8100/vendor.js:72654:33 forEach@[native code] activateChildRoutes@http://localhost:8100/vendor.js:72653:36 activateRoutes@http://localhost:8100/vendor.js:72710:41 http://localhost:8100/vendor.js:72654:33 forEach@[native code] activateChildRoutes@http://localhost:8100/vendor.js:72653:36 activate@http://localhost:8100/vendor.js:72578:33 http://localhost:8100/vendor.js:72562:22 _next@http://localhost:8100/vendor.js:94594:39 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:96957:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 http://localhost:8100/vendor.js:91487:24 _trySubscribe@http://localhost:8100/vendor.js:88689:35 subscribe@http://localhost:8100/vendor.js:88675:35 subscribe@http://localhost:8100/vendor.js:88670:26 _innerSub@http://localhost:8100/vendor.js:96936:115 _next@http://localhost:8100/vendor.js:96926:23 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:96957:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:94884:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 _complete@http://localhost:8100/vendor.js:97124:33 complete@http://localhost:8100/vendor.js:89320:27 _complete@http://localhost:8100/vendor.js:89338:34 complete@http://localhost:8100/vendor.js:89320:27 _complete@http://localhost:8100/vendor.js:94879:38 complete@http://localhost:8100/vendor.js:89320:27 http://localhost:8100/vendor.js:99985:32 _trySubscribe@http://localhost:8100/vendor.js:88689:35 subscribe@http://localhost:8100/vendor.js:88675:35 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 _innerSub@http://localhost:8100/vendor.js:94874:90 _tryNext@http://localhost:8100/vendor.js:94868:23 _next@http://localhost:8100/vendor.js:94851:26 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 http://localhost:8100/vendor.js:91487:24 _trySubscribe@http://localhost:8100/vendor.js:88689:35 subscribe@http://localhost:8100/vendor.js:88675:35 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 subscribe@http://localhost:8100/vendor.js:88670:26 _innerSub@http://localhost:8100/vendor.js:96936:115 _next@http://localhost:8100/vendor.js:96926:23 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94039:34 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:97318:30 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:94884:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _next@http://localhost:8100/vendor.js:94600:30 next@http://localhost:8100/vendor.js:89308:23 notifyNext@http://localhost:8100/vendor.js:94884:30 _next@http://localhost:8100/vendor.js:88527:31 next@http://localhost:8100/vendor.js:89308:23 _complete@http://localhost:8100/vendor.js:93048:34 complete@http://localhost:8100/vendor.js:89320:27 _complete@http://localhost:8100/vendor.js:89338:34 complete@http://localhost:8100/vendor.js:89320:27 _complete@http://localhost:8100/vendor.js:89338:34 complete@http://localhost:8100/vendor.js:89320:27

TypeError: undefined is not an object (evaluating 'this.variable')

$
0
0

SOLVED:
In order to access the variables from the home page the line

GalleryData.Galleries.forEach(function(element) {
...
});

should be written

GalleryData.Galleries.forEach((element) => {
...
});

File download in ionic 4

$
0
0

I have been battling with file download in ionic 4 and it seems to be a big issue for me.
The below code is what i have tried using atlast but it seems not working as the same is downloading the file to a directory that i don’t have an idea in the device.

ownload(filename) {
const fileTransfer: FileTransferObject = this.transfer.create();
let name = filename.split("/");
let length = name.length;
const url ="http://vvvvvvvv.com/dashboardksi/api/uploads/" + name[length - 1];
console.log("clicked", name);
fileTransfer.download(url, this.file.dataDirectory + name[length - 1], true).then(entry => {
      console.log("download complete: " + entry.toURL());
    },
    error => {
      // handle error
      console.log("ERROR: ", error);
    }
  );

I don’t know how i can save it to like downloads folder or gallery like that in case of images.

Ionic 4 - Correct way of using Local Storage Variables

$
0
0

Hello everyone that tried to help i seem to know what my problem is, they way im using local storage its ok BUT when i try to verify if the user has been authenticated before, and use the this.router.navigate and this.router.navigateByUrl its when i get the problem with the local storage getting NULL or undefined.

After i removed that everything is working as intended.

Thanks again to all of you for taking the time answering my question and trying to help.

Ionic 4 - Android version 4.2.2

$
0
0

I created a project on ionic 4 using the platform android @ 8.0.0, where I was able to generate my APK that works on Android 4.4.X +. but I need to generate the APK that supports the version of Android 4.2.2 as it will run on a specific Tablet, I know I need to modify the android platform according to the version 4.2.2 SDK, but which command ?

for example ? must be … "@4.2.2 ? " if i try this i receive a error .


Ion-item theming doesn't work

$
0
0

I want to change the background color of the and remove the bottom bar from .
This is the css:

ion-item {
    padding: 10px;
    align-items: center;
    border-bottom: transparent !important;
}

This is the HTML:

<ion-item>
      <ion-label position="stacked">Email</ion-label>
      <ion-input [(ngModel)]="email" type="email"></ion-input>
</ion-item>

This is the outcome: (pardon the autocomplete)

Ionicitude package: Wikitude + Ionic

$
0
0

hello Tazaf,
I’m working in a AR app project where I try to use ionicitude and I want to communicate with AR view of wikitude.
I installed ionicitude package and I use ionicitude.calljavascript() function. when I built the project I get an error " Cannot find name ‘ionicitude’ "
I don’t know how to declare this variable, is there an import of ionicitude in app.module.ts
thank you for help

IONIC3 - Tab bar hit boxes off

$
0
0

On the IPhone 5S i can’t select a tab from the tab bar by tapping it directly. I have to tap slightly above it to activate the targeted tab button. (Here is a video showing the Problem.)

ionic info:

Ionic:

   ionic (Ionic CLI)  : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.3

Cordova:

   cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-webview 1.2.1, (and 17 other plugins)

System:

   ios-deploy : 1.9.4
   ios-sim    : 8.0.0
   NodeJS     : v10.15.3 (/usr/local/bin/node)
   npm        : 6.9.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.2.1 Build version 10E1001

How to fix this? (It’s kind of a blocker)

Error load resources in ionic 4 run android or ios

Ionic 4 Back Button not working

$
0
0

Hi,
I am pressing Hardware back button but not working, Please give me a solution

Viewing all 230493 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>