Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 48978 articles
Browse latest View live

Slow performance and slow switching tabs on ios device ionic v4.10.1

$
0
0

@Khaledesu wrote:

Hi everyone, I’m using firebase as a backend (real-time database).
the slow performance happens when I log in at the first time on the app the app is so so slow on ios device and it’s fast on android devices.
The app performance only becomes greater after :

  • Creating a new account
  • Close the app and perform autologin

I’ve tried everything
I tried to build the ios app with --prod – release
I tried to comment all the loading functions from the main page after the login
I tried to remove the platform several times and add different ios versions
I tried to remove lots of plugins that are not used anymore
I tried to install the WekWebview

the weird thing is the previous version of the application is working fine and its performance is greater than this one so I tried to run the previous version on my iPhone 7 plus and still it’s slow, do I have to downgrade my Cordova or ionic version or even node version?

It has been 3 continuous days continuous 7 hours each day.
Anyone experiencing the same problem? anyone know how to fix this?

Ionic:

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

Cordova:

   cordova (Cordova CLI) : 7.1.0
   Cordova Platforms     : ios
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 17 other plugins)

System:

   Android SDK Tools : 25.2.3 (/Users/khaledAlhindi/Library/Android/sdk)
   ios-deploy        : 1.9.4
   NodeJS            : v10.15.1 (/usr/local/bin/node)
   npm               : 5.3.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.1 Build version 10B61


com.synconset.imagepicker 2.1.10 "ImagePicker"
cordova-plugin-add-swift-support 1.6.0 "AddSwiftSupport"
cordova-plugin-camera 3.0.0 "Camera"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-enable-multidex 0.1.3 "Enable Multidex"
cordova-plugin-fcm-with-dependecy-updated 2.4.0 "Cordova FCM Push Plugin"
cordova-plugin-file 5.0.0 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-keyboard 1.2.0 "Keyboard"
cordova-plugin-photo-library 2.1.1 "Photo Library"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.3.0 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.2.0 "Cordova sqlite storage plugin"
cordova-support-android-plugin 1.0.1 "cordova-support-android-plugin"
cordova-support-google-services 1.2.1 "cordova-support-google-services"

Posts: 1

Participants: 1

Read full topic


Build Failed ionic v3

$
0
0

@dotman wrote:

I am getting error when i run ionic cordova build android --release

BUILD FAILED

Total time: 23.22 secs
Error: /Users/DOTMAN/Documents/ionic/Affinity-mobile/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Dex: Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the ‘java’ gradle plugin in a library submodule add
targetCompatibility = ‘1.7’
sourceCompatibility = ‘1.7’
to that submodule’s build.gradle file.
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
at com.android.dx.command.dexer.Main.processClass(Main.java:775)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:741)
at com.android.dx.command.dexer.Main.access$1200(Main.java:88)
at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1683)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:695)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:592)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:321)
at com.android.dx.command.dexer.Main.run(Main.java:292)
at com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:54)
at com.android.builder.core.DexByteCodeConverter.lambda$dexInProcess$0(DexByteCodeConverter.java:173)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:476)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.parseClass(Main.java:787)
at com.android.dx.command.dexer.Main.access$1600(Main.java:88)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1722)
at com.android.dx.command.dexer.Main.processClass(Main.java:773)
… 16 more

1 error; aborting

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:transformClassesWithDexForRelease’.

com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

[ERROR] An error occurred while running cordova build android --release (exit
code 1).

Posts: 2

Participants: 1

Read full topic

Ionic 4 CDN

$
0
0

@abird wrote:

I see that Ionic 4 is available via CDN from unpkg. However, the library on unpkg isn’t gzipped. I’m not even sure that option is available with unpkg. Are there plans for using a CDN with gzipped Ionic 4?

Ionic 4 is already remarkably small, but gzipping would make it even much smaller.

Posts: 1

Participants: 1

Read full topic

Is inappbrowser's beforeLoad event working for anyone

Cordova contacts plugin alternative

$
0
0

@reedrichards wrote:

Anyone is aware of an alternative to the Cordova contacts plugin, which is deprecated, to access, if the user is agree to, to the list of contacts of the device?

Posts: 2

Participants: 1

Read full topic

My app in IOS firing when swipe down my status bar

$
0
0

@hrmdhn wrote:

Hello,

i have problem with my app,

my ionic ios app, cannot firing
when i scrolling down status bar. my app firing

can you solve this case?

thank u

Posts: 1

Participants: 1

Read full topic

I have facing array map function

$
0
0

@flycoders_sourav wrote:

I tired to insert new object in my existing array but when i used this below code showing an error ERROR TypeError: “this is undefined” please help me out it would be appreciate

for(let j=0; j<this.rating.length;j++){
              var result = this.allpohotographer.map(function(el) {
                console.log(el)
                var o = Object.assign({}, el);
                o.averageRating = this.rating[j].averageRating
                return o;
              })
              console.log(result)
}

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Interactive bar

$
0
0

@planika wrote:

Hello,
It is any possibility to create interative bar like this on image? Vertical bar which is interactive with click and swipe event. On any event value of bar is changing.

bar

Do you have any idea? or tips for me?

Thanks !

Marcin

Posts: 1

Participants: 1

Read full topic


Problem with ion-item-sliding -IONIC 4

$
0
0

@ravo93 wrote:

Once I remove 1 element from the list, it stops sliding and I can’t remove other element. the Real problem is that I don’t have reported problems on my consolle :sweat_smile:. PLEASE HELP

html

 <ion-item-sliding *ngFor="let c of table.Consumptions">
      <ion-item>
        <ion-label>
          {{c.Ora}}&nbsp;-&nbsp;{{c.DescConsumazione}}
          <p style="color:white">{{c.Tempo}} minuti</p>
        </ion-label>
        <ion-label>
          <p style="color:white" text-right>{{c.Prezzo | currency:'EUR'}}</p>
        </ion-label>
      </ion-item>
      <ion-item-options side="end">
        <ion-item-option color="danger" (click)="delete(c)">
          <fa-icon [icon]="faTrashAlt"></fa-icon>
        </ion-item-option>
      </ion-item-options>
    </ion-item-sliding>

typescript (the function works correctly)

async delete(c) {
    this.alertCtrl.create({
      header: "Eliminare Consumazione?",
      cssClass: "costumAlert",
      buttons: [
        { text: "Annulla", role: "cancel" },
        {
          text: "Elimina",
          handler: () => {
            this.alertController.create({
              header: "Reinserire prodotto in magazzino?",
              cssClass: "costumAlert",
              buttons: [
                {
                  text: "no",
                  handler: () => {
                    c.Recharge = false;
                    this.table.Consumptions.splice(this.table.Consumptions.indexOf(c), 1);
                  }
                },
                {
                  text: "si",
                  handler: () => {
                    c.Recharge = true;
                    this.table.Consumptions.splice(this.table.Consumptions.indexOf(c), 1);
                  }
                }
              ]
            }).then(alert => alert.present())

          }
        },
      ]
    }).then(alert => alert.present());

Posts: 1

Participants: 1

Read full topic

Removed cordova-plugin-ionic and app not working anymore

$
0
0

@laurineWermann wrote:

Since I received alert from Ionic telling me that I have hit the Deploy limit, event though I never used Deploy, I decided to remove ionic pro from my app (at least to continue testing). I launched

cordova plugin rm cordova-plugin-ionic

and

npm rm @Ionic/pro

now when the app launch, I get this error and the splash screen is stucked. I don’t know if this.platform.ready() is even fired, it hit neither the “then” neither the “catch”. I put a console log juste before and it is hit, but after that, nothing.

Unhandled Promise rejection: Class not found ; Zone: &lt;root&gt; ; Task: Promise.then ; Value: Class not found undefined

Posts: 1

Participants: 1

Read full topic

Ionic input number pattern

Ionic best practices for reusable code

$
0
0

@JMourao wrote:

i have been developing my app with the programming ideology of reusing as much code as possible, with that i was creating custom components and using them initially the application behaved very well, but as the application started growing performance and behaviour started deteriorating.

I am currently optimizing the application and reading documentation, and i can’t seem to find any official information regarding do’s and don’ts, just in posts in forums and internet posts. What are the best practises for reusing code?

I read that for example a HEADER component for the whole application is a bad practise, as the application has 3 root components and ion-footer. How to reuse code here so that behaves properly with ionic?

Another example is the list & refresher component, if i want to have a component with a list that always has a specific refresher on top, this requires the ion-refresher to be enclosed near a . If the ion-content is inside of the component doesn’t it defeat the purpose of having to be a root component of a page?

TLDR: Is there any documentation of do’s and don’ts of ionic development and where can i read some limitations during development?

Posts: 1

Participants: 1

Read full topic

Version-stamping of generated resources on every build

$
0
0

@ccpizz wrote:

By default, a release build of an Ionic app uses fixed paths for resources such as JS, CSS, images, e.g:

index.html
build/vendor.js
build/main.js
build/main.css
build/polyfills.js
...etc

This is proving problematic with regards to caching when the app is accessed via a conventional browser, because browsers tend to aggressively cache js libraries and styles, and a manual cache purge is required in order for updates to show up. Also, if some CDN caching is used, then the cache should be manually flushed on CDN too.

Is there a way to force automatic file versioning for Ionic, so that on each build unique file names as created?

I.e. how to get Ionic to generate the following instead?

index.html
build/vendor.a66f828dca56eeb90e02.js
build/main.18b12496ca4a0f639e59.jss
build/main.ef8cbc5c544fd62b6df3.css
build/polyfills.77d2aa935bdcf01897be.js

I am looking at generating unique hashes on every build or using the last git commit hash or whatever other approaches exist for this.

Angular does this by default without having to do any explicit configurations, but I could not find how to enable this for Ionic.

Any hints?

Posts: 1

Participants: 1

Read full topic

Ionic App not working anymore

$
0
0

@yavorivanov wrote:

Hello,
A few days everything was working okay and unfortunately i don`t remember what i did, but now the app is not working as it should. I think i deleted the platforms folder and after adding again the platforms it stopped working. It added Android 7.0.0 and i had to remove it and installed 6.3.0 like before.

Ionic info:

Ionic:
ionic (Ionic CLI) : 4.10.2
Ionic Framework : ionic-angular 3.9.3
@ionic/app-scripts : 3.2.2
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 6.3.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 17 other plugins)
System:
NodeJS : v11.9.0 (C:\Program Files\nodejs\node.exe)
npm : 6.5.0
OS : Windows 10

Plugins:
com.scott.serviceDiscovery 0.2.0 “serviceDiscovery”
cordova-fabric-plugin 1.1.14-dev “cordova-fabric-plugin”
cordova-plugin-advanced-http 1.11.1 “Advanced HTTP plugin”
cordova-plugin-app-version 0.1.9 “AppVersion”
cordova-plugin-camera 3.0.0 “Camera”
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-document-viewer 0.9.10 “SitewaertsDocumentViewer”
cordova-plugin-file 6.0.1 “File”
cordova-plugin-geolocation 3.0.0 “Geolocation”
cordova-plugin-globalization 1.11.0 “Globalization”
cordova-plugin-ionic-keyboard 2.1.3 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 1.2.1 “cordova-plugin-ionic-webview”
cordova-plugin-nativegeocoder 3.1.3 “NativeGeocoder”
cordova-plugin-nativestorage 2.3.2 “NativeStorage”
cordova-plugin-network-information 2.0.1 “Network Information”
cordova-plugin-networkinterface 2.0.0 “NetworkInterface”
cordova-plugin-secure-storage 2.6.8 “SecureStorage”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-statusbar 2.4.2 “StatusBar”
cordova-plugin-whitelist 1.3.3 “Whitelist”
phonegap-plugin-barcodescanner 8.0.1 “BarcodeScanner”
phonegap-plugin-push 2.1.3 “PushPlugin”

I am using - “ionic cordova run android -lc” and there is nothing unusual there. After the splash screen i am getting this error and if i click cancel i can see the LoginPage but if click Login it will show the same error and if i click cancel it is only white page. I removed all plugins, but didnt help. I used ionic-cli 4.4.0 before but it is still not working.

I can upload only 3 images:

If i missed some information please let me know.

Posts: 1

Participants: 1

Read full topic

Accept input and show to user


IOS package build failed, PodFile?

$
0
0

@danieleelt wrote:

image

Hi all, i have an error building a package for IOS… the error seems “library not found for -lGoogleToolboxForMac”

First time i tried to build on xcode i got same error, then i updated my PodFile with this line " pod ‘GoogleToolboxForMac’ " and local build result successful :slight_smile:

But when i try the same solution with Ionic i get the same error again :persevere:

Someone can help me? <3 thanks

Posts: 1

Participants: 1

Read full topic

How to unblock the CORS policy

$
0
0

@gokulanathan wrote:

i tried apiurl in post method for signup page…

import { Injectable } from '@angular/core';
import { Http, Headers, HttpModule } from '@angular/http';
import 'rxjs/add/operator/map';

let apiUrl = 'http://aaaaa.in/outfit/index.php/api/v1/';

@Injectable()
export class AuthServiceProvider {

  constructor(public http: Http) {
    console.log('Hello AuthServiceProvider Provider');
  }
  public register(data){
    return new Promise((resolve, reject) => {
      let headers = new Headers();
      alert('11');
        headers.append('Content-Type', 'application/json');
        headers.append('Access-Control-Allow-Origin', '*');
         headers.append( 'Access-Control-Allow-Headers', 'Authorization, Content-Type' );

        //headers.append('Access-Control-Allow-Origin', 'http://localhost:8100');
//headers.append('Access-Control-Allow-Credentials', 'true');

        alert(apiUrl);
        this.http.post(apiUrl+'account', JSON.stringify(data), {headers: headers})
        
          .subscribe(res => {
            resolve(res.json());
           alert(Response);
          }, (err) => {
            reject(err);
          });
    });
  
  }

}

it shows the error like this…“Access to XMLHttpRequest at ‘http://aaaaa.in/outfit/index.php/api/v1/account’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.”

Posts: 1

Participants: 1

Read full topic

After importing into Android Studio

$
0
0

@viraj28 wrote:

Hi,

I created an app using ionic 3. Now I need to create a widget for the app, so I imported the project in Android studio after adding platform android.

The app builds and runs fine on the emulator after the import.

Now I am stuck. There’s just lot of files and i don’t see any of my code that i can understand. I don’t see any android Studio MainActivity or layouts as well.

I would like if someone were to guide me regarding this as I also need to create a Widget.

Posts: 1

Participants: 1

Read full topic

I cannot find the github link for ionic 4 components demo source examples

Ionic 4 BehaviorSubject gettting ionic storage

$
0
0

@saravananthemesoft wrote:

Hi i would like access ionic storage module inside be BehaviorSubject .

My Code below currently am using local storage i want to replace ionic storage

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { BehaviorSubject, Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { UserService } from "./user.service";

import { Token } from '../_models';

import { environment } from "../../environments/environment";

import { Storage } from "@ionic/storage";

@Injectable({ providedIn: "root" })
export class AuthenticationService {
  private currentTokenSubject: BehaviorSubject<Token>;
  public currentToken: Observable<Token>;

  constructor(
    private http: HttpClient,
    public storage: Storage,
    public user_ser: UserService
  ) {
    this.currentTokenSubject = new BehaviorSubject<Token>(
      JSON.parse(
        localStorage.getItem("currentUser") //Need to replace with ionic storage 
      )
    );
    this.currentToken = this.currentTokenSubject.asObservable();
  }

  public get currentTokenValue(): Token {
    return this.currentTokenSubject.value;
  }

  login(username: string, password: string) {
    return this.http
      .post<any>(`${environment.url}/oauth/token`, {
        username,
        password,
        grant_type: "password",
        client_id: environment.passport.client_id,
        client_secret: environment.passport.client_secret
      })
      .pipe(
        map(token => {
          if (token && token.access_token) {
            this.storage.ready().then(() => {
              this.storage.set("currentToken", token);
            });
            this.currentTokenSubject.next(token);
          }
          return token;
        })
      );
  }

  logout() {
    this.storage.remove("currentToken");
    this.currentTokenSubject.next(null);
  }
}

Posts: 1

Participants: 1

Read full topic

Viewing all 48978 articles
Browse latest View live


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