Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70908 articles
Browse latest View live

Android Studio isn't updating with latest code changes

$
0
0

Android Studio doesn’t seem to be reflecting changes made in the app. These changes show in the web version. As a test I made a slight change to the string inside an alert() popup but even that is not showing on the app in testing.

How can I get Android Studio and my test phone to recognize new code changes? I thought it was supposed to be automagic?

I’ve:

  • Run npx cap sync android
  • Uninstalled the app from my phone
  • Run Sync Project with Gradle Files
  • Reload All from Disk
  • Invalidated Caches/Restart
  • Run Build --> Rebuild project
  • Deleted the Android folder and re-ran ngx cap add android
  • Tried both a physical phone and an emulator

No luck.

1 post - 1 participant

Read full topic


Ionic router push same page

$
0
0

I’m using a ionic stencil starter pwa with ionic router .

I’m in a page and I need to push again that same page but with a different prop, so the page will be loaded from the start with the new prop and re-render.

I’m using

const navCtrl: HTMLIonRouterElement = await(this.nav as any).componentOnReady();
navCtrl.push("/pagename/" + prop + "/", "root"); 

if I’m in a different page, my push works correctly. the problem is when I’m in the same page, nothing happens.

Why this happens? there Is a way to make it works?

1 post - 1 participant

Read full topic

How to convert PDF file to base64 string in ionic

$
0
0

Hello All,

im looking for a way to convert PDF File to base64 string .

i have tried with the ionic base64 plugin which works on Android but for for IOS.

i have also tried the below file plugin

this.file.readAsDataURL(“file:///Users/venkatswamydandaboina/Library/Developer/CoreSimulator/Devices/9A8C76B7-F443-409E-8B62-377E7713DB67/data/Containers/Data/Application/D1AD60AE-D75C-4065-8B44-32470A3DA5DA/Library/NoCloud/”, fileName).then(
file64 => {

                            console.log('file in 64: ', file64);
                             this returns  == data:application/pdf;base64
                          
                          }).catch(err => {
                          console.log('booooooo');
                        });

but it doesnt returns base64 string it only returns “data:application/pdf;base64”.

Please help me out.
Thanks

1 post - 1 participant

Read full topic

@ngx/translate ts1086: An accessor cannot be declared in an ambient context

Ionic support for native apps build in objectiveC and Swift

$
0
0

Hello I am a iOS developer and new to ionic projects so would like to know if I could integrate any ionic projects in my existing application which is already developed in objectiveC and swift.Basically the need is to integrate a video calling feature build in ionic to my existing project so please suggest.

1 post - 1 participant

Read full topic

Low quality audio file when trying to record using media and file

$
0
0

Hello everyone,
I’m trying to record audio in android using media ( https://ionicframework.com/docs/native/media )
but the recorded audio has very low quality with noise when I play it back
Here is my code:

import { Component } from '@angular/core';
import { Media, MediaObject } from '@ionic-native/media/ngx';
import { File } from '@ionic-native/file/ngx';
import { Platform } from '@ionic/angular';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {


  filePath: string;
  recordedAudio: MediaObject;
  recording: Boolean = false;
  constructor(
    private media: Media,
    private file: File,
    public platform: Platform
  ) { }

  startRecord() {
    if (this.platform.is('android')) {

      console.log('Android');
      console.log(this.file.externalRootDirectory);
      this.filePath = this.file.externalRootDirectory + 'my_file.3gp';
      console.log(this.filePath)
      this.file.createFile(this.file.externalRootDirectory, 'my_file.3gp', true).then(() => {
        this.recordedAudio = this.media.create(this.file.externalRootDirectory.replace(/^file:\/\//, '') + 'my_file.3gp');
        this.recordedAudio.startRecord();
        window.setTimeout(() => this.recordedAudio.stopRecord(), 50000);
      });
    }
    this.recording = true;
  }

  stopRecord() {
    if (this.platform.is('android')) {
      this.recordedAudio.stopRecord();
      this.recordedAudio.release();
    }

  }

  playSelectedTrack() {
    // use AudioProvider to control selected track 
    if (this.platform.is('android')) {
      this.recordedAudio.play();
    }
  }

  pauseSelectedTrack() {
    // use AudioProvider to control selected track 
    if (this.platform.is('android')) {
      this.recordedAudio.pause();
    }
  }
}

1 post - 1 participant

Read full topic

Ionic 3 with platform add ios@6.0.0

$
0
0

my ionic info is

Ionic:

ionic (Ionic CLI) : 4.3.1
Ionic Framework : ionic-angular 3.9.6
@ionic/app-scripts : 3.2.1

Cordova:

cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : ios1 6.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 5.0.0, (and 26 other plugins)

System:

ios-sim : 8.0.2
NodeJS : v12.18.1 (/Users/admin/.nvm/versions/node/v12.18.1/bin/node)
npm : 6.14.5
OS : macOS
Xcode : Xcode 11.2.1 Build version 11B500

but still i get the error of

unable to load PlatformApi from platform. SyntaxError: Unexpected token …
Uncaught, unspecified “error” event. (The platform “ios” does not appear to be a valid cordova platform. It is missing API.js. ios not supported.)
any one can help me out this

1 post - 1 participant

Read full topic

Open app capacitor on android device (NOT WORKING)

$
0
0

ionic --version: 6.10.1

I can’t open my app from an android device using capacitor.
When I open the application my android device says it "x(name app folder) IT HAS STOPPED " with an alert
and the app closes.

I do on terminal - android studio (before):

  1. ionic cap copy android --prod
  2. ionic capacitor open android // open on Android Studio
  3. build --> build buildle --> build apk (from Android Studio)

I can install apk but not open ( IT HAS STOPPED )

Thanks.

1 post - 1 participant

Read full topic


Page is scrolling to bottom if previous page is scrolled to bottom

$
0
0

hey you guys, I have this annoying issue: I have a component listing some items. If I click the first item, the page displaying its info starts at the top just fine. If I scroll down and click the last item, or the item in the middle, the page displaying its info starts at the bottom/middle. I tried the following:

HTML file

<ion-content #content id="staticstart">
item info
</ion-content>

TS File

@ViewChild('content', {static: false}) private content: any;

ionViewWillEnter() {
        this.content.scrollToPoint(0, document.getElementById('staticstart').offsetTop, 300);
    }

but the page still starts at bottom/middle, depends on the item I click. Any thoughts? Thanks!

1 post - 1 participant

Read full topic

Tinnitus and hearing Loss

It is possible to Build application for IOS with Android plugins?

$
0
0

Hi, im developing an app for Android and IOS, im using Cordova-plugin-android-permissions to get phone’s UID, i read that for IOS i can get it using device object form codova
( device.uuid) and no permissions are needed, when i build IOS app an error apears:
Installing “cordova.plugin-android-permissions” for ios
[ERROR] An error occurred while running subprocess cordova.

should i generate another project for ios without android plugins? or
is there a way to exclude plugins in buils process?

Regards.

1 post - 1 participant

Read full topic

Why cordova background geolocation doesn't work as my expection?

$
0
0

I use cordova background geolocaiton plugin in my ionic 3 application.

    ionic cordova plugin add cordova-plugin-mauron85-background-geolocation@alpha
    npm install --save @ionic-native/background-geolocation@4

I expect the plugin work in background, once the device is moved over 40 meters, the plugin will trigger this.backgroundGeolocation.on(BackgroundGeolocationEvents.location) once, My code is like:

startBackgroundGeolocation() {
    const config: BackgroundGeolocationConfig = {
      desiredAccuracy: 10,
      stationaryRadius: 20,
      distanceFilter: 40,
      debug: true, //  enable this hear sounds for background-geolocation life-cycle.
      stopOnTerminate: false // enable this to clear background location settings when the app terminates
    };

    this.backgroundGeolocation.configure(config).then(() => {
      this.backgroundGeolocation
        .on(BackgroundGeolocationEvents.location)
        .subscribe((location: BackgroundGeolocationResponse) => {
          console.log("!!!!!!!!!!!!!!!!!!!!!!!!!! background geolocation !!!!!!!!!!!!!!!!!!!");
          console.log(location);
        });
    });
    this.backgroundGeolocation.start()
  }

But after backgroundGeolocation start, I find the behavior is not like my expectation.

  1. this.backgroundGeolocation.on(BackgroundGeolocationEvents.location) is triggered about ever 30 seconds without any device movement
  2. this.backgroundGeolocation.on(BackgroundGeolocationEvents.location) has been triggered many times, and the number of times increases one every ~30 seconds

for example, when it is first triggered, the log shows:

!!!!!!!!!!!!!!!!!!!!!!!!!! background geolocation !!!!!!!!!!!!!!!!!!!

in about 30 seconds, it is second triggered, log shows:

!!!!!!!!!!!!!!!!!!!!!!!!!! background geolocation !!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!! background geolocation !!!!!!!!!!!!!!!!!!!

in next about 30 seconds, it is third triggered, log shows:

!!!!!!!!!!!!!!!!!!!!!!!!!! background geolocation !!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!! background geolocation !!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!! background geolocation !!!!!!!!!!!!!!!!!!!

and so on.

I want .on(position) only be triggered when movement over 40 meters, and when it is triggered, just triggered once.

!!!!!!!!!!!!!!!!!!!!!!!!!! background geolocation !!!!!!!!!!!!!!!!!!!

I think there must be something wrong with my configuration setting, but I could not find the problem in the setting.

Could you please help if you familiar with cordova-background-geolocation plugin?

Thanks

3 posts - 2 participants

Read full topic

Does Exoplayer support with Hybrid Android App?

$
0
0

Hello there,
Hope you are doing well.

With regards, we are developing a hybrid video news android app(from our app: we are going to distribute the hyperlocal video news feed to end-users, only video content).

For the above, we are looking to integrate Exoplayer and the technologies we are using to develop the Hybrid Android App are:
Ionic, Angular JS, Node JS & MySQL

Does Exoplayer support with hybrid android app(Ionic, Angular Js, Node JS & MySQL)? or any plugin which needs to be integrated to use Exoplayer on our App?

Will wait to hear from you

Thanks & Regards
Kumar Vansh Moondra

1 post - 1 participant

Read full topic

Ionic Application successfully compiles but cordova runtime issues

$
0
0

Currently, I have undertaken the task of upgrading my Ionic application from version 3 to Ionic 5, In the process, I have upgraded all the different breaking changes to the application, and I am able to successfully build the application using these commands:

ng serve
ionic build
ionic build -prod

Once I have no compilation errors I use the following command to build the android application to test the changes:

ionic cordova build android

Once I get the application running on my emulator I get the following logs of different errors. I found different references online that showed similar issues but I was not able to use any of the solutions on my application. I just want to know what may be causing these issues and how I can resolve them?

E/eglCodecCommon: GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1
D/CordovaWebViewImpl: onPageDidNavigate(file:///android_asset/www/index.html)
D/EGL_emulation: eglMakeCurrent: 0xe5006e00: ver 3 0 (tinfo 0xcda96370)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 2
D/EGL_emulation: eglMakeCurrent: 0xe5006e00: ver 3 0 (tinfo 0xcda96370)
D/EGL_emulation: eglMakeCurrent: 0xe5006e00: ver 3 0 (tinfo 0xcda96370)
W/VideoCapabilities: Unrecognized profile 4 for video/hevc
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
D/EGL_emulation: eglMakeCurrent: 0xe5006e00: ver 3 0 (tinfo 0xcda96370)
W/cr_CrashFileManager: /data/user/0/com.clinakos.clinakos/cache/WebView/Crash Reports does not exist or is not a directory
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xcb74cdc0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xcb74cdc0: ver 3 0 (tinfo 0xcda96840)
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 0 0
D/eglCodecCommon: setVertexArrayObject: set vao to 2 (2) 0 0
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 0 0
E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/build/main.css
    Unable to open asset URL: file:///android_asset/www/build/main.js
E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/build/vendor.js
E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/build/polyfills.js
D/eglCodecCommon: setVertexArrayObject: set vao to 2 (2) 0 0
D/JsMessageQueue: Set native->JS mode to EvalBridgeMode
D/SystemWebChromeClient: file:///android_asset/www/cordova.js: Line 105 : Uncaught Error: cordova already defined
I/chromium: [INFO:CONSOLE(105)] "Uncaught Error: cordova already defined", source: file:///android_asset/www/cordova.js (105)
I/inakos.clinako: Background concurrent copying GC freed 21926(2031KB) AllocSpace objects, 3(60KB) LOS objects, 49% free, 1834KB/3MB, paused 1.849ms total 116.662ms
I/ShortcutBadger: Checking if platform supports badge counters, attempt 1/3.
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 0
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 5
I/ShortcutBadger: Checking if platform supports badge counters, attempt 2/3.
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
I/ShortcutBadger: Checking if platform supports badge counters, attempt 3/3.
W/ShortcutBadger: Badge counter seems not supported for this platform: unable to resolve intent: Intent { act=android.intent.action.BADGE_COUNT_UPDATE (has extras) }
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
    setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
    setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
    setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
    setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 4 3
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 4 9
    setVertexArrayObject: set vao to 0 (0) 4 3
D/SystemWebChromeClient: file:///android_asset/www/vendor.js: Line 31514 : Uncaught Error: Unexpected value 'SignaturePad' imported by the module 'SignupPageModule'. Please add a @NgModule annotation.
I/chromium: [INFO:CONSOLE(31514)] "Uncaught Error: Unexpected value 'SignaturePad' imported by the module 'SignupPageModule'. Please add a @NgModule annotation.", source: file:///android_asset/www/vendor.js (31514)
D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
D/eglCodecCommon: setVertexArrayObject: set vao to 1 (1) 0 0
D/SystemWebChromeClient: file:///android_asset/www/vendor.js: Line 90553 : Ionic Native: deviceready event fired after 309 ms
I/chromium: [INFO:CONSOLE(90553)] "Ionic Native: deviceready event fired after 309 ms", source: file:///android_asset/www/vendor.js (90553)
E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/assets/icon/favicon.ico```


dependencies:

"dependencies": {
    "@angular/common": "~9.1.6",
    "@angular/core": "~9.1.6",
    "@angular/forms": "~9.1.6",
    "@angular/platform-browser": "~9.1.6",
    "@angular/platform-browser-dynamic": "~9.1.6",
    "@angular/router": "~9.1.6",
    "@capacitor/core": "2.2.0",
    "@ionic-enterprise/cordova": "^9.0.3",
    "@ionic-native/background-fetch": "^5.27.0",
    "@ionic-native/background-mode": "^5.27.0",
    "@ionic-native/badge": "^5.27.0",
    "@ionic-native/camera": "^5.27.0",
    "@ionic-native/contacts": "^5.27.0",
    "@ionic-native/core": "^5.0.7",
    "@ionic-native/device": "^5.27.0",
    "@ionic-native/file": "^5.27.0",
    "@ionic-native/file-transfer": "^5.27.0",
    "@ionic-native/fingerprint-aio": "^5.27.0",
    "@ionic-native/firebase": "^5.27.0",
    "@ionic-native/http": "^5.27.0",
    "@ionic-native/in-app-browser": "^5.27.0",
    "@ionic-native/keyboard": "^5.27.0",
    "@ionic-native/local-notifications": "^5.27.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^5.0.0",
    "@ionic/storage": "2.1.3",
    "angular-signature-pad": "0.0.14",
    "cordova-android": "^9.0.0",
    "cordova-ios": "5.1.1",
    "cordova-plugin-add-swift-support": "^2.0.2",
    "cordova-plugin-advanced-http": "2.4.1",
    "cordova-plugin-background-mode": "^0.7.2",
    "cordova-plugin-badge": "^0.8.8",
    "cordova-plugin-camera": "^4.1.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-contacts": "^3.0.1",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-file": "6.0.2",
    "cordova-plugin-fingerprint-aio": "^1.6.0",
    "cordova-plugin-firebase-lib": "^5.1.1",
    "cordova-plugin-inappbrowser": "^3.2.0",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-local-notification": "^0.9.0-beta.3",
    "cordova-plugin-okhttp": "^2.0.0",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-wkwebview-engine": "^1.2.1",
    "hammerjs": "^2.0.8",
    "rxjs": "~6.5.1",
    "rxjs-compat": "^6.5.5",
    "signature_pad": "^3.0.0-beta.3",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },

1 post - 1 participant

Read full topic

IonRouterOutlet doesn't works ... even if with a blank project

$
0
0

Hi, Ionic starting to drive me crazy !
I build an app, everything works perfectly ! On android, with ionic serve … but I wanted to publish it online too. It’s not the first time I did that, I never had any issues. Impossible, white page.

So, I tried to create a new clean project with the blank template. If I run ionic build, and I publish the build folder ( with a “homepage”: “build/”, in the package.json ) I have any error message and a white page.

I spend my afternoon to try to find the issue, if I change the redirect from :

<Route exact path="/" render={() => <Redirect to="/home" />} />

to

<Route path="/" render={() => <Redirect to="/home" />} />

Everything works. Problems, I have a lot of routes in my apps, so impossible to remove the exact.

Do you have any idea ?
Thanks

1 post - 1 participant

Read full topic


Embedded HTML page is not rendered on random iOS device

$
0
0

We embedded an HTML page in an app but occasionally/randomly on iOS device the embedded page section is not rendered and displayed as empty/blank page.
There is no error recorded in server or client side.
Current workaround is to restart the app and the page will be rendered correctly.

Any of you encounter this case before? or any advise on the specific area that we need to investigate further?

Thank you!

1 post - 1 participant

Read full topic

Where to buy app template

$
0
0

Hi Guys,
I have been using IONIC for 3 years plus… I am coming from the Web Application mostly doing Web ERP.

I just want to find out where is the better place or website to buy App template for IONIC ? Best if have the UI/UX where they are selling their products or sevices ?

I mostly buy the template from codecayon but they have limited selection.

thank you

1 post - 1 participant

Read full topic

V4 : ion-select native wheelselector for IOS

$
0
0

Hi,

For ion-select in IOS, i want to have wheelselector design to display which ios provides by default in their native application. Is there a way i can achieve this design without using the wheelselector plugin ?

1 post - 1 participant

Read full topic

IONIC 3 input field cursor is scrolled when we are scroll form

Ionic Profile Page

$
0
0

Hi,

I am creating an app that is going to have the Profile page, can anyone help me with the design. I have created something but I am not happy with the look.

//sirsbusiso

1 post - 1 participant

Read full topic

Viewing all 70908 articles
Browse latest View live