close

[Solved] FlutterFirebaseCorePlugin.java uses or overrides a deprecated API

Hello Guys How are you all? Hope You all are fine. When I was trying to run my flutter app and suddenly I get the following error in my stack track. FlutterFirebaseCorePlugin.java uses or overrides a deprecated API’ in flutter. So today Here I come with all possible solutions for this error.

We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.

How FlutterFirebaseCorePlugin.java uses or overrides a deprecated API Error Occurs ?

When I run my program without importing firebase core, firebase auth and cloud firestore Plugin, and my code runs just fine but I register my app with firebase and it still runs fine but as soon as I import Firebase_authFirebase_core and cloud_Firestore… I get the following error.

How To Solve FlutterFirebaseCorePlugin.java uses or overrides a deprecated API Error?

Question: How To Solve FlutterFirebaseCorePlugin.java uses or overrides a deprecated API Error?
Answer: First Solution is to update dependencies to their latest version. Just Below Solution 1 Step By Step. If Solution 1 Not worked then Try out our solution 2 Just Change minSdkVersion In your app/build.gradle file, you can set the minSdkVersion inside defaultConfig.

Solution 1 : update dependencies to theirs latest version

Just update firebase_auth and firebase_core dependencies to theirs latest version.

  1. First, get the latest versions of your dependencies from firebase_auth and firebase_core.
  2. Then run these 3 commands in the terminal.
  3. flutter pub upgrade
  4. flutter pub get
  5. flutter clean
  6. And then run your project
  7. flutter run
  8. This will hopefully help you.

Solution 2 : Change minSdkVersion

In your app/build.gradle file, you can set the minSdkVersion inside defaultConfig.

Solution 3 : Enable multidex in android

Open [project_folder]/app/build.gradle and add following lines.

and

  1. Enable Jetifier.

Open [project_folder]/android/app/gradle.properties and add following lines.

Solution 4 : replace below line

Note: locationInD\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

The solution I found was to replace this line in android/app/build.gradle:

with

Summery

Check Out Below Article

Leave a Comment

%d bloggers like this: