Ionic android build prod failed in android - ionic-framework

i am using ionic 2 for hybrid application development. Once i build the android application using following command.
ionic build android --prod
I am getting the following error in my console. Whats the exact issue any one please suggest.
ionic-app-script task: "build"
[00:15:38] Error: ./node_modules/ionic-native/dist/es5/plugins/plugin.js Module build failed: TypeError: Cannot read
property 'type' of undefined at Object.getEffectiveTypeAnnotationNode
Following is my ionic information:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.6.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.0
Xcode version: Not installed

Related

Ionic 3 missing ionic starter folder in platforms folder

Tried to run ionic cordova platform add android#6.3.0 latest ionic version and do not why but the platforms\android\src\io\ionic\starter folder is missing where MainActivity.java is located
Tried reinstalling a new ionic version but still misses. I am installing specific 6.3.0 android version which was working perfectly fine in my previous build, so not sure why its missing the starter folder
Ionic info details below
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 6.5.0
local packages:
#ionic/app-scripts : 3.1.10
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v6.11.3
npm : 3.10.10
OS : Windows 10
Environment Variables:
ANDROID_HOME : C:\Users\Oreo\AppData\Local\Android\sdk\
Misc:
backend : pro
Main Activity java can be found in below location
.. \platforms\android\app\src\main\java\com\...
Why do you need this file? If you are building an app, APK can be found in below path
platforms\android\app\build\outputs\apk\release

Plugin doesn't support this project's cordova-android version. While installing cordova-plugin-geofence plugin

C:\My App\test>ionic cordova plugin add cordova-plugin-geofence
cordova plugin add cordova-plugin-geofence --save
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted
{"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
minimist#1.2.0
xml2js#0.4.19
updated 2 packages in 33.453s
Installing "cordova-plugin-geofence" for android
Installing "cordova-plugin-add-swift-support" for android
Android Studio project detected
Installing "cordova-plugin-compat" for android
Plugin doesn't support this project's cordova-android version. cordova-android: 7.0.0, failed
version requirement:
<6.3.0
Skipping 'cordova-plugin-compat' for android
Installing "es6-promise-plugin" for android
Subproject Path: CordovaLib
Subproject Path: app
Adding cordova-plugin-geofence to package.json
Saved plugin info for "cordova-plugin-geofence" to config.xml
Ionic Versions Info :
cli packages: (C:\Users\Shadab\AppData\Roaming\npm\node_modules)
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.1.9
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.4
npm : 5.6.0
OS : Windows 7
Environment Variables:
ANDROID_HOME : C:\Users\Shadab\AppData\Local\Android\sdk;
Misc:
backend : pro
Run the "cordova platforms" command to see what version of android you have. In my case I was using 6.2.3. What I did is I updated my android version using the "cordova platform update android#6.3.0"command. After that add the plugins again and you should be good to go.

Error: Could not find an installed version of Gradle while running on android

I'm using Ionic2 on mac: I've install android studio, SDK and JDK but when I run command: ionic cordova run android I got this error:
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle
and when I run command: ionic cordova run ios i got command: Code signing is required for product type 'Application' in SDK 'iOS 10.0' what should I do to run in android and ios devices?

how to add android and ios platform in ionic cli 3.3.0

I update ionic and trying to add android and ios platform but i could not add it. it shows me following message in console.
js20#js20:~/Desktop/project$ ionic platform add android
The platform command has been renamed. To find out more, run:
ionic cordova platform --help
My ionic version
js20#js20:~/Desktop/project$ ionic -v
3.3.0
we can simply use following commands
ionic cordova platform add android
or
ionic cordova platform add ios
to run
ionic cordova run android --device
ionic cordova run ios
ionic cordova run ios --prod --release
to build
ionic cordova build android
ionic cordova build ios
ionic cordova build ios --prod --release
If are you facing any problem while adding and removing platform.
Recently I am unable to remove and add platform using
ionic cordova platform add android
It is not get add in project.
Then finally i add platform using cordova commands
cordova platform add android

will ionic plugin 2.2.3 run on ionic 1.3.0?

I'm newbie in ionic and I need to create plugins that run on ionic 1.3.0, is that possible if I create the plugin using the ionic 2.2.3 ? will the plugin works or should I develop the plugin using ionic 1.3.0 also?