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

Build error in Ionic app which uses Google Firebase

$
0
0

@HassanKhademi wrote:

Hi,
I try to run my app in an Andriod Emulator (using Android Studio). But this command ionic cordova run android -lc gives me the following error.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\[My Project]\platforms\android\cordova-plugin-firebase\starter-build.gradle' line: 27

* What went wrong:
A problem occurred evaluating project ':app'.
> Plugin with id 'com.google.gms.google-services' not found.

Here is the gradle file:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:+'
        classpath 'com.google.gms:google-services:4.1.0'
    }
}
repositories {
    mavenCentral()
    maven {
        url "https://maven.google.com"
    }
}

dependencies {
    compile 'me.leolin:ShortcutBadger:1.1.4@aar'
    compile 'com.google.firebase:firebase-auth:+'
    compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
       transitive = true
    }
}

cdvPluginPostBuildExtras.add({
    apply plugin: 'com.google.gms.google-services'
})

(ionic version 4.0.2)

Posts: 1

Participants: 1

Read full topic


How to Integrate Facebook Messenger in my app

Using React in an Ionic application in One Go

Build and publish ios version on windows

$
0
0

@ebeliejinfren wrote:

Hi
is there a way for build and publish ios app on windows ?
any body here test anything for deploy ios app on windows ?

Posts: 1

Participants: 1

Read full topic

Ionic 4 apk generation not working

$
0
0

@manishtuluve wrote:

hi my name is manish and there is a isuue while running the command in ionic 4 while creating an apk as this is my first time i tried all solutuions and it is not working

i get the following error while running

C:\onlinefood> ionic cordova build android --prod --release
> ionic-app-scripts build --prod --target cordova --platform android
[14:20:40]  ionic-app-scripts 3.2.0
[14:20:40]  build prod started ...
[14:20:40]  clean started ...
[14:20:40]  clean finished in 8 ms
[14:20:40]  copy started ...
[14:20:40]  deeplinks started ...
[14:20:40]  deeplinks finished in 76 ms
[14:20:40]  ngc started ...
[14:20:47]  typescript error
            Unexpected directive 'CategoryPage in C:/onlinefood/src/pages/category/category.ts' imported by the module
            'AppModule in C:/onlinefood/src/app/app.module.ts'. Please add a @NgModule annotation.

[14:20:47]  ionic-app-script task: "build"
[14:20:47]  Error: The Angular AoT build failed. See the issues above
Error: The Angular AoT build failed. See the issues above
    at C:\onlinefood\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:237:55
    at step (C:\onlinefood\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:32:23)
    at Object.next (C:\onlinefood\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:13:53)
    at fulfilled (C:\onlinefood\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:4:58)
    at <anonymous>
[ERROR] An error occurred while running subprocess ionic-app-scripts.

        ionic-app-scripts build --prod --target cordova --platform android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

C:\onlinefood>ionic-app-scripts build --prod --target cordova --platform android --verbose
[14:21:33]  ionic-app-scripts 3.2.0
[14:21:33]  build prod started ...
[14:21:33]  clean started ...
[14:21:33]  clean finished in 5 ms
[14:21:33]  copy started ...
[14:21:33]  deeplinks started ...
[14:21:33]  deeplinks finished in 47 ms
[14:21:33]  ngc started ...
[14:21:35]  ionic-app-script task: "build"
[14:21:35]  Error: Cannot find module '@angular/compiler-cli/ngtools2'
Error: Cannot find module '@angular/compiler-cli/ngtools2'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at C:\Users\lenovo\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:206:90
    at <anonymous>

Posts: 1

Participants: 1

Read full topic

How to add admob in creator

Best way to store related data in LocalStorage

$
0
0

@IonicGeoff wrote:

I have quite a bit of experience using relational databases and I’m wondering what is the best way of storing a “lot” of related data using LocalStorage.

For example, if I was writing an invoice app with customer and invoice data, I could store all the data in one storage object i.e. store all the customers and all the invoices in one storage object

Or, I could split it to have a separate storage object for EACH customer, or one storage object for ALL customers, and similarly a separate local storage object for ALL invoices, or each invoice?

Logically I would think that performance would be better if the data was split, and I only loaded whatever data was needed? Is this the case?

If there wasn’t going to be much data I would stick it all into one object, for convenience.

Posts: 1

Participants: 1

Read full topic

Ionic v3 - show ionic page just once

$
0
0

@gilbertlucas46 wrote:

Hi I’m currently creating a webapp. one of the requirements is to create an intro slider to teach user how the app works, then theres a button to get to the TabsPage which contains login and signup tabs.

I’m trying to just display the intro slider once if its the first time the users viewed the website app.

Is there some kind of set cookie for ionic??

Here’s the source code:

intro.html


    <ion-content>
      <ion-slides #mySlider pager (ionSlideDidChange)="onSlideChange()" [class]="activeSlide">
        <ion-slide *ngFor="let slide of slides">
          <img [src]="slide.image">
          <div class="caption">
            <h2>{{slide.title}}</h2>
            <p>{{slide.description}}</p>
          </div>
          <div class="userNav" *ngIf="activeSlide == 'slideBG2'">
              <button ion-button   (click)="goToSignup() ">signup</button>
              <button ion-button   (click)="goToLogin() ">Login</button>
          </div>
          
        </ion-slide>
      </ion-slides>
      <button *ngIf="activeSlide !== 'slideBG2'" class="nextSlide" (click)="goToSlide()">Next</button>
    </ion-content>

intro.ts

  import { Component, ViewChild } from '@angular/core';
    import { IonicPage, NavController, NavParams, Slides } from 'ionic-angular';
    import { TabsPage } from '../tabs/tabs';
    import { SignupPage } from '../signup/signup';
    import { LoginPage } from '../login/login';
    
    
    @IonicPage()
    
    @Component({
      selector: 'page-intro',
      templateUrl: 'intro.html',
    })
    
    export class IntroPage {
      introSlides: any;
      splash = true;
    
      
      constructor(public navCtrl: NavController, public navParams: NavParams) {
        
      }
    
    @ViewChild('mySlider') slider: Slides;
      public currentindex
      public objectindex
      public activeSlide = 'slideBG0';
    
    
    slides = [
    {
      title: "Juce up your life",
      description: "lorem",
      image: "assets/imgs/intro/slides/slide1.png",
    },
    {
      title: "Anytime, anywhere",
      description: "lorem",
      image: "assets/imgs/intro/slides/slide2.png",
    },
    {
      title: "Get started",
      description: "lorem.",
      image: "assets/imgs/intro/slides/slide3.png",
    }
    ];
    
    
    public onSlideChange() {
      this.currentindex = this.slider.getActiveIndex();
      this.activeSlide = 'slideBG' + this.currentindex;
      // console.log(this.activeSlide);
    } 
    goToSlide() {
      let currentIndex = this.slider.getActiveIndex() + 1;
      this.slider.slideTo(currentIndex, 500);
    }
    
        goToLogin() {
      this.navCtrl.setRoot(TabsPage, {
        tabIndex: 1
      });
    }
    goToSignup()  {
      this.navCtrl.setRoot(TabsPage, {
        tabIndex: 0
      });
    }
        
      ionViewDidLoad() {
        // console.log(this.introSlides);
        setTimeout(() => {
          this.splash = false;
        }, 4000);
      }
     
    }

tabs.ts

import { Component } from '@angular/core';
    import { NavController, NavParams } from 'ionic-angular';
    import { LoginPage } from '../login/login';
    import { SignupPage } from '../signup/signup';
    
    @Component({
      templateUrl: 'tabs.html'
    })
    export class TabsPage {

      tab1Root = SignupPage;
      tab2Root = LoginPage;
      seltabix: number;
    
    
      constructor(public navCtrl: NavController, public navParams: NavParams) {
    
        this.seltabix = this.navParams.get('tabIndex');
      }
    }

tabs.html


    <ion-tabs tabsPlacement="top" [selectedIndex]="seltabix">
      <ion-tab [root]="tab1Root" tabTitle="Signup"></ion-tab>
      <ion-tab [root]="tab2Root" tabTitle="Login"></ion-tab>
    </ion-tabs>

app.component.ts

export class MyApp {
      rootPage:any = IntroPage;
    
      constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
        platform.ready().then(() => {
          statusBar.styleDefault();
          splashScreen.hide();
        });
      }
    }

Posts: 1

Participants: 1

Read full topic


Ion-select having country code and flag

$
0
0

@Rohit5 wrote:

hi ,
how I can create a select having "country code and country flag” in dropdown option

Posts: 2

Participants: 2

Read full topic

Ionic 4 dismissOnPageChange

$
0
0

@mmtopcu wrote:

Hi to Everybody,

I’m trying to use LoadingController on Ionic 4. The option ‘dismissOnPageChange’ seems not working. Is there anybody facing this problem and finding a solution?

Posts: 5

Participants: 2

Read full topic

Ionic build wrong apk file

$
0
0

@BennyTaccardi wrote:

Hi to everybody,

I’m having a new trouble with ionic: when I run: ionic cordova run android, build succeed but this message is printed out:

No target specified, deploying to device ‘7BKDU17709003433’.
none
Skipping build…
Built the following apk(s):
C:\xampp\htdocs\projectKobe\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Using apk: C:\xampp\htdocs\projectKobe\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Package name: com.example.hello
LAUNCH SUCCESS

So, app is installed but it doesn’t work. It has the default splash screen and nothing works. I’ve tried to delete app from my phone or to remove and add again android platform, i’ve tried also to run: ionic cordova run android --prod but nothing happens, trouble is the same. Please help me, in two days I have the presentation of the app of my thesis.

N.B.: ionic serve works perfectly

Thanks to all

Posts: 1

Participants: 1

Read full topic

Vertical scrollable floating cardview

$
0
0

@OmarAbdElHady wrote:

Hello,

I want to implement a floating card view like this through a swipe up gesture that can work from any where on the screen.

I tried to find a npm package but unfortunately, couldn’t find a proper one.

Thanks

Posts: 1

Participants: 1

Read full topic

Using image/svg icons in GoogleMaps plugin

$
0
0

@serviceminder10 wrote:

Has anyone tried using SVG icons with the GoogleMaps plugin on iOS (the only one I’ve tried so far)? I get a threading error “GMSThreadException’, reason: 'The API method must be called from the main thread” when I set the icon: property for a Marker to something similar to “data:image/svg+xml;base64,xxxx” – the behavior is the same whether I do addMarker or addMarkerSync. I’m also doing this inside the map ready event.

Just curious if anyone has been able to get base64 encoded SVG icons to work with the GoogleMaps plugin.

Posts: 1

Participants: 1

Read full topic

Website to app Maker

Ionic Registration css Issue

$
0
0

@kushalshah wrote:

Hello Everyone,

I have made login page and registration page in ionic, I have problem with css for registration page
whenever i type in any input that page is looks like

in Image , can see that , i have generate apk and also check in my android device and it’s look dirty ,all the contents gone to up side
I wrote all html and css is here
<ion-content class="background">
    <ion-card>
        <ion-card-header>
            Registration
        </ion-card-header>
        <ion-card-content>
            <ion-list no-line>
                <ion-item text-wrap>
                    <ion-icon name="person" item-start></ion-icon>
                    <ion-input type="text" placeholder="Enter Name"></ion-input>
                </ion-item>

                <ion-item text-wrap>
                    <ion-icon name="mail" item-start></ion-icon>
                    <ion-input type="email" placeholder="Company Email"></ion-input>
                </ion-item>
                <ion-item text-wrap>
                    <ion-icon name="contact" item-start></ion-icon>
                    <ion-input type="text" placeholder="Username"></ion-input>
                </ion-item>
                <ion-item text-wrap>
                    <ion-icon name="lock" item-start></ion-icon>
                    <ion-input type="password" placeholder="Password"></ion-input>
                </ion-item>
                <ion-item text-wrap>
                    <ion-icon name="lock" item-start></ion-icon>
                    <ion-input type="password" placeholder="Confirm Password"></ion-input>
                </ion-item>
            </ion-list>
            <button ion-button icon-start block outline color="light" (click)="login()" style="margin-top: 30px;">
                <ion-icon name="log-in"></ion-icon>
                Register
            </button>
            <a class="link-color" (click)="backToLogin()">Login</a>
        </ion-card-content>
    </ion-card>
</ion-content>

and css is

page-registration{
.link-color{
        color: #fff;
        cursor: pointer;
    }
    .background {
        //background-image: url('../../assets/imgs/back1.jpg');
        background: rgb(62, 75, 84),
    }    
    .scroll-content{
        align-content: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    ion-card.card{
        box-shadow: none;
        background: rgba(0,0,0,0.5);
        border-radius:5px;
    }
ion-card-header.card-header{
        color: #fff;
        font-family: Georgia, serif;
        font-size: 20px;
    }
    .button{
        color: #fff;
        border-color: #fff;
    }
    ion-icon{
        color: #fff;
    }
    .list > .item-block .item-inner{
        border:  medium none;
        margin: 0;
    }

    .item{
        margin-bottom: 10px;
        background: rgba(255, 255, 255, 0.5);
        border: medium none;

        .text-input,{
            color: #fff;
        }
        *:-moz-placeholder{
            color: #fff;
        }

        *:-ms-input-placeholder{
            color: #fff;
        }
        *::-webkit-input-placeholder{
            color: #fff;
        }
        input::-moz-placeholder
        {
            color: #fff !important;
        }
        input:-moz-placeholder
        {
            color: #fff !important;
        }
    }
}
.fonts{
    font-family: Georgia, serif;
}

my android phone screen is look

can anyone help for css ?
Thanks,

Posts: 1

Participants: 1

Read full topic


Json data output in ion-list

$
0
0

@RenzoM78 wrote:

Hello all,

I have some data pulled out of a json file:

"field_ingredienten":["1 courgette","1 ei","250 gr bloem","450 ml melk","1 tl gemalen komijn","100 gr geraspte jong belegen kaas","4 el zonnebloemolie"]

Now every item between the “…” is placed in one line but I want it in a list format.
How can I do that?

Posts: 1

Participants: 1

Read full topic

Ionic 4 not working on Android Emulator

$
0
0

@sirarthurnell wrote:

I just generated a new project with

ionic start test4 blank --type=angular

After that, I executed:

ionic cordova run android

And I got:

The same happened with two different emulators, one with Nougat and another with Mashmallow.

My package.json is:

{
  "name": "test4",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://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": "~6.1.1",
    "@angular/core": "~6.1.1",
    "@angular/forms": "~6.1.1",
    "@angular/http": "~6.1.1",
    "@angular/platform-browser": "~6.1.1",
    "@angular/platform-browser-dynamic": "~6.1.1",
    "@angular/router": "~6.1.1",
    "@ionic-native/core": "5.0.0-beta.15",
    "@ionic-native/splash-screen": "5.0.0-beta.15",
    "@ionic-native/status-bar": "5.0.0-beta.15",
    "@ionic/angular": "4.0.0-beta.7",
    "cordova-android": "7.0.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.1.2",
    "cordova-plugin-ionic-webview": "^2.1.3",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "core-js": "^2.5.3",
    "rxjs": "6.2.2",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "~6.1.1",
    "@angular/compiler": "~6.1.1",
    "@angular/compiler-cli": "~6.1.1",
    "@angular/language-service": "~6.1.1",
    "@angular-devkit/architect": "~0.7.2",
    "@angular-devkit/build-angular": "~0.7.2",
    "@angular-devkit/core": "~0.7.2",
    "@angular-devkit/schematics": "~0.7.2",
    "@ionic/ng-toolkit": "^1.0.0",
    "@ionic/schematics-angular": "^1.0.0",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~10.9.2",
    "codelyzer": "~4.4.2",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~2.9.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {}
    },
    "platforms": [
      "android"
    ]
  }
}

Nevertheless, it works on my phone, but it obscures Android’s status bar leaving it black, almost opaque (that’s another issue I don’t know how to solve).

I tested everything again with Ionic 3 and everything worked, on the two emulators and on my phone.

Posts: 1

Participants: 1

Read full topic

Reversing *ngFor array causes flickering

(click) event doesn't work anymore with injected content in ionic 4 beta

$
0
0

@trollanfer wrote:

I try to switch from ionic 3 to 4.
In a list, I have some text injected from my database. I want the user to be able to click on this text.
Here is my code, which was OK in ionic 3 :

<ion-item  [ngClass]="item.nature" (click)="itemTextShow(item)">
	<ion-icon slot="end" size="small" class="su" name='thumbs-up' *ngIf="item.su>0">
	<span  [innerHTML]="sanitizer.bypassSecurityTrustHtml(item.questionaff)"></span>
</ion-item>

With ionic 4, the text is injected, but the (click) doesn’t work on the text (it triggers on the icon, or everywhere in the <ion-item>out of the textbox, and even in the background space between the lines or the bloc letters !

I believed that this happens because the text is injected in the shadow dom, but it’s not the case…

Has someone encountered this issue ?

Posts: 1

Participants: 1

Read full topic

Ionic app not running on Android if I use specific widget id

Viewing all 71022 articles
Browse latest View live


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