Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[all] Getting red deprecation error when running my app that uses firebase packages #226

Closed
officer47p opened this issue Sep 27, 2019 · 2 comments
Labels
type: bug Something isn't working

Comments

@officer47p
Copy link

Hey Everybody,
I'm new to flutter and firebase, and recently I had a lot of problems and hardnesses for implementing firebase to a flutter app, but anyway, after creating my app and adding the google services file to my project and editing gradle files, when I added 3 packages from pub.dev(firebase_auth, firebase_core and cloud_firestore) and running the flutter packages get, and finally running my app, I got this red error in my console :

Note: C:\Users\Parsa\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.12.9+4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\Users\Parsa\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.12.9+4\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

My app was built successfully but I am wondering if there is a problem with my configuration or it's just a simple deprecation error?

Any help and comment are welcome.
Thanks a lot.

I want to put my gradle files and my pubspec.yaml file here in case you want to take a look at it:
My project level gradle file

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.1'
    }
}

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

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

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

My app level gradle file

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}


def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "My application id :D"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
    implementation 'androidx.multidex:multidex:2.0.0'
}
apply plugin: 'com.google.gms.google-services'

My pubspec.yaml file

name: flash_chat
description: A new Flutter application.

version: 1.0.0+1

environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  animated_text_kit: ^1.3.1
  firebase_core: ^0.4.0+9
  cloud_firestore: ^0.12.9+4
  firebase_auth: ^0.14.0+5

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

  assets:
  - images/

@officer47p officer47p added the type: bug Something isn't working label Sep 27, 2019
@LOG-TAG
Copy link

LOG-TAG commented Oct 5, 2019

why all the modules converted into androidx :(

image

@iapicca iapicca changed the title Getting red deprecation error when running my app that uses firebase packages [all] Getting red deprecation error when running my app that uses firebase packages Oct 23, 2019
@iapicca
Copy link

iapicca commented Oct 23, 2019

Hi @officer47p
I see there's an open issue addressing the case you described.
Please follow up on that issue,
I'm closing the current one as duplicate.
If you disagree please write in the comments
and I will reopen it.
Thank you

@iapicca iapicca closed this as completed Oct 23, 2019
@firebase firebase locked and limited conversation to collaborators Aug 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants