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 · 26 comments

Comments

@kjeremy
Copy link

@kjeremy 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

This comment has been minimized.

Copy link

@dsg38 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

This comment has been minimized.

Copy link
Author

@kjeremy kjeremy commented Jul 12, 2019

That did not solve it for me.

@Luka108

This comment has been minimized.

Copy link

@Luka108 Luka108 commented Jul 14, 2019

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

@yerzhant

This comment has been minimized.

Copy link

@yerzhant 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

This comment has been minimized.

Copy link

@thanhle98 thanhle98 commented Jul 24, 2019

Please fix this, happens after upgrade flutter.

@thejacer87

This comment has been minimized.

Copy link

@thejacer87 thejacer87 commented Jul 26, 2019

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)
@Chanator

This comment has been minimized.

Copy link

@Chanator Chanator 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

@Chanator

This comment has been minimized.

Copy link

@Chanator Chanator 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

This comment has been minimized.

Copy link

@wliumelb 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

This comment has been minimized.

Copy link

@p02rosea p02rosea commented Aug 26, 2019

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

@eamechu

This comment has been minimized.

Copy link

@eamechu eamechu commented Aug 27, 2019

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

This worked for me too

@samigimix

This comment has been minimized.

Copy link

@samigimix samigimix commented Aug 29, 2019

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

It didn't worked for me !

@Adenosperma1

This comment has been minimized.

Copy link

@Adenosperma1 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

This comment has been minimized.

Copy link

@francomacri17 francomacri17 commented Sep 5, 2019

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

This comment has been minimized.

Copy link

@lokeshsoni lokeshsoni commented Sep 12, 2019

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

This worked for me too!

@BadTasTe-

This comment has been minimized.

Copy link

@BadTasTe- BadTasTe- 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

This comment has been minimized.

Copy link

@jonathanots jonathanots commented Sep 16, 2019

@p02rosea

This worked for me, ty

@jsgalarraga

This comment has been minimized.

Copy link

@jsgalarraga jsgalarraga commented Sep 18, 2019

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

@xTMxTM

This comment has been minimized.

Copy link

@xTMxTM xTMxTM 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

This comment has been minimized.

Copy link

@rohitvishwakarma1819 rohitvishwakarma1819 commented Sep 30, 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.

yes this worked for me

@Patelrahul4884

This comment has been minimized.

Copy link

@Patelrahul4884 Patelrahul4884 commented Oct 10, 2019

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

worked for me too

@kroikie

This comment has been minimized.

Copy link

@kroikie kroikie commented Oct 13, 2019

@kjeremy

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

@kroikie kroikie added the transferred label Oct 13, 2019
@Sreejith93

This comment has been minimized.

Copy link

@Sreejith93 Sreejith93 commented Oct 15, 2019

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

@erikhenriq

This comment has been minimized.

Copy link

@erikhenriq erikhenriq commented Oct 24, 2019

@p02rosea solved! Thanks..

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

@zenkog

This comment has been minimized.

Copy link

@zenkog 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

This comment has been minimized.

Copy link

@kuromukira kuromukira commented Nov 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.