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

Failed to apply plugin [id 'com.github.dcendents.android-maven']

$
0
0

@mustafabekec wrote:

Hello there. I couldn’t solve the problem. When I create a new project and give the command “cordova run android”, I get the same error. I mean, if it’s doing it in a new project, why?
Thanks for your answer.

cordova run android

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\Meftun\AppData\Local\Android\sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app

> Configure project :CordovaLibProject evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Meftun\Desktop\helloWorld2\platforms\android\CordovaLib\build.gradle' line: 41

* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> Failed to apply plugin [id 'com.github.dcendents.android-maven']
   > Configuration with name 'testImplementation' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s

C:\Users\Meftun\Desktop\helloWorld2\platforms\android\gradlew: Command failed with exit code 1 Error output:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Meftun\Desktop\helloWorld2\platforms\android\CordovaLib\build.gradle' line: 41

* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> Failed to apply plugin [id 'com.github.dcendents.android-maven']
   > Configuration with name 'testImplementation' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s

build.gradle

/* Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
*/

ext {
    apply from: 'cordova.gradle'
    cdvCompileSdkVersion = privateHelpers.getProjectTarget()
    cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
}

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        // The gradle plugin and the maven plugin have to be updated after each version of Android
        // studio comes out
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
    }
}

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

group = 'org.apache.cordova'
version = '8.0.0'

android {
    compileSdkVersion cdvCompileSdkVersion
    buildToolsVersion cdvBuildToolsVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
    }
}

install {
    repositories.mavenInstaller {
        pom {
            project {
                packaging 'aar'
                name 'Cordova'
                url 'https://cordova.apache.org'
                licenses {
                    license {
                        name 'The Apache Software License, Version 2.0'
                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }
                developers {
                    developer {
                        id 'stevengill'
                        name 'Steve Gill'
                    }
                }
                scm {
                    connection 'scm:git:https://github.com/apache/cordova-android.git'
                    developerConnection 'scm:git:git@github.com:apache/cordova-android.git'
                    url 'https://github.com/apache/cordova-android'

                }
            }
        }
    }
}

task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

artifacts {
    archives sourcesJar
}

bintray {
    user = System.getenv('BINTRAY_USER')
    key = System.getenv('BINTRAY_KEY')
    configurations = ['archives']
    pkg {
        repo = 'maven'
        name = 'cordova-android'
        userOrg = 'cordova'
        licenses = ['Apache-2.0']
        vcsUrl = 'https://github.com/apache/cordova-android'
        websiteUrl = 'https://cordova.apache.org'
        issueTrackerUrl = 'https://github.com/apache/cordova-android/issues'
        publicDownloadNumbers = true
        licenses = ['Apache-2.0']
        labels = ['android', 'cordova', 'phonegap']
        version {
            name = '8.0.0'
            released  = new Date()
            vcsTag = '8.0.0'
        }
    }
}

ionic info

Ionic:

   Ionic CLI          : 5.2.1 (C:\Users\Meftun\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.5
   @ionic/app-scripts : 3.2.2

Cordova:

   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 5 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.7

System:

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

cordova plugin list

cordova-android-play-services-gradle-release 4.0.0 "cordova-android-play-services-gradle-release"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"

Posts: 1

Participants: 1

Read full topic


Log out user or closing the app. How?

$
0
0

@jamesRoss wrote:

I am using Ionic -v 5.1.0 to build an app - it’s going quite ell for my first go… however, I cannot for the life of me find how to close the app. I could redirect to the login page with no user id being carried in the url, for example, but a clean clise would be better, no?

Posts: 1

Participants: 1

Read full topic

Ionic 3 tabs active

$
0
0

@satya525 wrote:

i have 5 tabs in my ionic 3 app and they are working as expected with in the app.

Now i’m implementing FCM push notifications and i’m trying to redirect the user from the notification to specific screen using below code

this.fcm.onNotification().subscribe(data => {
        if(data.wasTapped){
          if(window.localStorage.getItem("rememberMe") == "true"){
            this.rootPage = TabsPage;
            if(data.location == "Page2"){

              this.app.getRootNav().getActiveChildNav().select(0);
              this.eve.publish('user:created', 0);
              setTimeout(() => {
                this.app.getActiveNav().push(Page2,{'storyData':data,'imgpath':'pathtoimage'});
              }, 100);

            } else if(data.location == "Page1"){
              this.app.getRootNav().getActiveChildNav().select(0);
              this.eve.publish('user:created', 0);
            } else if(data.location == "Page3") {
              this.app.getRootNav().getActiveChildNav().select(3);
              this.eve.publish('user:created', 3);
            }
          }
          console.log("Received in background");
        } else {
          console.log("Received in foreground");
        };
      });

this is working fine when the app is killed or not in background mode and i’m able to redirect the user to desired pages along with appropriate tabs are being active.

But when the app is in background mode pages are again loading perfectly but the active tab is not getting selected instead its showing previously selected tab.

tabs.html

<ion-tabs selectedIndex={{dat}} (ionChange)="tada($event)">
  <ion-tab style="font-family:segoeprb" [root]="tab1Root" tabTitle="tab1" tabIcon="icon"></ion-tab>
  <ion-tab [show]="guest" [root]="tab2Root" tabTitle="tab2" tabIcon="icon"></ion-tab>
  <ion-tab [show]="guest" [root]="tab3Root" tabTitle="tab3" tabIcon="icon"></ion-tab>
  <ion-tab [root]="tab4Root" tabTitle="tab4" tabIcon="icon"></ion-tab>
  <ion-tab [show]="guest" [root]="tab5Root" tabTitle="tab5" tabIcon="icon"></ion-tab>
</ion-tabs>

here i’m using selectedIndex appended to dat and i’m updating it using events which is pushed from app.component as you can see.

tabs.ts

eve.subscribe('user:created', (data) => {
       this.dat = data;
       console.log(this.dat);
    });

here i can see the passed index value of tab, but its not updating when the app is in background mode.

Posts: 1

Participants: 1

Read full topic

Make ion-header display on top of ion-popover backdrop

$
0
0

@ErikHumphrey wrote:

Hi,

I want to use an ion-popover with showBackdrop set to true, but the backdrop covers my ion-header control and the ion-col’s buttons within, darkening them along with the rest of the page. As a result, if showBackdrop is true, the ion-popover control stands out awkwardly from the ion-header from which it’s created.

Is there any way I can either:

  • Make ion-header display on top of the ion-popover’s backdrop and the rest of the page’s contents, or
  • Make ion-popover’s backdrop not cover my ion-header, but still cover the rest of the page?

Thanks.

Posts: 1

Participants: 1

Read full topic

Production release build ionic 4 throws error unkown identifier

$
0
0

@r2get wrote:

my app works when building dev and also works when running in ionic lab. Now i want to build for production and it fails with this error

ERROR in : Error: Internal error: unknown identifier [{"filePath":"/codebase/deliver-app/node_modules/@angular/router/router.d.ts","name":"RouteReuseStrategy","members":[]}]
at Object.importExpr$$1 [as importExpr] (/codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:24170:27)
at tokenExpr (/codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:19863:43)
at providerDef (/codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:19789:24)
at /codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:19959:81
at Array.map (<anonymous>)
at NgModuleCompiler.compile (/codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:19959:48)
at AotCompiler._compileModule (/codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:24115:36)
at /codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:24034:70
at Array.forEach (<anonymous>)
at AotCompiler._compileImplFile (/codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:24034:23)
at /codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:24024:74
at Array.map (<anonymous>)
at AotCompiler.emitAllImpls (/codebase/deliver-app/node_modules/@angular/compiler/bundles/compiler.umd.js:24024:39)
at AngularCompilerProgram.generateFilesForEmit (/codebase/deliver-app/node_modules/@angular/compiler-cli/src/transformers/program.js:620:46)
at AngularCompilerProgram._emitRender2 (/codebase/deliver-app/node_modules/@angular/compiler-cli/src/transformers/program.js:266:47)
at AngularCompilerProgram.emit (/codebase/deliver-app/node_modules/@angular/compiler-cli/src/transformers/program.js:201:22)
at AngularCompilerPlugin._emit (/codebase/deliver-app/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:879:49)
at AngularCompilerPlugin._update (/codebase/deliver-app/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:676:50)
at process._tickCallback (internal/process/next_tick.js:68:7)
[ERROR] An error occurred while running subprocess ng.

I have no clue why this is happening. What can i do to fix this?

it happens when i run:

ionic cordova build android --prod --release

Posts: 1

Participants: 1

Read full topic

Building Error when any splash resource are 3Mb or more

$
0
0

@dossantosam wrote:

Hi.

I got an build error when any splash resource are 3Mb or more. I have to manually edit png files to decrese their size in order to build successfully.
Happens in ionic v3 cli version 4 and 5.

Thanks.

Posts: 1

Participants: 1

Read full topic

ion-button redirects to correct page on android app but not ios app

$
0
0

@dkadesigns wrote:

Hello I have a concert venue app that has an android version and an ios version. This app lists all the concerts at this venue, and when you click on a show it will display a new page for that particular show. The problem I am having is with the facebook button and the tickets button on the specific show pages. Each should link you to the venues facebook and to the ticket page, however on the ios versions specifically the buttons don’t do anything. Everything has been working fine for a long time now this issue just seemed to randomly appear overnight. The app uses ion and html so the two versions do not use separate code at all which makes this situation even more odd.

I have searched the internet for similar issues and have not found anything that has helped, I have studied up a bit more on the ion buttons and the code seems accurate, and I have played around with it a bit on my local host and can’t seem to find why it’s not working on only the ios version.

I believe this is the relevant code from the .html file.

    <button ion-button block large icon-left (click)="openFacebook()">

This is from the .ts file.

openFacebook() {
  window.open(this.selectedItem.facebook_url, '_system', 'location=yes');
 }

The tickets code is similar just replace “facebook” with “tickets”.

You should be redirected to the proper page however nothing happens when the buttons are clicked on the ios version of the app.

Posts: 1

Participants: 1

Read full topic

Capacitor - Using Motion

$
0
0

@SpookieUkie wrote:

I am confused on how to use the motion api plugin with Capacitor. I am trying to get the ‘compass heading’ but I can’t seems to get it. When I listen to an Orientation and get a MotionOrientationEventResult, the only event properties are alpha beta and gamma. Here is the sample of what I have.

import { Plugins, MotionOrientationEventResult, MotionEventResult } from ‘@capacitor/core’;
const { Geolocation } = Plugins;
const { Motion } = Plugins;

private getMotion() {
// try {
Motion.addListener(‘accel’, (event: MotionEventResult) => {
console.log (‘accel’);
console.log (event);

})

Motion.addListener('orientation', (event: MotionOrientationEventResult) => {
  console.log ('Orientation');
  console.log (event);
});

}

Any help on this would be great.

Thanks

Posts: 3

Participants: 2

Read full topic


Is there an Indoor Maps code for Ionic 3?

$
0
0

@advelazquez wrote:

Is there a project on GitHub on which you can work Indoor Maps with Ionic Framework 3?

If not, where can I find a tutorial for such a reason?

Best

Posts: 1

Participants: 1

Read full topic

Blank screen on AppFlow

$
0
0

@triple3way wrote:

my Appflow gives blank screen with alot of js errors under the chrome console , i can’t access since 3 hours .
any one has the same issue please?

Posts: 1

Participants: 1

Read full topic

For any URL I try to access from the Emulator using HttpClient (Ionic v3), and I get the message: "Http failure response for (unknown url): 0 Unknown Error

$
0
0

@marciusbezerra wrote:

For any URL I try to access from the Emulator using HttpClient (Ionic v3), and I get the message:

            {"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown
            Error","url":null,"ok":false,"name":"HttpErrorResponse","message":"Http failure response for (unknown url):
           0 Unknown Error","error":{"isTrusted":true}}

Note: Other apps usually connect to the same emulator
Note: Postman normally connects, Node Js (request) normally connects

Code:

import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';

@Injectable()
export class AuthService {

    constructor(
        private http: HttpClient) {
    }

    loginTest() {

        this.http.get('https://www.google.com/')
            .subscribe(
                ret => {
                    console.log('ret: ', JSON.stringify(ret));
                    alert('ret: ' + JSON.stringify(ret));
                },
                error => {
                    console.log('error: ', JSON.stringify(error));
                    alert('error: ' + JSON.stringify(error));
                }
            );
    }
}
Ionic:

   Ionic CLI          : 5.0.2 (C:\Users\Marcius Bezerra\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.5
   @ionic/app-scripts : 3.2.2

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 6 other plugins)

Utility:

   cordova-res : 0.3.0
   native-run  : 0.2.4

System:

   Android SDK Tools : 26.1.1 (D:\AndroidSdk)
   NodeJS            : v10.14.2 (D:\Program Files\nodejs\node.exe)
   npm               : 6.4.1
   OS                : Windows 10

Posts: 1

Participants: 1

Read full topic

Inline update

$
0
0

@payalkaur wrote:

Hi,
I am searching for a way to update app without user’s approval whenever there is a new update.
I tried App Update plugin which asks user’s conformation, but I want it to update forcefully.

Google announced a new way for developers to force their users to update their apps when they launch important bug fixes or new features. It is called Inline Updates and allow developers to force users to update.

Is there any option in Ionic 3 to do so?

Posts: 1

Participants: 1

Read full topic

Dynamically Change Between Routed Components with Angular Router

$
0
0

@Jamesmanners wrote:

We are working on extending our Ionic Mobile App with improved Desktop layouts. It isn’t always possible to achieve the different layouts using css alone. Similarly combining both desktop & mobile templates in a single template quickly becomes unwieldy and difficult to read and understand.

We have created sub components that are rendered based on the platform detection. ie:

page1.page.html

<ng-container *ngIf="platform.is('mobile')">
    <page-1-mobile-view></page-1-mobile-view>>
</ng-container>
<ng-container *ngIf="platform.is('mobile')">
    <page-1-desktop-view></page-1-desktop-view>>
</ng-container>

The problem with this approach is the <ion-content></ion-content> tag in the platform specific components isn’t rendered. Ionic places a #ion-page class to the routed component and only immediate ion-content children are shown. Others are hidden.

Is it possible to use Angular Router to route to different components based on the platform?

ie:

const routes = [
    {
        path: "page-1",
        component: Page1MobilePage,
        canActivate: IsMobileRouterGuard
    },
    {
        path: "page-1",
        component: Page1DesktopPage,
        canActivate: IsDesktopRouterGuard
    }
]

Or does anyone else have an other suggestion?

Thanks a million!

Posts: 1

Participants: 1

Read full topic

Installing ionic apps in android

$
0
0

@nizalsha wrote:

i have an app in my android phone which is made with ionic framework. when i tried to install another one which is made with ionic framework the first one gets removed from my phone. i want to know what is wrong and how do i fix it? is it something with package naming? please guide me with this ?

Posts: 1

Participants: 1

Read full topic

Capacitor BackgroundFetch

$
0
0

@CologicN wrote:

Hi,

we are building an app which we want to fetch data in a periodic time frame. Since the Cordova BackgroundFetch plugin does not work as intended (ignores every call after the first one) we had a look into Capacitor’s Background Task plugin. There is said that support for a periodic fetch will come “soon” but is coming in the near future (next couple of months) or is there a different approach to get a periodic fetch done in Ionic?

We are using Ionic 4 with Angular at the moment.

Thanks in advance
Niklas

Posts: 1

Participants: 1

Read full topic


Migrating from Cordova to Capacitor

$
0
0

@michaelo wrote:

So i’ve started following the guide here: https://capacitor.ionicframework.com/docs/cordova/migrating-from-cordova-to-capacitor/

And all seems to be going well so far. My issue is, i’m abit confused about all the different imports for the native packages.

For example for the Keyboard plugin:

There is:
https://ionicframework.com/docs/v3/api/platform/Keyboard/
https://ionicframework.com/docs/native/keyboard
https://capacitor.ionicframework.com/docs/apis/keyboard

I’m still using ionic v3 for now until i’m able to migrate the codebase, but I want to start fully using capacitor ahead of migrating as I like the idea of being able to check in the platforms source code.

So out of the 3 links, what am I supposed to use? Do I abandon all non capacitor plugins & imports and only use the instructions outlined in the capacitor docs? Or do I use some sort of a hybrid?

Posts: 1

Participants: 1

Read full topic

BUILD FAILED with Gradle issue

$
0
0

@ashokInceptive wrote:

I’m trying to build the project with cordova build android but it gets failed with “Failed to apply plugin [id ‘com.android.application’]”

Minimum supported Gradle version is 5.1.1. Current version is 4.10.3. If using the gradle wrapper, try editing the distributionUrl in ~/ProjectName/gradle/wrapper/gradle-wrapper.properties to gradle-5.1.1-all.zip

I have updated gradle version and changed in gradle-wrapper.properties file but after running cordova build android command all changes revert and gave me BUILD FAILED error.

Please help me to resolve this issue.

Thanks.

Posts: 1

Participants: 1

Read full topic

[Ionic 3] Keychain, save password in ios

$
0
0

@Yogos wrote:

Hello,
I want propose to user save is password in ios keychain at the time of the connection, but i don’t find example example .

I need to change params in Xcode?

Posts: 1

Participants: 1

Read full topic

Unable to make a call to HTTS url

$
0
0

@lohith95 wrote:

Hello ionites,
whenever i try to make a call to https url using httpClient im getting CORS issue, and when i try from httpNative i am getting SSLHandshakeException. Seems like the issue is from server side, not sure!

Can anyone help me on this please.

Already wasted my 3 days finding solution

Posts: 1

Participants: 1

Read full topic

Windows 7 vs Windows 10?

$
0
0

@bkdroid13 wrote:

I am formatting my computer, I am struggling to decide on which windows to install.
Windows 10 does not ask the user whether to install updates or not.Let me know your views on which to choose a version of the window.

Posts: 1

Participants: 1

Read full topic

Viewing all 70435 articles
Browse latest View live


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