"myApp has stopped" after try to open in Android

I know that we already discussed similar problem here but now the same problem occurs, but I couldn’t identify why. Does someone know help me why my apk is generated, installed into Android, but after clicked on app appears the message “myApp has stopped”?

I’ve followed whole instructions of How to update Cordova CLI, Platforms and Plugins, but nothing.

rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ ionic info
✔ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)  : 4.1.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.1.1
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 1.2.1, (and 5 other plugins)

System:

   NodeJS : v8.10.0 (/usr/bin/node)
   npm    : 6.4.1
   OS     : Linux 4.15

rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ ionic cordova requirements
> cordova requirements
Android Studio project detected

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-28,android-27,android-24
Gradle: installed /usr/local/android-studio/gradle/gradle-4.4/bin/gradle
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ npm info cordova version
8.0.0
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ cordova -v
8.0.0
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ cordova platform list
Installed platforms:
  android 7.1.1
Available platforms: 
  browser ~5.0.1
  ios ~4.5.4
  osx ~4.0.1
  windows ~5.0.0
  www ^3.12.0
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ npm info cordova-android version
7.1.1
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ npm outdated
Package                             Current  Wanted   Latest   Location      
rxjs                               5.5.7            5.5.7   6.3.2   MyApp
@angular/animations                5.2.9            5.2.9   6.1.7   MyApp
@angular/common                    5.2.9            5.2.9   6.1.7   MyApp
@angular/compiler                  5.2.9            5.2.9   6.1.7   MyApp
@angular/compiler-cli              5.2.9            5.2.9   6.1.7   MyApp
@angular/core                      5.2.9            5.2.9   6.1.7   MyApp
@angular/forms                     5.2.9            5.2.9   6.1.7   MyApp
@angular/http                      5.2.9            5.2.9   6.1.7   MyApp
@angular/platform-browser          5.2.9            5.2.9   6.1.7   MyApp
@angular/platform-browser-dynamic  5.2.9            5.2.9   6.1.7   MyApp
@ionic-native/base64               4.5.3            4.5.3   4.14.0  MyApp
@ionic-native/core                 4.5.3            4.5.3   4.14.0  MyApp
@ionic-native/firebase             4.5.3            4.5.3   4.14.0  MyApp
@ionic-native/network              4.5.3            4.5.3   4.14.0  MyApp
@ionic-native/splash-screen        4.5.3            4.5.3   4.14.0  MyApp
@ionic-native/status-bar           4.5.3            4.5.3   4.14.0  MyApp
@ionic/storage                     2.1.3            2.1.3   2.2.0   MyApp
ansi-regex                         3.0.0            3.0.0   4.0.0   MyApp
ionicons                           3.0.0            3.0.0   4.4.3   MyApp
rxjs                               5.5.7            5.5.7   6.3.2   MyApp
zone.js                            0.8.20           0.8.20  0.8.26  MyApp
undefined
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ cordova plugin list
com-badrit-base64 0.2.0 "Base64"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-firebase 1.1.2 "Google Firebase Plugin"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ cordova-check-plugins 

**********************
* Up-to-date plugins *
**********************

plugin: cordova-plugin-whitelist
source: npm://cordova-plugin-whitelist@^1.3.3
installed version: 1.3.3
remote version: 1.3.3

plugin: cordova-plugin-device
source: npm://cordova-plugin-device@^2.0.2
installed version: 2.0.2
remote version: 2.0.2

plugin: cordova-plugin-splashscreen
source: npm://cordova-plugin-splashscreen@^5.0.2
installed version: 5.0.2
remote version: 5.0.2

plugin: cordova-plugin-ionic-webview
source: npm://cordova-plugin-ionic-webview@^1.2.1
installed version: 1.2.1
remote version: 1.2.1

plugin: cordova-plugin-ionic-keyboard
source: npm://cordova-plugin-ionic-keyboard@^2.1.2
installed version: 2.1.2
remote version: 2.1.2

plugin: com-badrit-base64
source: npm://com-badrit-base64@^0.2.0
installed version: 0.2.0
remote version: 0.2.0

plugin: cordova-plugin-network-information
source: npm://cordova-plugin-network-information@^2.0.1
installed version: 2.0.1
remote version: 2.0.1


***************************
* Plugin update available *
***************************

plugin: cordova-plugin-firebase
source: npm://cordova-plugin-firebase@^2.0.1
installed version: 1.1.2
remote version: 2.0.2

rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ cordova plugin remove cordova-plugin-firebase
Uninstalling cordova-plugin-firebase from android
Android Studio project detected
missing file :: app/src/main
Error during processing of action! Attempting to revert...
(node:6352) UnhandledPromiseRejectionWarning: Error: Uh oh!
ENOENT: no such file or directory, open '/home/rodrigo/Projetos/MyApp/ionic/MyApp/platforms/android/AndroidManifest.xml'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Object.parseElementtreeSync (/home/rodrigo/Projetos/MyApp/ionic/MyApp/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js:180:27)
    at new AndroidManifest (/home/rodrigo/Projetos/MyApp/ionic/MyApp/platforms/android/cordova/lib/AndroidManifest.js:29:20)
    at AndroidProject.getPackageName (/home/rodrigo/Projetos/MyApp/ionic/MyApp/platforms/android/cordova/lib/AndroidProject.js:99:12)
    at AndroidProject.getCustomSubprojectRelativeDir (/home/rodrigo/Projetos/MyApp/ionic/MyApp/platforms/android/cordova/lib/AndroidProject.js:105:28)
    at uninstall (/home/rodrigo/Projetos/MyApp/ionic/MyApp/platforms/android/cordova/lib/pluginHandlers.js:131:46)
    at ActionStack.process (/home/rodrigo/Projetos/MyApp/ionic/MyApp/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
    at PluginManager.doOperation (/home/rodrigo/Projetos/MyApp/ionic/MyApp/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
    at PluginManager.removePlugin (/home/rodrigo/Projetos/MyApp/ionic/MyApp/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:148:17)
(node:6352) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6352) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ cordova plugin add cordova-plugin-firebase
Plugin "cordova-plugin-firebase" already installed on android.
Adding cordova-plugin-firebase to package.json
Saved plugin info for "cordova-plugin-firebase" to config.xml
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$ cat package.json 
{
  "name": "MyApp",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/animations": "5.2.9",
    "@angular/common": "5.2.9",
    "@angular/compiler": "5.2.9",
    "@angular/compiler-cli": "5.2.9",
    "@angular/core": "5.2.9",
    "@angular/forms": "5.2.9",
    "@angular/http": "5.2.9",
    "@angular/platform-browser": "5.2.9",
    "@angular/platform-browser-dynamic": "5.2.9",
    "@ionic-native/base64": "4.5.3",
    "@ionic-native/core": "4.5.3",
    "@ionic-native/firebase": "4.5.3",
    "@ionic-native/network": "4.5.3",
    "@ionic-native/splash-screen": "4.5.3",
    "@ionic-native/status-bar": "4.5.3",
    "@ionic/app-scripts": "^3.2.0",
    "@ionic/storage": "2.1.3",
    "angularfire2": "^5.0.1",
    "ansi-regex": "^3.0.0",
    "browserslist": "^4.1.1",
    "ci-info": "^1.5.1",
    "cli-table3": "^0.5.1",
    "com-badrit-base64": "^0.2.0",
    "cordova-android": "7.1.1",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-firebase": "^2.0.1",
    "cordova-plugin-ionic-keyboard": "^2.1.2",
    "cordova-plugin-ionic-webview": "^2.1.4",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "figgy-pudding": "^3.5.1",
    "firebase": "^5.5.0",
    "highcharts": "^6.1.3",
    "hoek": "^5.0.4",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "is-fullwidth-code-point": "^2.0.0",
    "libcipm": "^3.0.2",
    "mime-types": "^2.1.20",
    "node-pre-gyp": "^0.11.0",
    "npm": "^6.4.1",
    "npm-profile": "^4.0.1",
    "opener": "^1.5.1",
    "rxjs": "5.5.7",
    "rxjs-compat": "^6.3.2",
    "strip-ansi": "^4.0.0",
    "sw-toolbox": "3.6.0",
    "typescript": "^3.0.3",
    "zone.js": "0.8.20"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.8",
    "rxjs": "^6.3.2",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-firebase": {},
      "com-badrit-base64": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-network-information": {}
    },
    "platforms": [
      "android"
    ]
  }
}
rodrigo@rf511:~/Projetos/MyApp/ionic/MyApp$

I’ve tried to install cordova-plugin-firebase version 2.0.2 after ran cordova-check-plugins, but an error happens.

After install all latest package versions suggested from npm outdated until it command not return more suggestions, the result is the same “myApp has stopped”.

Suggestions?

What does that mean? Opening the app?

This is almost never the correct solution if you also update other stuff besides Cordova. Ionic needs a specific set of dependencies to work (well).

What device are you testing on? Android version?
Can you create and start a new app created with ionic start?

1 Like

Yes, to open the app. I wrote wrong and forgot to fix before post that. I’m testing in Android 4.4.4 and 8.0.0. The problem occurs in both.

You gave me an excellent idea. Then, I solved the problem creating a new project and transferring the src directory from old project to new project, here my steps:

$ ionic start NewProject blank
$ cd NewProject
$ rm -rf src
$ cp -a ../OldProject/src ./
$ chmod 755 src
$ cd src
$ find . -type f | xargs chmod 655
$ find . -type d | xargs chmod 755
$ cd ..
$ npm update
$ npm install rxjs --save
$ npm install rxjs-compat --save
$ npm install firebase --save
$ npm install angularfire2 --save
$ npm install @ionic-native/network --save
$ npm update
$ ionic cordova platform add android@7.1.1
$ ionic cordova build android
$ cd ~/Android/Sdk/platform-tools
$ ./adb install -r /home/rodrigo/Projetos/NewProject/platforms/android/app/build/outputs/apk/debug/app-debug.apk

I’ve ran this commands a bunch of times. One thing that I’ve stopped to install was @ionic-native/firebase , every time that I’ve installed it, bugs appeared during the building, I don’t know why. After I removed the instructions from my list of commands the problem was solved.

Here is:

rodrigo@rf511:~$ cd Projetos/
rodrigo@rf511:~/Projetos$ ionic start NewProject blank
✔ Preparing directory ./NewProject - done!
✔ Downloading and extracting blank starter - done!
? Integrate your new app with Cordova to target native iOS and Android? Yes
> ionic integrations enable cordova --quiet
[INFO] Downloading integration cordova
[INFO] Copying integrations files to project
[OK] Integration cordova added!

Installing dependencies may take several minutes.

     ✨   IONIC  DEVAPP   ✨

 Speed up development with the Ionic DevApp, our fast, on-device testing mobile app

  -  🔑   Test on iOS and Android without Native SDKs
  -  🚀   LiveReload for instant style and JS updates

 -->    Install DevApp: https://bit.ly/ionic-dev-app    <--

────────────────────────────────────────────────────────────

> npm i
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated hoek@2.16.3: The major version is no longer supported. Please update to 4.x or newer

> node-sass@4.9.0 install /home/rodrigo/Projetos/NewProject/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/rodrigo/.npm/node-sass/4.9.0/linux-x64-57_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall /home/rodrigo/Projetos/NewProject/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.9.0 postinstall /home/rodrigo/Projetos/NewProject/node_modules/node-sass
> node scripts/build.js

Binary found at /home/rodrigo/Projetos/NewProject/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm notice created a lockfile as package-lock.json. You should commit this file.
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":"linux","arch":"x64"})

added 765 packages from 660 contributors and audited 7059 packages in 20.937s
found 0 vulnerabilities

> git init
Initialized empty Git repository in /home/rodrigo/Projetos/NewProject/.git/

     🔥   IONIC  PRO   🔥

 Supercharge your Ionic development with the Ionic Pro SDK

  -  ⚠️   Track runtime errors in real-time, back to your original TypeScript
  -  📲  Push remote updates and skip the app store queue

 Learn more about Ionic Pro: https://ionicframework.com/pro

────────────────────────────────────────────────────────────

? Install the free Ionic Pro SDK and connect your app? No
> git add -A
> git commit -m "Initial commit" --no-gpg-sign

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'rodrigo@rf511.(none)')
[WARN] Error encountered during commit. Disabling further git operations.

[INFO] Next Steps:
       
       - Go to your newly created project: cd ./NewProject
       - Get Ionic DevApp for easy device testing: https://bit.ly/ionic-dev-app
rodrigo@rf511:~/Projetos$ cd NewProject/
rodrigo@rf511:~/Projetos/NewProject$ rm -rf src
rodrigo@rf511:~/Projetos/NewProject$ cp -a ../OldProject/src ./
rodrigo@rf511:~/Projetos/NewProject$ chmod 755 src
rodrigo@rf511:~/Projetos/NewProject$ cd src
rodrigo@rf511:~/Projetos/NewProject/src$ find . -type f | xargs chmod 655
rodrigo@rf511:~/Projetos/NewProject/src$ find . -type d | xargs chmod 755
rodrigo@rf511:~/Projetos/NewProject/src$ cd ..
rodrigo@rf511:~/Projetos/NewProject$ npm update
rodrigo@rf511:~/Projetos/NewProject$ npm install rxjs --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":"linux","arch":"x64"})

+ rxjs@5.5.11
updated 1 package and audited 7059 packages in 7.337s
found 0 vulnerabilities

rodrigo@rf511:~/Projetos/NewProject$ npm install rxjs-compat --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":"linux","arch":"x64"})

+ rxjs-compat@6.3.2
added 1 package and audited 7060 packages in 8.09s
found 0 vulnerabilities

rodrigo@rf511:~/Projetos/NewProject$ npm install firebase --save

> grpc@1.13.1 install /home/rodrigo/Projetos/NewProject/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp WARN Using request for node-pre-gyp https download 
[grpc] Success: "/home/rodrigo/Projetos/NewProject/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node" is installed via remote
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":"linux","arch":"x64"})

+ firebase@5.5.0
added 111 packages from 48 contributors and audited 7257 packages in 34.882s
found 0 vulnerabilities

rodrigo@rf511:~/Projetos/NewProject$ npm install angularfire2 --save
npm WARN deprecated angularfire2@5.0.1: AngularFire has moved, we are now at @angular/fire
npm WARN @angular/fire@5.0.0 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
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":"linux","arch":"x64"})

+ angularfire2@5.0.1
added 2 packages from 1 contributor and audited 7259 packages in 9.039s
found 0 vulnerabilities

rodrigo@rf511:~/Projetos/NewProject$ npm install @ionic-native/network --save
npm WARN @angular/fire@5.0.0 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
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":"linux","arch":"x64"})

+ @ionic-native/network@4.14.0
added 1 package from 1 contributor and audited 7260 packages in 10.417s
found 0 vulnerabilities

rodrigo@rf511:~/Projetos/NewProject$ npm install highcharts --save
npm WARN @angular/fire@5.0.0 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
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":"linux","arch":"x64"})

+ highcharts@6.1.3
added 1 package from 1 contributor and audited 7261 packages in 7.396s
found 0 vulnerabilities

rodrigo@rf511:~/Projetos/NewProject$ npm outdated
Package                            Current  Wanted  Latest  Location
@angular/animations                 5.2.11  5.2.11   6.1.7  NewProject
@angular/common                     5.2.11  5.2.11   6.1.7  NewProject
@angular/compiler                   5.2.11  5.2.11   6.1.7  NewProject
@angular/compiler-cli               5.2.11  5.2.11   6.1.7  NewProject
@angular/core                       5.2.11  5.2.11   6.1.7  NewProject
@angular/forms                      5.2.11  5.2.11   6.1.7  NewProject
@angular/http                       5.2.11  5.2.11   6.1.7  NewProject
@angular/platform-browser           5.2.11  5.2.11   6.1.7  NewProject
@angular/platform-browser-dynamic   5.2.11  5.2.11   6.1.7  NewProject
@ionic-native/core                  4.12.2  4.12.2  4.14.0  NewProject
@ionic-native/splash-screen         4.12.2  4.12.2  4.14.0  NewProject
@ionic-native/status-bar            4.12.2  4.12.2  4.14.0  NewProject
@ionic/storage                       2.1.3   2.1.3   2.2.0  NewProject
ionicons                             3.0.0   3.0.0   4.4.3  NewProject
rxjs                                5.5.11  5.5.12   6.3.2  NewProject
typescript                           2.6.2   2.6.2   3.0.3  NewProject
rodrigo@rf511:~/Projetos/NewProject$ npm update
npm WARN @angular/fire@5.0.0 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.0.0 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
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":"linux","arch":"x64"})

+ rxjs@5.5.12
updated 1 package and audited 7261 packages in 7.004s
found 0 vulnerabilities

rodrigo@rf511:~/Projetos/NewProject$ npm outdated
Package                            Current  Wanted  Latest  Location
@angular/animations                 5.2.11  5.2.11   6.1.7  NewProject
@angular/common                     5.2.11  5.2.11   6.1.7  NewProject
@angular/compiler                   5.2.11  5.2.11   6.1.7  NewProject
@angular/compiler-cli               5.2.11  5.2.11   6.1.7  NewProject
@angular/core                       5.2.11  5.2.11   6.1.7  NewProject
@angular/forms                      5.2.11  5.2.11   6.1.7  NewProject
@angular/http                       5.2.11  5.2.11   6.1.7  NewProject
@angular/platform-browser           5.2.11  5.2.11   6.1.7  NewProject
@angular/platform-browser-dynamic   5.2.11  5.2.11   6.1.7  NewProject
@ionic-native/core                  4.12.2  4.12.2  4.14.0  NewProject
@ionic-native/splash-screen         4.12.2  4.12.2  4.14.0  NewProject
@ionic-native/status-bar            4.12.2  4.12.2  4.14.0  NewProject
@ionic/storage                       2.1.3   2.1.3   2.2.0  NewProject
ionicons                             3.0.0   3.0.0   4.4.3  NewProject
rxjs                                5.5.12  5.5.12   6.3.2  NewProject
typescript                           2.6.2   2.6.2   3.0.3  NewProject
rodrigo@rf511:~/Projetos/NewProject$ ionic serve -c
> ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --consolelogs --nobrowser
[app-scripts] [19:31:44]  ionic-app-scripts 3.2.0 
[app-scripts] [19:31:44]  watch started ... 
[app-scripts] [19:31:44]  build dev started ... 
[app-scripts] [19:31:44]  clean started ... 
[app-scripts] [19:31:44]  clean finished in 1 ms 
[app-scripts] [19:31:44]  copy started ... 
[app-scripts] [19:31:44]  copy finished in 115 ms 
[app-scripts] [19:31:44]  deeplinks started ... 
[app-scripts] [19:31:45]  deeplinks finished in 530 ms 
[app-scripts] [19:31:45]  transpile started ... 
[app-scripts] [19:31:51]  transpile finished in 5.95 s 
[app-scripts] [19:31:51]  preprocess started ... 
[app-scripts] [19:31:51]  preprocess finished in 1 ms 
[app-scripts] [19:31:51]  webpack started ... 
[app-scripts] [19:31:59]  webpack finished in 7.94 s 
[app-scripts] [19:31:59]  sass started ... 
[app-scripts] [19:32:00]  sass finished in 1.10 s 
[app-scripts] [19:32:00]  postprocess started ... 
[app-scripts] [19:32:00]  postprocess finished in 10 ms 
[app-scripts] [19:32:00]  lint started ... 
[app-scripts] [19:32:00]  build dev finished in 15.77 s 
[app-scripts] [19:32:00]  watch ready in 15.88 s 

[INFO] Development server running!
       
       Local: http://localhost:8100
       External: http://192.168.0.105:8100
       DevApp: NewProject@8100 on rf511
       
       Use Ctrl+C to quit this process

[INFO] Browser window opened to http://localhost:8100!

[app-scripts] [19:32:04]  console.warn: Ionic Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to 
[app-scripts]             a) run in a real device or simulator and b) include cordova.js in your index.html 
[app-scripts] [19:32:04]  console.warn: Ionic Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to a) 
[app-scripts]             run in a real device or simulator and b) include cordova.js in your index.html 
[app-scripts] [19:32:05]  lint finished in 5.19 s 
^Crodrigo@rf511:~/Projetos/NewProject$ ionic cordova platform add android@7.1.1
> cordova platform add android@7.1.1 --save
Using cordova-fetch for cordova-android@7.1.1
Adding android project...
Creating Cordova project for the Android platform:
  Path: platforms/android
  Package: io.ionic.starter
  Name: NewProject
  Activity: MainActivity
  Android target: android-27
Android project created with cordova-android@7.1.1
Android Studio project detected
Android Studio project detected
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
          
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Installing "cordova-plugin-statusbar" for android
Adding cordova-plugin-statusbar to package.json
Saved plugin info for "cordova-plugin-statusbar" to config.xml
Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
Installing "cordova-plugin-device" for android
Adding cordova-plugin-device to package.json
Saved plugin info for "cordova-plugin-device" to config.xml
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for android
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for "cordova-plugin-splashscreen" to config.xml
Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-webview" for android
Subproject Path: CordovaLib
Subproject Path: app
Adding cordova-plugin-ionic-webview to package.json
Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
Discovered plugin "cordova-plugin-ionic-keyboard" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-keyboard" for android
Adding cordova-plugin-ionic-keyboard to package.json
Saved plugin info for "cordova-plugin-ionic-keyboard" to config.xml
--save flag or autosave detected
Saving android@~7.1.1 into config.xml file ...
rodrigo@rf511:~/Projetos/NewProject$ ionic cordova build android
> ionic-app-scripts build --target cordova --platform android
[19:34:44]  ionic-app-scripts 3.2.0 
[19:34:44]  build dev started ... 
[19:34:44]  clean started ... 
[19:34:44]  clean finished in 4 ms 
[19:34:44]  copy started ... 
[19:34:44]  copy finished in 164 ms 
[19:34:44]  deeplinks started ... 
[19:34:44]  deeplinks finished in 515 ms 
[19:34:44]  transpile started ... 
[19:34:50]  transpile finished in 5.85 s 
[19:34:50]  preprocess started ... 
[19:34:50]  preprocess finished in less than 1 ms 
[19:34:50]  webpack started ... 
[19:34:58]  webpack finished in 8.29 s 
[19:34:58]  sass started ... 
[19:35:00]  sass finished in 1.16 s 
[19:35:00]  postprocess started ... 
[19:35:00]  postprocess finished in 9 ms 
[19:35:00]  lint started ... 
[19:35:00]  build dev finished in 16.12 s 
[19:35:04]  lint finished in 4.10 s 
> cordova build android
Android Studio project detected
ANDROID_HOME=/opt/android-studio
JAVA_HOME=/opt/jdk
studio
:wrapper

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
  at build_4ab07mkra447noftdau9vxvi1.run(/home/rodrigo/Projetos/NewProject/platforms/android/app/build.gradle:143)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugRenderscript
:CordovaLib:checkDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:prepareLintJar
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:platformAttrExtractor
:CordovaLib:processDebugManifest
:CordovaLib:javaPreCompileDebug
:CordovaLib:processDebugJavaRes NO-SOURCE
:app:preBuild UP-TO-DATE
:app:preDebugBuild
:app:compileDebugAidl
:CordovaLib:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript
:app:checkDebugManifest
:app:generateDebugBuildConfig
:app:prepareLintJar
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:createDebugCompatibleScreenManifests
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug
:app:compileDebugNdk NO-SOURCE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:CordovaLib:compileDebugNdk NO-SOURCE
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNativeLibsWithMergeJniLibsForDebug
:CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug
:app:mergeDebugJniLibFolders
:app:processDebugJavaRes NO-SOURCE
:app:validateSigningDebug
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
:app:processDebugResources
:app:generateDebugSources
:app:javaPreCompileDebug
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileDebugJavaWithJavac
:app:compileDebugSources
:app:transformClassesWithStackFramesFixerForDebug
:app:transformClassesWithDesugarForDebug
:app:transformClassesWithDexBuilderForDebug
:app:transformDexArchiveWithExternalLibsDexMergerForDebug
:app:transformDexArchiveWithDexMergerForDebug
:app:transformNativeLibsWithMergeJniLibsForDebug
:app:transformResourcesWithMergeJavaResForDebug
:app:packageDebug
:app:assembleDebug
:app:cdvBuildDebug

BUILD SUCCESSFUL in 7s
46 actionable tasks: 46 executed
Built the following apk(s): 
  /home/rodrigo/Projetos/NewProject/platforms/android/app/build/outputs/apk/debug/app-debug.apk
rodrigo@rf511:~/Projetos/NewProject$ cd ~/Android/Sdk/platform-tools/
rodrigo@rf511:~/Android/Sdk/platform-tools$ ./adb devices
List of devices attached
7682ecde  device

rodrigo@rf511:~/Android/Sdk/platform-tools$ ./adb install -r /home/rodrigo/Projetos/NewProject/platforms/android/app/build/outputs/apk/debug/app-debug.apk
/home/rodrigo/Projetos/NewProject/platforms/android/app/build/outputs/apk/debug/app-debug.apk: 1 file pushed. 5.8 MB/s (5490022 bytes in 0.902s)
  pkg: /data/local/tmp/app-debug.apk
Success
rodrigo@rf511:~/Android/Sdk/platform-tools$

Thank you!

1 Like