EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 446 forks source link

Unable to build application when adding firestore #858

Closed antonio-costa closed 6 years ago

antonio-costa commented 6 years ago

I've been using MLKit with vue-cli-template without any problems, but now I've added firestore and the app doesn't build. I've followed this to add firestore:

In case you're upgrading and you have the firebase.nativescript.json file in your project root, edit it and add: "firestore": true. Then run rm -rf platforms && rm -rf node_modules && npm i

I've tried to start another project with only MLKit and it works, only stops working when I add Firestore. Finally, if I remove Firestore (after installing it) the app will stay broken, even if I set "firestore": false, delete node_modules and run 'npm run clean'.

This is the output the console gives (error is in bold):

Toni@DESKTOP-P5S5LBO MINGW32 ~/vue-qrcodes (master) $ npm run watch:android

vue-qrcodes@1.0.0 watch:android C:\Users\Toni\vue-qrcodes npm run watch -- --env.android

vue-qrcodes@1.0.0 watch C:\Users\Toni\vue-qrcodes webpack --watch --env.tnsAction run "--env.android"

info: Copying NativeScript plugins to template dependencies... info: Preparing NativeScript application from template... npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN vue-qrcodes@ No repository field.

info: Bundling application for android...

Webpack is watching the files…

Executing post-build scripts info: Running NativeScript application... Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder. Searching for devices... Copying template files... Platform android successfully added. v4.2.0 Executing before-prepare hook from C:\Users\Toni\vue-qrcodes\dist\hooks\before-prepare\nativescript-plugin-firebase.js Preparing project... Successfully prepared plugin nativescript-theme-core for android. Successfully prepared plugin nativescript-vue for android. Successfully prepared plugin tns-core-modules for android. Successfully prepared plugin nativescript-plugin-firebase for android. Successfully prepared plugin nativescript-vibrate for android. Successfully prepared plugin tns-core-modules-widgets for android. Project successfully prepared (Android) Executing after-prepare hook from C:\Users\Toni\vue-qrcodes\dist\hooks\after-prepare\firebase-build-gradle.js Configure firebase Executing after-prepare hook from C:\Users\Toni\vue-qrcodes\dist\hooks\after-prepare\firebase-copy-google-services.js Copy C:\Users\Toni\vue-qrcodes\dist\app\App_Resources\Android\google-services.json to C:\Users\Toni\vue-qrcodes\dist\platforms\android\app\google-services.json. Executing after-prepare hook from C:\Users\Toni\vue-qrcodes\dist\hooks\after-prepare\nativescript-plugin-firebase.js Building project... Gradle build...

  • setting applicationId
  • applying user-defined configuration from C:\Users\Toni\vue-qrcodes\dist\app\App_Resources\Android\app.gradle
  • adding nativescript runtime package dependency: nativescript-optimized-with-inspector
  • adding aar plugin dependency: C:\Users\Toni\vue-qrcodes\dist\node_modules\nativescript-plugin-firebase\platforms\android\firebase-release.aar
  • adding aar plugin dependency: C:\Users\Toni\vue-qrcodes\dist\node_modules\nativescript-vibrate\platforms\android\nativescript_vibrate.aar
  • adding aar plugin dependency: C:\Users\Toni\vue-qrcodes\dist\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) Skip com.google.errorprone.annotations.IncompatibleModifiers Error: java.lang.NullPointerException Unable to apply changes on device: 2a13287e9905. Error is: Command gradlew.bat failed with exit code 1.
cyberdelahoz95 commented 6 years ago

I am having exactly same issue

makesitenow commented 6 years ago

Same. Had to revert all the way down to 5.3.1 for it to work. Using vue-cli.

EddyVerbruggen commented 6 years ago

Anyone want to share a repo (and steps to reproduce) with the issue?

makesitenow commented 6 years ago

https://bitbucket.org/makesite/schools-nativescript-vuejs/src/master/

  1. Update the plugin to 6.5
  2. npm run clean
  3. npm run watch:android
EddyVerbruggen commented 6 years ago

@makesitenow I'm pretty close to finding the issue, will post an update here.

EddyVerbruggen commented 6 years ago

@makesitenow I don't have write access to your repo, so can you apply this patch, run rm -rf node_modules; npm i and try again?

vue-patch.txt

makesitenow commented 6 years ago

Thanks!! Still writes an error: Skip com.google.errorprone.annotations.IncompatibleModifiers Error: java.lang.NullPointerException But then the projects builds and runs on device. I assume the vue cli template is just dated? Thanks again

EddyVerbruggen commented 6 years ago

I saw that message as well but no idea what it means/causes it.

kurmivivek295 commented 5 years ago

Was that problem solved? I am also getting the same error. I am using Angular.

makesitenow commented 5 years ago

@kurmivivek295 It recently returned for me. I updated the plugin to its latest version, updates tns core and so forth, and it started working again.

jingjiewei commented 5 years ago

got this error under

    "@angular/animations": "~7.1.0",
    "@angular/common": "~7.1.0",
    "@angular/compiler": "~7.1.0",
    "@angular/core": "~7.1.0",
    "@angular/forms": "~7.1.0",
    "@angular/http": "~7.1.0",
    "@angular/platform-browser": "~7.1.0",
    "@angular/platform-browser-dynamic": "~7.1.0",
    "@angular/router": "~7.1.0",
    "nativescript-angular": "~7.1.0",
    "nativescript-camera": "^4.1.1",
    "nativescript-phone": "^1.4.0",
    "nativescript-plugin-firebase": "^7.7.0",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-autocomplete": "^3.11.0",
    "reflect-metadata": "~0.1.12",
    "rxjs": "~6.3.0",
    "tns-core-modules": "~5.1.0",
    "zone.js": "~0.8.26"
janakact commented 5 years ago

got the same error under..

    "@vue/devtools": "^5.0.0-beta.3",
    "@vuex-orm/core": "^0.27.0",
    "firebase": "^5.9.3",
    "lodash": "^4.17.11",
    "moment": "^2.22.2",
    "nativescript-carousel": "^4.1.0",
    "nativescript-checkbox": "^3.0.3",
    "nativescript-feedback": "^1.3.1",
    "nativescript-fonticon": "^2.0.0",
    "nativescript-imagepicker": "^6.0.4",
    "nativescript-insomnia": "^1.2.2",
    "nativescript-localize": "^4.1.0",
    "nativescript-masked-text-field": "^4.0.1",
    "nativescript-maskedinput": "0.0.3",
    "nativescript-modal-datetimepicker": "^1.1.12",
    "nativescript-plugin-firebase": "^7.1.5",
    "nativescript-range-seek-bar": "^1.0.2",
    "nativescript-socket.io": "^0.9.0",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-toast": "^1.4.6",
    "nativescript-ui-dataform": "^3.7.3",
    "nativescript-ui-gauge": "^4.0.0",
    "nativescript-ui-listview": "^5.0.0",
    "nativescript-vue": "^2.0.0",
    "nativescript-vue-devtools": "^1.1.0",
    "tns-core-modules": "^5.0.5",
    "vuex": "^3.0.1",
    "webpack-bundle-analyzer": "^3.0.3"
carlosdelfino commented 5 years ago

I too:

  "nativescript": {
    "id": "org.islamicworks.islamicapp",
    "tns-android": {
      "version": "6.0.2"
    }
  },
  "dependencies": {
    "@angular-extensions/model": "^8.1.0",
    "@angular/animations": "^8.0.3",
    "@angular/cdk": "^8.1.2",
    "@angular/common": "^8.1.3",
    "@angular/compiler": "^8.1.3",
    "@angular/core": "^8.1.3",
    "@angular/forms": "^8.1.3",
    "@angular/http": "~8.0.0-beta.10",
    "@angular/material": "^8.1.2",
    "@angular/platform-browser": "^8.1.3",
    "@angular/platform-browser-dynamic": "^8.1.3",
    "@angular/router": "^8.1.3",
    "@nstudio/nativescript-cardview": "^1.0.0",
    "@nstudio/nativescript-floatingactionbutton": "^1.0.1",
    "@nstudio/nativescript-loading-indicator": "^1.0.0",
    "encodeurl": "^1.0.2",
    "nativescript-angular": "^8.1.0",
    "nativescript-background-http": "^4.0.0",
    "nativescript-calendar": "^2.1.0",
    "nativescript-geolocation": "^5.1.0",
    "nativescript-google-maps-sdk": "^2.7.0",
    "nativescript-google-maps-utils": "^0.1.3",
    "nativescript-masked-text-field": "^4.0.2",
    "nativescript-ng2-fonticon": "^1.3.4",
    "nativescript-permissions": "^1.3.7",
    "nativescript-plugin-firebase": "^9.1.1",
    "nativescript-theme-core": "^1.0.6",
    "nativescript-ui-calendar": "^5.0.0",
    "openpgp": "git+https://github.com/carlosdelfino/nativescript-openpgpjs.git",
    "reflect-metadata": "^0.1.13",
    "rxjs": "^6.5.2",
    "rxjs-compat": "^6.5.2",
    "tns-core-modules": "^6.0.7",
    "zone.js": "^0.9.1"
  },
  "devDependencies": {
    "@angular/cli": "^8.2.1",
    "@angular/compiler-cli": "8.0.0",
    "@nativescript/schematics": "^0.6.0",
    "@ngtools/webpack": "8.0.0",
    "@types/jasmine": "^3.3.13",
    "gulp": "^4.0.2",
    "gulp-exec": "^4.0.0",
    "nativescript": "^6.0.3",
    "nativescript-angular-cli": "^0.1.9",
    "nativescript-dev-webpack": "~1.0.0",
    "node-sass": "^4.12.0",
    "run-sequence": "^2.2.1",
    "shelljs": "^0.8.3",
    "tns-platform-declarations": "^6.0.7",
    "typescript": "3.4.5"
  },
EddyVerbruggen commented 5 years ago

Share a repo and I might take a look.

carlosdelfino commented 5 years ago

I haven't released the code yet because it's too messy, despite the error:

Skip com.google.errorprone.annotations.IncompatibleModifiers
Error: java.lang.NullPointerException

it works almost perfectly, I'm just having functional issues as reported in the issue #1392, not if it's related.

I can zip and email you.

olegjo commented 4 years ago

I had the same issue. By adding multiDexEnabled true under defaultConfig in app.gradle resolved the issue.