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_auth
, Firebase_core
and cloud_Firestore
… I get the following error.
Note: C:\milan\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.7.0\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\milan\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.16.0\android\src\main\java\io\flutter\plugins\firebase\firestore\streamhandler\TransactionStreamHandler.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
D8: Cannot fit requested classes in a single dex file (# methods: 89543 > 65536)
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
How To Solve FlutterFirebaseCorePlugin.java uses or overrides a deprecated API Error?
- How To Solve FlutterFirebaseCorePlugin.java uses or overrides a deprecated API Error?
To Solve FlutterFirebaseCorePlugin.java uses or overrides a deprecated API Error 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 theminSdkVersion
insidedefaultConfig
. - FlutterFirebaseCorePlugin.java uses or overrides a deprecated API
To Solve FlutterFirebaseCorePlugin.java uses or overrides a deprecated API Error 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 theminSdkVersion
insidedefaultConfig
.
Solution 1 : update dependencies to theirs latest version
Just update firebase_auth and firebase_core dependencies to theirs latest version.
- First, get the latest versions of your dependencies from firebase_auth and firebase_core.
- Then run these 3 commands in the terminal.
- flutter pub upgrade
- then run flutter pub get
- flutter clean
- And then run your project
- flutter run
- This will hopefully help you.
Solution 2 : Change minSdkVersion
In your app/build.gradle
file, you can set the minSdkVersion
inside defaultConfig
.
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.name.app"
minSdkVersion 23 // change this version to 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Solution 3 : Enable multidex
in android
Open [project_folder]/app/build.gradle
and add following lines.
defaultConfig {
...
multiDexEnabled true
}
and
dependencies {
...
implementation 'com.android.support:multidex:1.0.3'
}
- Enable Jetifier.
Open [project_folder]/android/app/gradle.properties
and add following lines.
android.useAndroidX=true
android.enableJetifier=true
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:
implementation 'com.google.firebase:firebase-analytics-ktx'
with
implementation 'com.google.firebase:firebase-analytics'
Summery
Check Out Below Article
- Failed to launch emulator: Error: Emulator didn’t connect within 60 seconds
- Finished with error: Gradle task assembleDebug failed with exit code 1
- error: ‘Flutter/Flutter.h’ file not found when flutter run on iOS
- Cannot run with sound null safety because dependencies don’t support null safety
- Null check operator used on a null value