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

Ionic Pro: Failed to upload apk to storage

$
0
0

@attilamarton wrote:

Hello,

Every week I’m having issues with Ionic Pro’s build service and it’s getting really annoying. This week’s issue is the following:

Exception in thread "main" java.io.IOException: No space left on device
	at java.io.FileOutputStream.writeBytes(Native Method)
	at java.io.FileOutputStream.write(FileOutputStream.java:326)
	at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
	at org.gradle.wrapper.Download.downloadInternal(Download.java:74)
	at org.gradle.wrapper.Download.download(Download.java:45)
	at org.gradle.wrapper.Install$1.call(Install.java:62)
	at org.gradle.wrapper.Install$1.call(Install.java:48)
	at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
	at org.gradle.wrapper.Install.createDist(Install.java:48)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Error: /usr/src/app/platforms/android/gradlew: Command failed with exit code 1 Error output:
Exception in thread "main" java.io.IOException: No space left on device
	at java.io.FileOutputStream.writeBytes(Native Method)
	at java.io.FileOutputStream.write(FileOutputStream.java:326)
	at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
	at org.gradle.wrapper.Download.downloadInternal(Download.java:74)
	at org.gradle.wrapper.Download.download(Download.java:45)
	at org.gradle.wrapper.Install$1.call(Install.java:62)
	at org.gradle.wrapper.Install$1.call(Install.java:48)
	at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
	at org.gradle.wrapper.Install.createDist(Install.java:48)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Failed to upload apk to storage please retry your build.
Running after script...
$ clean-up
Cleaning up files...
Successful clean up
ERROR: Job failed: exit status 1

Any idea how to contact them in a quick fashion so they can look into it and not wait 48 hours to respond through Zendesk?

Best regards

Posts: 1

Participants: 1

Read full topic


Android Build Error (EACCES)

$
0
0

@texasman03 wrote:

Hey All,

I’m trying to do a fresh build for android --device, and I get this error:

ANDROID_HOME=/Users/mobiledeveloper/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
Error: spawn EACCES

Here’s my info:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.15.1
    ionic (Ionic CLI) : 3.15.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 6.3.0 browser 5.0.1 ios 4.5.2
    Ionic Framework    : ionic-angular 3.7.1

System:

    ios-deploy : 1.9.2
    Node       : v8.4.0
    npm        : 2.15.12
    OS         : macOS Sierra
    Xcode      : Xcode 9.0.1 Build version 9A1004

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy

Posts: 1

Participants: 1

Read full topic

How to call a method from response allDocs(err, response)

$
0
0

@Bancker wrote:

I created an app that uses pouchdb. When it starts up and the localdb is empty I want the app to load data into the localdb from a json file. If there is data in the localdb I want the app to sync from a remote source. All separate functions work. So it can load from the JSON file and it can sync when I call the methods from seperate buttons.
But in the startup checks of the app I’m doing something wrong:

  startupCheck()
  {
    console.log('startupCheck start');
    this._localdb.allDocs(function(err, response)
    {
      if (err)
      {
        return console.log(err);
      }
      if (response.rows.length == 0)
      {
        // no records in localdb
        console.log('Load initial data from json file');
        this.jsonInit();
      }
      else
      {
          // there are records. now check for updates on server
          console.log('Sync data from server to localdb');
          this.replicateFromRemote();
      }
    });
    console.log('startupCheck end');
  }

The error:

ERROR Error: Uncaught (in promise): TypeError: Unable to get property ‘replicateFromRemote’ of undefined or null reference.
TypeError: Unable to get property ‘replicateFromRemote’ of undefined or null reference

It seems I cannot make a call to this._anyfunction() from a response. I also tried setting a flag like:

this._dbNeedsInit = true;

Also then I will get a null reference error.
Any suggestions?

Posts: 1

Participants: 1

Read full topic

Angularfire2 logout

$
0
0

@angusallman wrote:

Hi there,
I’m making a login for my app using angularfire2 for the user authentication and I’m having a bit of trouble logging out.

The login works perfectly and so does the registration, but when I come to log out I get this error:

Error: permission_denied at /profile/AhGIYnvAz4akV94D6RGy26rhCcl1: Client doesn't have permission to access the desired data.

I’m not sure why it’s happening, I’ve had a look around google, from what I can see it’s something to do with not unsubscribing from an observable? but I can’t track it down or fix it.

here is my code to call my dashboard page (leaving that page causes the error to occur.)

export class DashboardPage {

  profileData: AngularFireObject<Profile>;
  profile: any;


  constructor(private toast: ToastController,
    private afAuth: AngularFireAuth,
    private afDatabase: AngularFireDatabase,
    public navCtrl: NavController,
    public navParams: NavParams,
    private fb: FireBaseProvider) {
  }


  ionViewDidLoad() {
    this.afAuth.authState.take(1).subscribe(data => {
      if(data && data.email && data.uid){
        this.toast.create({
          message: `welcome to APP_NAME, ${data.email}`,
          duration: 3000
        }).present();

        this.profileData = this.afDatabase.object(`profile/${data.uid}`);
          this.profileData.valueChanges().subscribe(data=>{
          this.profile = data;
        });

      }
    });
  }

  ionViewWillLeave(){
  }

  logout(){
    this.fb.logout().then(() => {
      this.navCtrl.setRoot('LoginPage');
    }
    );
  }

then here is my logout function from my firebase provider

  async logout(): Promise<any>{
    return this.afAuth.auth.signOut();
  }

it seems to log me out just fine but it it just throws that error soon after.

Thanks for the help!

Posts: 2

Participants: 2

Read full topic

Ionic binding performance

$
0
0

@Hanzo wrote:

Hi,

Is always the binding way the optimal way to represent information on an app?

For example on a only read page that the information is not intended to change, the binding way continously listening to changes.

Is possible to binding only one time?

Thanks

Posts: 1

Participants: 1

Read full topic

Ionic2 --prod error

$
0
0

@dram3vlh wrote:

i have some issues about compile my code with"ionci cordova run android myApp --prod --device",when i compiled with just " ionic cordova run android --device" is succesfull.What can i do for ths error;

Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exportedfunction (position 5:59 in the original .ts file), resolving symbol MeczanesReducer in /Users/…/meczanes.reducer.ts, resolving symbol AppModule in /Users/…/app.module.ts, resolving symbol AppModule in /Users/…/app.module.ts,
resolving symbol AppModule in /Users/…/app.module.ts

Posts: 1

Participants: 1

Read full topic

Can't use two-way binding ngModel in alertController

$
0
0

@pdj wrote:

let alert = this.alertCtrl.create({
        title: "abb",
        message:"Ababa.",
        buttons: [
          {
            text: 'no.',
            handler: data => {
              console.log("cancel")

            }
          },
          {
            text: 'yes',
            handler: data => {
                console.log(data);

                this.zone.run(()=>{
                  this.mention2="sis"
                  this.startDetail="should be changed dynamically"
                  console.log(this.startDetail);
                })


            }
          }
        ]
        })
        alert.present();

on html, I use <ion-searchbar [(ngModel)]=“startDetail” /> and

{{mention2}}

.
once chosen yes on dialog, it should be changed instantly, but docent’ work.
it applied only when I click(touch) searchbar changes applied…

Posts: 1

Participants: 1

Read full topic

Sharing data between pages in app

$
0
0

@Vartex05 wrote:

Hi, what is the best practice to share data between pages in my app? Is it better to use services, which holds data or for example event emitters? In the case of services, is it ok to access data directly or is it better to create getters and setters? Or for example expose properties in service as promises? And what about if i need, that data from services should be updated every time it changes. Can i expose some property in service as Observable, so when i subscribe to it, it will easily handle updating data in pages?

Thx for answer

Posts: 2

Participants: 2

Read full topic


Ng-include con Angular 4 and Ionic 3

$
0
0

@NurGuz wrote:

Hi guys,

I have two htmls that have a completely equal part of the code. I would like to be able to reuse that html code on a common page. In Angular 1 I used the ng-include or directives, but with ionic 3 and angular 4 I do not know what I should use.

Thank you

Posts: 1

Participants: 1

Read full topic

API request 404 (from cache) on Android device

$
0
0

@beck24 wrote:

I’m updating an existing app with a few bugfixes and attempting to get it ready for iphone x, but with the latest code I’m seeing a weird behavior on my android test device. On the device every call to the API fails. Inspecting with the chrome debugger shows it’s resulting in a 404 which it says is from cache. This doesn’t happen on ios or the browser, those hit the API just fine. Nothing has changed with the API code or the server availability, there’s no reason it should 404.

I have tested this with 2 different devices, so it’s not an issue of a quirky single device, and reinstalling the current version from google play work fine. So it’s something new and specific to android. The code for the API calls has not changed. Any ideas on what I can do?

Ionic Info:

cli packages: (/Users/mbeckett/sites/apps/wtm/node_modules)

    @ionic/cli-utils  : 1.15.1
    ionic (Ionic CLI) : 3.15.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.0.1
    Cordova Platforms  : android 5.1.1 ios 4.5.2
    Ionic Framework    : ionic-angular 3.7.1

System:

    ios-deploy : 1.9.2
    ios-sim    : 5.0.3
    Node       : v6.11.0
    npm        : 3.10.10
    OS         : macOS Sierra
    Xcode      : Xcode 9.0.1 Build version 9A1004

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy

API http call:

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

...

this.http.post(path, postVars, { headers: _headers })
   .timeout(8000)
   .map(res => res.json())
   .subscribe(
        (data) => {

            if (data.status === 0) {
                  resolve(data.result);
                  return;
            }

            if (data.hasOwnProperty('message') && data.message == 'pam_auth_userpass:failed') {
                // we are no longer logged in
                // lets broadcast an event
               this.events.publish('Elgg:AuthFail');
            }

            reject(data);
         },
         (error) => {
              reject({ status: -1, message: 'ElggAPIException' });
         }
  );

Http version: “@angular/http”: “4.4.3”

Any ideas?

Posts: 1

Participants: 1

Read full topic

Problems when i start a repo from git to build the project into IOs

$
0
0

@temohpab wrote:

I’ve a personal project with crosswalk added… The problem it’s i’m trying to git clone that repo and built into IOS but it gaves me an error doing the npm i

No description
No repository field
No README data

I don’t know how it’s going on, i’ve that project working in another pc but when i do the NPM it doesn’t work

Posts: 1

Participants: 1

Read full topic

Best practice for writing scss

$
0
0

@cisocybersecurity wrote:

I am developing an application for online examination which should be run in any size of device with any resolution. Currently I am facing the issue of css in some phones that it looks good in some resolution and bad in other.

Should I have to write different media query for each resolution or any other solution?

Posts: 1

Participants: 1

Read full topic

Php api calling with ionic not access cookies?

$
0
0

@bhariprasad82 wrote:

0
down vote
favorite
Hi Anyone please help me I developed one ts script in ionic framework. In this script i am calling one php file using get method.

URL working fine in POSTMAN if i enable postman interceptor and getting response. But if i disable postman interceptor i am not getting response.

Same URL i am calling in ionic ts script but i am not getting response.

Actually that php file using cookies. That is in different domain. I am calling that url from localhost. here is the js script code

import { Component, Injectable } from ‘@angular/core’;
import { Http, Headers, XHRBackend, Request, RequestOptions, RequestOptionsArgs, Response } from ‘@angular/http’;
import { NavController, NavParams } from ‘ionic-angular’;
import { HttpService } from ‘…/…/services/httpService’;
import ‘rxjs/add/operator/map’;
import { Observable } from ‘rxjs/Observable’;
@Component({
templateUrl: ‘chatList.html’,
})
export class ChatDetailsPage {
item;

constructor(params: NavParams) {
this.item = params.data.item;
}
}

@Component({
template: <ion-header> <ion-navbar> <ion-title>Chat - Online Members</ion-title> </ion-navbar> </ion-header> <ion-content> <ion-list> <button ion-item *ngFor="let item of items" (click)="openNavDetailsPage(item)" icon-start> <ion-icon [name]="'logo-' + item.icon" [ngStyle]="{'color': item.color}" item-start></ion-icon> {{ item.title }} </button> </ion-list> </ion-content>
})
@Injectable()
export class ChatHomePage {
items = [];

constructor(public nav: NavController, private http: HttpService) {
//let body = JSON.stringify({buddylist:1,initialize:1,EnableWebpImage:1,AppType:10});
let headers = new Headers();
headers.append(‘Content-Type’, ‘application/json; charset=utf-8’);
headers.append(‘Accept’, ‘/’);
//headers.append(“Access-Control-Allow-Credentials”, “true”);
/*headers.append(‘Upgrade-Insecure-Requests’,‘1’);
headers.append(‘withCredentials’,‘true’);
headers.append(“Access-Control-Allow-Origin”,“http://localhost:8100”);
headers.append(“Access-Control-Allow-Credentials”, “true”);
headers.append(“Access-Control-Allow-Methods”, “GET, POST, PUT, DELETE, OPTIONS”);
headers.append(“Access-Control-Allow-Headers”, “Content-Type,Authorization,Upgrade-Insecure-Requests”);
*/
var Url = ‘https://xxxxxxxx.com/cbschat/cbsonlineusers.php’;

var Shortlist,Contacted,Preferred;
var Options = new RequestOptions({params:{buddylist:1,initialize:1,EnableWebpImage:1,AppType:10},headers:headers});
this.http.get(Url, Options).map(res => res.json()).subscribe(
    data =>{
      console.log(data);
    },
    err => {
      console.log(err);
      console.log("Oops!");
    }
);
this.items = [
  {
    'title': 'Shortlisted Members',
    'icon': 'contact',
    'description': 'Shortlisted members available to chat',
    'color': '#0CA9EA'
  },
  {
    'title': 'Contacted Members',
    'icon': 'contacts',
    'description': 'Contacted members available to chat',
    'color': '#F46529'
  },
  {
    'title': 'Preferred Members',
    'icon': 'javascript',
    'description': 'Preferred members available to chat',
    'color': '#FFD439'
  },
]

}
openNavDetailsPage(item) {
this.nav.push(ChatDetailsPage, { item: item });
}

}

Posts: 1

Participants: 1

Read full topic

Error handling for http or database calls

$
0
0

@Vartex05 wrote:

Hi, is there any best practises, how to handle errors, espacially for http calls or database calls.
In case of http request i go

  this.http.post(*****).map((data)=>{
      do something
  }).catch(err=>{
    throw new Error("error message");
  })

then in page, i subscribe to this method and in case of error, i display alert with err.message. Is it proper way of handling and propagating errors?

Posts: 1

Participants: 1

Read full topic

Woocommerce API ionic 3 POST error 401

$
0
0

@Haroun wrote:

Hi, i use woocommerce api on ionic app
(using nodejs module https://www.npmjs.com/package/woocommerce-api )

and all GET works but POST dosen’t !!

i’ve tried :

wc.postAsync('products', data).then((data) =>  {
       ...
}, (err) => { console.log('Error : ', err);  });

and i get 401 error

may any one help me to fix that ?
thanks :slight_smile:

Posts: 2

Participants: 2

Read full topic


Update ionic framework from 3.7.0->3.15.1 can't build ios app

$
0
0

@Nulra wrote:

Hi, everyone, I am updating the framework from 3.7.0->3.15.1 recently. After that when I run “ionic cordova platform add ios”, it have a following error:

Error: Cannot find module './resources'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at /Users/xxxxxx/Downloads/ionicproj/node_modules/ionic/dist/commands/cordova/index.js:25:167

Anyone know how to solve it? my ionic info is below:

cli packages: (/Users/xxxxxx/Downloads/ionicproj/node_modules)

@ionic/cli-utils  : 1.15.1
ionic (Ionic CLI) : 3.15.1

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.0.1
Cordova Platforms  : android 6.2.3 ios 4.5.2
Ionic Framework    : ionic-angular 3.7.1

System:

ios-deploy : 1.9.2
ios-sim    : 5.0.13
Node       : v7.10.0
npm        : 5.0.4
OS         : macOS Sierra
Xcode      : Xcode 9.0.1 Build version 9A1004

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : legacy

Posts: 1

Participants: 1

Read full topic

Ion-sliders with different scroll

$
0
0

@avasse wrote:

Hi everyone,

I got an issu with ion-slides, actually i got 3 slides with different numbers of cards in it. For example, if i scroll on the first slide and then slide to the 2nd, the scroll is the same whereas i would like, when sliding, to start at the top of the slide.

Actually i tried to execute a content.ScrollToTop() on slide changed but that’s not really what i want…
I just would like to have different scroll in each ion-slides that i can scroll on the first slide, change slide and see the top of my slide 2 then slide on slide 3 on top… etc…

Here is the following code:

<ion-slides (ionSlideDidChange)="slideChanged()">
      <ion-slide>
        <component-card></component-card>
      </ion-slide>
      <ion-slide>
        <component-card></component-card>
      </ion-slide>
      <ion-slide>
        <component-card></component-card>
      </ion-slide>
</ion-slides>

I also tried to add an ion-scroll into each ion-slide but it goes for a blank page…
My components are just cards, nothing more nothing less.

Many thanks in advance for the help !

Posts: 1

Participants: 1

Read full topic

Add new item in another page

$
0
0

@valentinay wrote:

i want it to take the value from the when I click the add button and add a new in another page. I don’t know if what if want is clear but this my first time using ionic and desperately need .
i have a page “addmedicationPage” in this page the user adds info about a new medication, if the user choose to add the medication in the morning i want it to create a div in morning containing the info added in addmedicationPage . i’m sorry these confusing i’m just new to thihelp

  <ion-item>
    <ion-label>When to Take</ion-label>
    <ion-select [(ngModel)]="whentotake" multiple="true">
      <ion-option value="morning">Morning</ion-option>
      <ion-option value="noon">Noon</ion-option>
      <ion-option value="evening">Evening</ion-option>
      <ion-option value="night">Night</ion-option>
    </ion-select>
  </ion-item>

button :

 <button ion-button block outline large (click)="showAlert()" class="button">Add</button>

button ts :

 showAlert() {
    let alert = this.alertCtrl.create({
        title: 'Medicine has been added ',
        buttons: [
            {
                text: 'Okay Go Back to Main',
                handler: () => {
                    console.log('Okay Go Back to Medication');
                    this.navCtrl.push(medicationPage);
                }
            },

        ]
    });
    alert.present();

}

Posts: 1

Participants: 1

Read full topic

Is JSON response from WP-API Changed?

$
0
0

@shahzadmalik wrote:

Hi, I am an IONIC 3 WordPress Blog app. I used

img src ="{{post.featured_image_urls.thumbnail}}"

to get image from JSON response. It was working fine till last night when I noticed that its throwing error. When I saw in JSON response there is no featured_image_urls option for all of my posts though all of them have media. I think they have changed and there is no option left for thumbnail, medium, large . Now my app is not working can someone please help me whats going on and how to fix it.

Posts: 2

Participants: 2

Read full topic

Link ionic to phone

$
0
0

@valentinay wrote:

Hello, how can I link my ionic app to my phone (Android, and I’m using visual studio not npm) and be able to access contacts or photo gallery from the app when the user clicks a button .
Thank you!

Posts: 1

Participants: 1

Read full topic

Viewing all 71529 articles
Browse latest View live


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