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

cloud_firestore uses or overrides a deprecated API #36014

Closed
kjeremy opened this issue Jul 11, 2019 · 33 comments
Closed

cloud_firestore uses or overrides a deprecated API #36014

kjeremy opened this issue Jul 11, 2019 · 33 comments
Labels
p: cloud_firestore Firebase Firestore plugin package flutter/packages repository. See also p: labels.

Comments

@kjeremy
Copy link

kjeremy commented Jul 11, 2019

I see this in the build:

> Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.12.7\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:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.12.7\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
> Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.4.0+6\android\src\main\java\io\flutter\plugins\firebase\core\FirebaseCorePlugin.java uses unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
@kjeremy kjeremy changed the title cloud_firestore uses or oerrides a deprecated API cloud_firestore uses or overrides a deprecated API Jul 11, 2019
@dsg38
Copy link

dsg38 commented Jul 12, 2019

After upgrading to flutter 1.7 I got these warnings.

But I then ran flutter pub upgrade - to bump my local dependencies to the latest backward compatible versions - and the warnings disappeared.

@kjeremy
Copy link
Author

kjeremy commented Jul 12, 2019

That did not solve it for me.

@Luka108
Copy link

Luka108 commented Jul 14, 2019

Same error here, and flutter pub upgrade didn't worked for me.

@yerzhant
Copy link

yerzhant commented Jul 23, 2019

I have a similar issue:

Note: /home/yerzhan/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.7+1/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: /home/yerzhan/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.7+1/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Flutter 1.7.8+hotfix.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b712a172f9 (2 недели назад) • 2019-07-09 13:14:38 -0700
Engine • revision 54ad777fd2
Tools • Dart 2.4.0

@thanhle98
Copy link

Please fix this, happens after upgrade flutter.

@thejacer87
Copy link

same for me

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Linux, locale en_CA.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[✓] Android Studio (version 3.4)
[✓] Connected device (1 available)

@Ficharo
Copy link

Ficharo commented Jul 28, 2019

I have the same issue and already ran flutter pub upgrade

Note: /Users/fidel/development/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.8/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: /Users/fidel/development/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.8/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale en-US)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.4)
[!] Connected device
! No devices available

@Ficharo
Copy link

Ficharo commented Jul 28, 2019

I somehow resolve my error running flutter upgrade from the command line
chanator$ flutter upgrade

and then restarting my computer.

And then from the terminal inside my visual studio project I ran flutter build apk --split-per-abi

Not sure if this would work for everyone but it did for me. Btw, the warnings are still showing up but at least I was able to build the apk

@wliumelb
Copy link

wliumelb commented Aug 1, 2019

I think the warning has been there for a long time, but only shows up when the apk is rebuilt, e.g. after flutter version upgrade or running flutter clean.
Minor annoyance but probably will not break anything :)

@p02rosea
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

@emzamechu
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

This worked for me too

@samigimix
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

It didn't worked for me !

@Adenosperma1
Copy link

Adenosperma1 commented Sep 2, 2019

I'm having the same issue, compiles to an android device but won't make a bundle.
I've tried everything above with no luck.
Can anyone help me out?

flutter build appbundle

Initializing gradle...                                              0.8s
Resolving dependencies...                                           1.3s
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Note: /Users/brendanwilde/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.9+2/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: /Users/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.9+2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.                      
Running Gradle task 'bundleRelease'...                                  
Running Gradle task 'bundleRelease'... Done                        71.2s
Gradle task bundleRelease failed with exit code 1

Flutter Doctor - v

[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F203, locale en-AU)
    • Flutter version 1.7.8+hotfix.4 at /Users/Documents/flutter
    • Framework revision 20e59316b8 (6 weeks ago), 2019-07-18 20:04:33 -0700
    • Engine revision fee001c93f
    • Dart version 2.4.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/brendanwilde/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • CocoaPods version 1.7.2

[✓] iOS tools - develop for iOS devices
    • ios-deploy 1.9.4

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 38.2.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.36.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.3.0

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!

SOLVED
I redownloaded my Firestore googleservices file and created a new signing key and it now works. I think there was an issue with the way I created the key?

@francomacri17
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

This worked for me too

I worked for me too, thanks!

@lokeshsoni
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

This worked for me too!

@arnaudelub
Copy link

arnaudelub commented Sep 13, 2019

i have the same issue with minSDKVersion already set to 23.
cloud_firestore version is cloud_firestore-0.12.9+4

Note: <UserPATH>/.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: <UserPATH>/.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.

@jonathanots
Copy link

jonathanots commented Sep 16, 2019

@p02rosea

This worked for me, ty

@jsgalarraga
Copy link

In the app level build.gradle update your androidX dependencies, for me worked changing to this versions

dependencies {
    ...
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

My minSdkVersion is 19 so don't know if needed to update to 23

@malteme
Copy link

malteme commented Sep 25, 2019

I think the warning has been there for a long time, but only shows up when the apk is rebuilt, e.g. after flutter version upgrade or running flutter clean.

Same for me, warning only shows up when building the app after a 'flutter clean'

@rohitvishwakarma1819
Copy link

After upgrading to flutter 1.7 I got these warnings.

But I then ran flutter pub upgrade - to bump my local dependencies to the latest backward compatible versions - and the warnings disappeared.

yes this worked for me

@Patelrahul4884
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

worked for me too

@kroikie
Copy link

kroikie commented Oct 13, 2019

@kjeremy

This issue has been moved to firebase/flutterfire#1215. Any further collaboration will be done there.

@Sreejith93
Copy link

Launching lib\main.dart on Android SDK built for x86 64 in debug mode...

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) Note: E:\Andriod\flutter.pub-ache\hosted\pub.dartlang.org\cloud_firestore-0.12.9+5\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: E:\Andriod\flutter.pubcache\hosted\pub.dartlang.org\cloud_firestore-.12.9+5\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Built build\app\outputs\apk\debug\app-debug.apk.

error message from when i open the app

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
at com.google.firebase.FirebaseApp.(com.google.firebase:firebase-common@@17.0.0:147)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@17.0.0:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1758)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1733)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@17.0.0:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:5330)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4867)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4807)
at android.app.ActivityThread.access$1800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1459)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5601)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.example.distance9-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.distance9-1/lib/arm, /data/app/com.example.distance9-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 16 more
Suppressed: java.lang.ClassNotFoundException: android.support.v4.util.ArrayMap
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 17 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

@th3erik
Copy link

th3erik commented Oct 24, 2019

@p02rosea solved! Thanks..

For me work just change the minSDKVersion to 23 in the app build.gradle.

@zenkog
Copy link

zenkog commented Nov 5, 2019

For me work just change the minSDKVersion to 23 in the app build.gradle.

It doesn't work for me

@kuromukira
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

I just compiled using minSDKVersion 23, then recompiled again to 28. Seems to work like that.

@4tKnight
Copy link

4tKnight commented Jan 7, 2020

For me work just change the minSDKVersion to 23 in the app build.gradle.

works perfectly .... thanks

@GvictorFranca
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

This worked for me too

I worked for me too, thanks!

@manglide
Copy link

manglide commented Feb 2, 2020

For me work just change the minSDKVersion to 23 in the app build.gradle.

Worked for me. Thanks.

@thepythongeeks
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

Work for me. Thanks.

@henriquellemos
Copy link

For me work just change the minSDKVersion to 23 in the app build.gradle.

This worked for me 😃

@Aksshar
Copy link

Aksshar commented Apr 7, 2020

I had the same issue.

For me work just change the minSDKVersion to 23 in the app build.gradle.
This one worked for me too. But i really curious about to know the reason.

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: cloud_firestore Firebase Firestore plugin package flutter/packages repository. See also p: labels.
Projects
None yet
Development

No branches or pull requests