EddyVerbruggen / nativescript-plugin-firebase

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

unable to build any platform #1035

Open diadal opened 5 years ago

diadal commented 5 years ago

on Android I keep getting this

FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of input files for task ':app:checkDebugClasspath' property 'compileClasspath' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[10.2.
  6]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-auth:10.2.6 -> com.google.android.gms:play-services-basement@[1
  0.2.6], but play-services-basement version was 16.1.0.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends onto com.google.firebase:firebase-core@16.0.4
  -- Project 'app' depends onto com.google.firebase:firebase-messaging@17.3.4
  -- Project 'app' depends onto com.google.android.gms:play-services-base@16.0.1
  -- Project 'app' depends onto com.google.firebase:firebase-auth@16.0.5
  -- Project 'app' depends onto com.google.firebase:firebase-perf@16.2.0
  -- Project 'app' depends onto com.google.android.gms:play-services-auth@10.2.6

  For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
  endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
  github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
  uild.gradle file.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
Unable to apply changes on device: emulator-5556. Error is: Command ./gradlew failed with exit code 1.
EddyVerbruggen commented 5 years ago

Looks like the main problem here is com.google.android.gms:play-services-auth@10.2.6. Which plugin adds that? I mean, do you have any other social sign-in plugin in your project for instance?

diadal commented 5 years ago

yes I do nativescript-social-login

"dependencies": {
    "@vue/devtools": "5.0.0-beta.3",
    "ajv": "^6.5.5",
    "axios": "^0.18.0",
    "clean": "^4.0.2",
    "electron": "^2.0.13",
    "extract-text-webpack-plugin": "^3.0.2",
    "nativescript-barcodescanner": "^2.7.9",
    "nativescript-cardview": "^3.1.1",
    "nativescript-clipboard": "^1.1.7",
    "nativescript-drop-down": "^4.0.1",
    "nativescript-feedback": "^1.3.1",
    "nativescript-gradient": "^2.0.1",
    "nativescript-loading-indicator": "^2.4.0",
    "nativescript-localstorage": "^2.0.0",
    "nativescript-mediafilepicker": "^2.0.14",
    "nativescript-noice-image-picker": "^1.0.0",
    "nativescript-numeric-keyboard": "^4.1.0",
    "nativescript-permissions": "^1.2.3",
    "nativescript-platform-css": "^1.6.6",
    "nativescript-plugin-firebase": "^7.4.2",
    "nativescript-pulltorefresh": "^2.2.0",
    "nativescript-secure-storage": "^2.3.0",
    "nativescript-snackbar": "^4.0.0",
    "nativescript-social-login": "^4.0.1",
    "nativescript-socket.io": "^0.9.0",
    "nativescript-star-ratings": "^1.0.0",
    "nativescript-statusbar": "^4.0.1",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-toast": "^1.4.6",
    "nativescript-ui-autocomplete": "3.9.0",
    "nativescript-ui-chart": "3.9.1",
    "nativescript-ui-sidedrawer": "^4.3.1",
    "nativescript-vue": "^2.0.0",
    "nativescript-vue-devtools": "^1.0.0",
    "tns": "^0.2.0",
    "tns-core-modules": "^5.0.2",
    "typescript": "^3.1.6",
    "utils": "^0.3.1",
    "vue-cli-template-nativescript": "1.0.2",
    "vuex": "^3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.1.6",
    "@babel/preset-env": "^7.1.6",
    "babel-loader": "^8.0.2",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "gulp-uglify": "^3.0.1",
    "lazy": "1.0.11",
    "nativescript-dev-sass": "^1.6.0",
    "nativescript-dev-webpack": "^0.17.0",
    "nativescript-login": "1.0.1",
    "nativescript-vue-template-compiler": "^2.0.0",
    "node-sass": "^4.10.0",
    "npm-run-all": "^4.1.3",
    "terser-webpack-plugin": "^1.1.0",
    "vue-loader": "^15.2.6",
    "clean-webpack-plugin": "^0.1.19",
    "copy-webpack-plugin": "^4.5.2",
    "css-hot-loader": "^1.4.2",
    "css-loader": "^1.0.0",
    "mini-css-extract-plugin": "^0.4.1",
    "nativescript-worker-loader": "~0.9.0",
    "sass-loader": "^7.1.0",
    "uglifyjs-webpack-plugin": "~1.2.7",
    "webpack": "^4.16.4",
    "webpack-bundle-analyzer": "~2.13.1",
    "webpack-cli": "^3.1.0"
  }
EddyVerbruggen commented 5 years ago

Can you disable the Google sign-in feature in the Firebase plugin? That may help to fix this issue as it depends on a much older play services version.

Alternatively, you can try adding this to App_Resources/android/app.gradle:

android {
    // other stuff here

    project.ext {
       googlePlayServicesVersion = "16.1.0"
    }
}
diadal commented 5 years ago

build.gradle

buildscript {

    repositories {
        google()
        jcenter()
        maven { url "https://maven.fabric.io/public" }
 }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "com.google.gms:google-services:4.2.0"
        classpath "io.fabric.tools:gradle:1.26.1"
 }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

app.gradle

// Add your native dependencies here:

android {
  defaultConfig {  
    generatedDensities = []
    applicationId = "org.exmapl.com"
    multiDexEnabled true
  }
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }
  dexOptions {
  javaMaxHeapSize "4g"
  }

  project.ext {
       googlePlayServicesVersion = "16.1.0"
    }

} 

def settingsGradlePath

if(project.hasProperty("appResourcesPath")){
    settingsGradlePath = "$project.appResourcesPath/Android/settings.gradle";
} else {
    settingsGradlePath = "$rootDir/../../app/App_Resources/Android/settings.gradle";
}

def settingsGradleFile = new File(settingsGradlePath);

if(settingsGradleFile.exists())
{
    apply from: settingsGradleFile;
}

firebase.nativescript.json

{
    "external_push_client_only": false,
    "using_ios": true,
    "using_android": true,
    "firestore": false,
    "realtimedb": false,
    "authentication": false,
    "remote_config": false,
    "performance_monitoring": false,
    "messaging": false,
    "crashlytics": false,
    "crash_reporting": false,
    "storage": false,
    "functions": false,
    "facebook_auth": false,
    "google_auth": false,
    "admob": false,
    "invites": false,
    "dynamic_links": true,
    "ml_kit": true,
    "ml_kit_text_recognition": true,
    "ml_kit_barcode_scanning": false,
    "ml_kit_face_detection": false,
    "ml_kit_image_labeling": false,
    "ml_kit_custom_model": true
}
diadal commented 5 years ago

Android working now it remain iOS

Installing pods...
Analyzing dependencies
Pre-downloading: `Cosmos` from `https://github.com/triniwiz/Cosmos.git`
Pre-downloading: `ISMessages` from `https://github.com/EddyVerbruggen/ISMessages.git`, commit `689e8efbfb73f5ecc0a5ee87cc6fb47501b08ded`
Pre-downloading: `MMNumberKeyboard` from `https://github.com/EddyVerbruggen/MMNumberKeyboard.git`, commit `039891d263ed7edc2198cc6d18c99a32abf4d71f`
Pre-downloading: `SSSnackbar` from `https://github.com/EddyVerbruggen/SSSnackbar.git`, tag `0.1.2.4`
[!] CocoaPods could not find compatible versions for pod "FBSDKCoreKit":
  In Podfile:
    FBSDKCoreKit

    FBSDKCoreKit (~> 4.27.1)

CocoaPods could not find compatible versions for pod "FirebaseAnalytics":
  In Podfile:
    Firebase/Core (~> 5.12.0) was resolved to 5.12.0, which depends on
      FirebaseAnalytics (= 5.3.0)

    Google/SignIn was resolved to 3.0.3, which depends on
      Google/Core (= 3.0.3) was resolved to 3.0.3, which depends on
        FirebaseAnalytics (~> 3.2)

CocoaPods could not find compatible versions for pod "GoogleSignIn":
  In Podfile:
    Google/SignIn was resolved to 1.3.2, which depends on
      GoogleSignIn (~> 2.0)

    GoogleSignIn

CocoaPods could not find compatible versions for pod "GoogleUtilities":
  In Podfile:
    Google/SignIn was resolved to 1.3.2, which depends on
      GoogleSignIn (~> 2.0) was resolved to 2.2.0, which depends on
        GoogleUtilities (~> 1)

Specs satisfying the `GoogleUtilities (~> 1)` dependency were found, but they required a higher minimum deployment target.

[!] There are duplicate dependencies on `FBSDKCoreKit` in `Podfile`:

- FBSDKCoreKit (~> 4.27.1)
- FBSDKCoreKit

[!] There are duplicate dependencies on `FBSDKLoginKit` in `Podfile`:

- FBSDKLoginKit (~> 4.27.1)
- FBSDKLoginKit
'pod install' command failed.
diadal commented 5 years ago

android no longer working

anaszgh commented 5 years ago

@diadal @EddyVerbruggen have you managed to solve this issue, i'm facing the same problem.

I have social-login installed as well, but i configured the plugin-firebase for notifications only

i'm using tns version 5.1.0

here is the firebase.nativescript.json content

{
    "external_push_client_only": true,
    "using_ios": true,
    "using_android": true
}

and here is app.gradle


android { 
    project.ext {
       googlePlayServicesVersion = "16.1.0"
    }
  defaultConfig {  
    generatedDensities = []
    applicationId = "com.eventrest.mobile"  
  }  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }  
} 
fvci2015 commented 5 years ago

@EddyVerbruggen Sir, i updated nativescirpt to 5.1.0 version. Plugins i am using: Nativescript Plugin Firebase, Nativescript Admob

I am getting BUILD FAILED error as below:

FAILURE: Build failed with an exception.

fvci2015 commented 5 years ago

@EddyVerbruggen please guide me where i am stuck.

app.gridle:

android {  
     defaultConfig {  
           generatedDensities = []
      }  
     aaptOptions {  
        additionalParameters "--no-version-vectors"  
    }  
    project.ext {
          googlePlayServicesVersion = "16.1.0"
     }
} 

and nativescript-firebase.json:

    {
        "external_push_client_only": false,
        "using_ios": false,
        "using_android": true,
        "firestore": false,
        "realtimedb": true,
        "authentication": false,
        "remote_config": false,
        "performance_monitoring": false,
        "messaging": true,
        "crashlytics": false,
        "crash_reporting": false,
        "storage": false,
        "functions": false,
        "facebook_auth": false,
        "google_auth": false,
        "admob": false,
        "invites": false,
        "dynamic_links": false,
        "ml_kit": false
    }

@EddyVerbruggen please help me

Build Failed Error:

Failed to capture fingerprint of input files for task ':app:checkDebugClasspath' property 'compileClasspath' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[16.0.
  5]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.firebase:firebase-measurement-connector-impl:17.0.4 -> com.google.android.gms:play-servic
  es-measurement-base@[16.0.5], but play-services-measurement-base version was 16.3.0.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends onto com.google.android.gms:play-services-ads@+
  -- Project 'app' depends onto com.google.firebase:firebase-core@16.0.6
EddyVerbruggen commented 5 years ago

@fvci2015 Why do you combine the Firebase and AdMob plugins? The former contains all the features of the latter.

vahidvdn commented 5 years ago

@diadal @anaszgh I have the same issue. I installed nativescript-social-login plugin. Is there any workaround?

@EddyVerbruggen Also your workaround didn't fix the issue.

diadal commented 5 years ago

I edit the version in node_modules to be the same

vahidvdn commented 5 years ago

@diadal Would you please tell me the exact code to edit? And in where should I edit?

And as mentioned here, I added the following to my app.gradle (in App_Resources/Android) and build succeed:

project.ext {
    googlePlayServicesVersion = "16.0.+"
}
configurations.all {
    resolutionStrategy.force "com.google.android.gms:play-services-auth:$project.googlePlayServicesVersion"
}
diadal commented 5 years ago

app.gradle

project.ext {
        googlePlayServicesVersion ="12.0.1"
  }

include.gradle


dependencies {
    def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : '12.0.1'
    compile "com.google.android.gms:play-services-auth:$googlePlayServicesVersion"

    def facebookSDKVersion = project.hasProperty('facebookSDKVersion') ? project.facebookSDKVersion : '[4, 5)'
    // https://github.com/mkloubert/nativescript-social-login/issues/32#issue-285587592
    compile ("com.facebook.android:facebook-login:$facebookSDKVersion"){
        exclude group: 'com.google.zxing'
    }
vahidvdn commented 5 years ago

@diadal thanks.

Where does include.gradle placed?