I need to compile an old project (IONIC 2) - ionic-framework

I have a project on ionic 2, which I have not touched for 3 years, but the client is asking me to change a simple link. And I can not build the application. What should I take into account to recover this project?
I do not want to migrate to ionic 3 or ionic 4, I just want to change the webservices link and that the application continues in ionic 2.
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
#ionic/app-scripts : 1.1.4
Cordova Platforms : none
Ionic Framework : ionic-angular 2.2.0
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
Node : v8.9.3
npm : 5.5.1
OS : macOS
Xcode : Xcode 10.1 Build version 10B61
Is it possible to build this old project on ionic 2 on my computer?
EDIT:
when sudo ionic cordova platform add android i get:
`(node:41668) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch platform cordova-android#7.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm WARN #ionic/app-scripts#1.1.4 requires a peer of #angular/tsc-wrapped#* but none is installed. You must install peer dependencies yourself.
npm WARN #ionic/cli-plugin-ionic-angular#1.3.1 requires a peer of #ionic/app-scripts#^1.3.7 but none is installed. You must install peer dependencies yourself.
npm ERR! Cannot read property '0' of undefined`

u should install Cordova first, like this,use # plus version number as needed
npm install -g cordova

Related

Unable to build android in IONIC 6

When I run ionic cordova build android –prod i get the error:
Downloading https://services.gradle.org/distributions/gradle-7.1.1-all.zip
Exception in thread "main" java.io.IOException: Downloading from https://services.gradle.org/distributions/gradle-7.1.1-all.zip failed: timeout
I'm behind a proxy, so I set
ionic config set -g proxy http://proxy-..***:9999
I have executed ionic start myApp tabs --cordova --type=angular
I have executed ionic serve
but i can't do the build
I will be very grateful if you can help me please.
Ionic:
Ionic CLI: 6.20.3
Ionic Framework: #ionic/angular 6.3.2
Cordova:
Cordova CLI: 11.0.0
Cordova Platforms: android 10.1.2
Utility:
cordova-res: not installed globally
native-run: not installed globally
System:
NodeJS: v16.17.0 (C:\Program Files\nodejs\node.exe)
npm: 8.15.0
OS: Windows 10
Make sure you already added android in your ionic app then proceed on these steps.
Download the gradle: https://services.gradle.org/distributions/gradle-7.1.1-all.zip
Place the zip file inside: {YourAppName}/platforms/android/gradle
Set an environment variable in your OS: CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="../gradle-7.1.1-all.zip"
Run ionic cordova build android --prod

Changes are not getting reflected in Ionic 3 app even after successful build

I met a problem for 3 days with my application ionic 3.
In fact, after builder in prod and release mode, it is always the old version that is always taken into account. the changes do not reflect.
So when mode debug, the changes are well taken.
I tried several solutions may nothing.
Ionic v3
Also i have tried many solutions but no changes
ionic cordova platforms rm android
ionic cordova platforms add android
ionic cordova build android --prod --release --aot
------------no change-------------
I have downgrade the app-scripts version always same
i have delete the www folder and run ionic serve --lab after i run build commande still no change
I need help.
Thanks you in advance
Ionic:
Ionic CLI : 5.2.3
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.1.8
Cordova:
Cordova CLI : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic 3.1.2, cordova-plugin-ionic-webview 1.2.1, (and 18 other plugins)
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
Android SDK Tools : 26.1.1 (C:\Sdk)
NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Build pass successfully
remove android platform using
ionic cordova platform rm android remove manually node-modules and
package-lock.json (imp*)
Unistall old Application
npm cache clean --force
finally run npm install
ionic cordova platform add android
ionic cordova build android
As #MD Khali said to remove the platform and add platform again, but if it happens after that you just need to click save 3-4 time. Because I have the same problem in my ionic 3 projects.
Finally I found the solution.
The problem was related to the ionic plugin (appflow).
I had two choices
1. Generate the apk from the appflow platform with the configured branch.
Remove the ionic plugin applflow
I took the choice 1.
Documentation of appflow https://ionicframework.com/appflow

Ionic App not running on ios/Android but working on browser

I developed an app that was working perfectly on Ionic DevApp on my iPhone. Suddenly it stopped working. I even tested a new blank app and it does not work. I tested on many wifi and 3G signals and also on an Android phone but it does not work!
On my iPhone I’m getting the following error:
Unable to load page. The request timed out.
On the Android phone I got this error:
error err_connection_timed_out.
I tried running the following, but none worked:
ionic serve
ionic serve -c
ionic serve -c --no-proxy
Running ionic info gives me:
Ionic:
ionic (Ionic CLI) : 4.5.0 (C:\Users\rodri\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : android 7.1.2, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.3, (and 5 other plugins)
System:
NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
EDIT:
I tried running ionic repair which gives me this error:
shell.js: internal error
Error: ETIMEDOUT: connection timed out, read
[ERROR] An error occurred while running subprocess cordova.
cordova prepare exited with exit code 1.
It was just a Firewall coming from McAfee Firewall blocking the port I needed. Just had to open the port on the McAfee app.

Getting "Sorry! The configured backend (pro) does not know about ionic upload" When trying to upload the Ionic App

I'm trying to upload the App I built to my Ionic Pro account.
I've linked my account and added the SSH keys but after running ionic upload I'm getting this error
[ERROR] Sorry! The configured backend (pro) does not know about ionic upload.
This is My Ionic Info
cli packages: (/home/jos/Desktop/helloapp/node_modules)
#ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
Gulp CLI : not installed globally
local packages:
Cordova Platforms : android 6.2.3 browser 4.1.0
Ionic Framework : ionic1 1.3.1
System:
Android SDK Tools : 26.0.2
Node : v6.11.0
npm : 3.10.10
OS : Linux 3.13
ionic upload doesn't work with backend pro, you have to create an app
on https://dashboard.ionicjs.com/apps and there will be a setup guide :)

ionic use video.js throws error

I try to use video.js as my video player, but reaches error:
Uncaught (in promise): Error: Cannot find module "safe-json-parse/tuple" Error: Cannot find module "safe-json-parse/tuple"
Steps I did:
npm install -S video.js
import videojs from 'video.js';
write code in palyer.ts => videojs('my-player', { controls: true});
above error appears when player page is hit.
Anybody has any idea? Or what other 3rd party html5 video player can be easily plugged in?
environment details:
ionic info
global packages:
#ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0
local packages:
#ionic/app-scripts : 1.3.7
#ionic/cli-plugin-cordova : 1.4.0
#ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.3.0
System:
Node : v6.10.3
OS : Linux 4.10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 3.10.10
I did the same thing, I had a safe-json-parse module so thought I was fine, but after doing:
npm install -s safe-json-parse
new files were added and the error was gone.
I downloaded the videojs js and css files to assets/ folder and references them in index.html.
By this way videojs works, though not as elegant as with npm package