Error cordova_not_available

I want to integrate paypal gateway in ionic3 app.
but it through me erros please help me


I was install cordovar already and it’ shows when I am checking
ionic info

please help me

Are You trying to debug using web i mean browser?
Trying to install in mobile app and check?
I hope this will resolve your error

Paypal seems to be a native plugin, that means it only works on mobile devices.
Plug in your Android device and run it with:

ionic cordova run android --device

1 Like

Cordova plugins are not available when running the app in the browser with ionic serve. In order to be able to use the Cordova plugins, you’d need to run the app on a simulator / real device.

Yes.its only working in real device.

I was run but through this error
I was run on phonegap still not working.

remove cordova and install
remove platforms plugins and install
run ionic info and shows cordova here

still not working for me

I was try on phonegap.
because my app is on developemnt.

@rizwana786
I understand one thing it’s not about the plugin at all.
It’s saying that you don’t set environment variable ANDROID_HOME.

Try to set that variable first in your pc then it will work…

I hope this helps

no It’s not workign for me…

@rizwana786
what’s the error can you post it here?is it the same error?are You using windows or linux machine?

for windows

I am using windows 64 bit.
and I was set environment variable also.
But nothing is working for me.
showing same error

@rizwana786

Try this one

when i was trying to set the path variables i also faced the issues.

I set whole setup new but it show me this error.


When I open path it show me file structure.

Please guide me

@rizwana786

If you don’t mine can you restart the system and check again.because system variables effect after restarting only.

If does not work try to check the path whether you have given correct path or not

no I set it and it deploy but through me this error again and again


Please see this what to do

@rizwana786

I had this problem on Mac OS X 10.12.1 with Cordova 6.4.0 and Android Studio 2.2.3.

When I installed Android Studio it installed Platform 25, but not 24. To install 24:

Open Android Studio.
Open Android Studio Menu > Preferences.
Appearance & Behavior > System Settings > Android SDK
Tick the box for Android 7.0 (Nougat) | 24
**Click ok and follow the instructions.

**Screenshot from 2017-10-28 19:47:27

Follow above one.
Just it’s saying that you did not give permission for android sdk 26.Try the above link it’s tells how to accept permissions it will definitely work. In your case you did not tick android sdk 26.I think you are trying to debug in newer version of android mobile.

yes that issue was resolve but still get erro in paypal modules
please help me



ionic info

@rizwana786
I think you didn’t include Paypal in app.module.ts providers if you don’t mine can you post app.module.ts and That page what you are implementing .ts fie here…

I already did
Please see

import { BrowserModule } from ‘@angular/platform-browser’;
import { ErrorHandler, NgModule } from ‘@angular/core’;
import { IonicApp, IonicErrorHandler, IonicModule } from ‘ionic-angular’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { PayPal, PayPalPayment, PayPalConfiguration } from ‘@ionic-native/paypal’;
import { MyApp } from ‘./app.component’;
import { HomePage } from ‘…/pages/home/home’;

@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
PayPal
]
})
export class AppModule {}

=============================
home.ts

import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import { PayPal, PayPalPayment, PayPalConfiguration } from ‘@ionic-native/paypal’;
@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’
})
export class HomePage {
payment: PayPalPayment = new PayPalPayment(‘10.10’, ‘USD’, ‘TV’, ‘sale’);
currencies = [‘EUR’, ‘USD’];
//payPalEnvironment: string = ‘payPalEnvironmentSandbox’;
constructor(public navCtrl: NavController,public payPal: PayPal) {

}

makePaymentriz() {
	console.log('step1');
	PayPal.init({
		
		PayPalEnvironmentProduction: '',
		PayPalEnvironmentSandbox: 'AXg409-ZD7lFcgk2JdHkLkggX8u7LnT7cfkGL2AG0y7bx5OAvOmErpKKz5D68kzXRxbfe_KRlFf681rk'
	}).then(() => {
		console.log('step2');
		PayPal.prepareToRender('PayPalEnvironmentSandbox', new PayPalConfiguration({})).then(() => {
			PayPal.renderSinglePaymentUI(this.payment).then((response) => {
				alert('Successfully paid. Status = ${response.response.state}');
				console.log(response);
			}, () => {
				console.error('Error or render dialog closed without being successful');
			});
		}, () => {
			console.error('Error in configuration');
		});
	}, () => {
		console.error('Error in initialization, maybe PayPal isn\'t supported or something else');
	});

}

}

@rizwana786

makePaymentriz() {
	console.log('step1');
	this.payPal.init({
		
		PayPalEnvironmentProduction: '',
		PayPalEnvironmentSandbox: 'AXg409-ZD7lFcgk2JdHkLkggX8u7LnT7cfkGL2AG0y7bx5OAvOmErpKKz5D68kzXRxbfe_KRlFf681rk'
	}).then(() => {
		console.log('step2');
		this.payPal.prepareToRender('PayPalEnvironmentSandbox', new PayPalConfiguration({})).then(() => {
			this.payPal.renderSinglePaymentUI(this.payment).then((response) => {
				alert('Successfully paid. Status = ${response.response.state}');
				console.log(response);
			}, () => {
				console.error('Error or render dialog closed without being successful');
			});
		}, () => {
			console.error('Error in configuration');
		});
	}, () => {
		console.error('Error in initialization, maybe PayPal isn\'t supported or something else');
	});

}

Try with above function it should work.

You need to access that function using this.payPal not with PayPal…