Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › Build Gradle with FireBase

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19518

    Edward

    Hi!

    I’m struggling with connecting my app to Firebase, it will be using firebase auth for user accounts and firebase RTDB,

    I am pretty certain my build gradle file is a complete mess haha! what would I adjust as it currently still connects to the VPlay test database not mine,

    below is my gradle file, what would I adjust

    buildscript {
        repositories {
            jcenter()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.3'
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            maven { url 'https://maven.google.com' }
            maven { url 'https://sdk.felgo.com/maven/' }
        }
    }
    
    apply plugin: 'com.android.application'
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
    
        compile "com.android.support:support-core-utils:27.1.0"
        compile "com.android.support:appcompat-v7:27.1.0"
        dependencies {
            ...
        compile 'net.vplay.plugins:plugin-firebase:2.+'
        }
    
    }
    
    android {
        /*******************************************************
         * The following variables:
         * - androidBuildToolsVersion,
         * - androidCompileSdkVersion
         * - qt5AndroidDir - holds the path to qt android files
         *                   needed to build any Qt application
         *                   on Android.
         *
         * are defined in gradle.properties file. This file is
         * updated by QtCreator and androiddeployqt tools.
         * Changing them manually might break the compilation!
         *******************************************************/
    
        compileSdkVersion androidCompileSdkVersion.toInteger()
        buildToolsVersion androidBuildToolsVersion
    
        defaultConfig.applicationId = 'com.llabs.wizardEVAP.MyDiary'
    
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
                aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
                res.srcDirs = [qt5AndroidDir + '/res', 'res']
                resources.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                assets.srcDirs = ['assets']
                jniLibs.srcDirs = ['libs']
           }
        }
    
        lintOptions {
            abortOnError false
        }
         apply plugin: 'com.google.gms.google-services'
    }
    
    

     

    #19520

    Alex
    Felgo Team

    Here is how a gradle file with added Firebase looks like:

    buildscript {
        repositories {
            jcenter()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.3'
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            maven { url 'https://maven.google.com' }
            maven { url 'https://sdk.felgo.com/maven/' }
        }
    }
    
    apply plugin: 'com.android.application'
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
    
        compile "com.android.support:support-core-utils:27.1.0"
        compile "com.android.support:appcompat-v7:27.1.0"
        compile 'net.vplay.plugins:plugin-firebase:2.+'
    
    }
    
    android {
        /*******************************************************
         * The following variables:
         * - androidBuildToolsVersion,
         * - androidCompileSdkVersion
         * - qt5AndroidDir - holds the path to qt android files
         *                   needed to build any Qt application
         *                   on Android.
         *
         * are defined in gradle.properties file. This file is
         * updated by QtCreator and androiddeployqt tools.
         * Changing them manually might break the compilation!
         *******************************************************/
    
        compileSdkVersion androidCompileSdkVersion.toInteger()
        buildToolsVersion androidBuildToolsVersion
    
        defaultConfig.applicationId = 'net.vplay.demos.apps.NotesApp'
    
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
                aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
                res.srcDirs = [qt5AndroidDir + '/res', 'res']
                resources.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                assets.srcDirs = ['assets']
                jniLibs.srcDirs = ['libs']
           }
        }
    
        lintOptions {
            abortOnError false
        }
    }
    
    apply plugin: 'com.google.gms.google-services'
    

    Cheers,
    Alex

    #19522

    Edward

    Amazing, I see where mine was different thanks,

     

    Question, how would mine know to connect to my particular database and firebase project?

     

    Thanks

    Edward

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded