EddyVerbruggen / nativescript-plugin-firebase

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

Re-running npm setup / config does not update/replace: include.gradle #485

Open nikmartin opened 6 years ago

nikmartin commented 6 years ago

after installing the plugin, trying to run on the android emulator gives me an error about properly configuring the Faceboopk SDK for App_id, etc. My firebase.nativescript.json looks like:

{
    "using_ios": true,
    "using_android": true,
    "remote_config": true,
    "messaging": true,
    "crash_reporting": false,
    "storage": true,
    "facebook_auth": false,
    "google_auth": false,
    "admob": false,
    "invites": true
}

but platforms/android/configurations/nativescript-plugin-firebase/include.gradle still looks like:


android {
    productFlavors {
        "F2" {
            dimension "nativescriptpluginfirebase"
        }
    }
}

repositories {
    jcenter()
    mavenCentral()
}

dependencies {
    // make sure you have these versions by updating your local Android SDK's (Android Support repo and Google repo)
    compile "com.google.firebase:firebase-core:11.0.+"
    compile "com.google.firebase:firebase-database:11.0.+"
    compile "com.google.firebase:firebase-auth:11.0.+"

    // for converting Java objects to JS
    compile "com.google.code.gson:gson:2.8.+"

    // for reading google-services.json and configuration
    def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : '11.0.+'
    compile "com.google.android.gms:play-services-base:$googlePlayServicesVersion"

    // Uncomment if you want to use 'Remote Config'
     compile "com.google.firebase:firebase-config:11.0.+"

    // Uncomment if you want to use 'Crash Reporting'
     compile "com.google.firebase:firebase-crash:11.0.+"

    // Uncomment if you want FCM (Firebase Cloud Messaging)
     compile "com.google.firebase:firebase-messaging:11.0.+"

    // Uncomment if you want Google Cloud Storage
     compile 'com.google.firebase:firebase-storage:11.0.+'

    // Uncomment if you want AdMob
    // compile 'com.google.firebase:firebase-ads:11.0.+'

    // Uncomment if you need Facebook Authentication
     compile "com.facebook.android:facebook-android-sdk:4.+"

    // Uncomment if you need Google Sign-In Authentication
     compile "com.google.android.gms:play-services-auth:$googlePlayServicesVersion"

    // Uncomment if you need Firebase Invites
     compile "com.google.firebase:firebase-invites:11.0.+"
}

apply plugin: "com.google.gms.google-services"

And nothing seems to update it. How do I properly configure the android platform to match firebase.nativescript.json?

Dashue commented 6 years ago

I've had to remove the platforms folder and rebuild sometimes to get things picked up. Maybe give that a go?

nikmartin commented 6 years ago

I did that, with no changes, THEN I removed platform folder and re-ran tns add platform android and it picked up the updated configuration, so maybe the hook is post platform add?