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

[firebase_messaging] Deprecation warning after updating flutter. #1625

Closed
jcvw75 opened this issue Dec 12, 2019 · 7 comments
Closed

[firebase_messaging] Deprecation warning after updating flutter. #1625

jcvw75 opened this issue Dec 12, 2019 · 7 comments
Labels
impact: customer A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3) plugin: messaging type: bug Something isn't working

Comments

@jcvw75
Copy link

jcvw75 commented Dec 12, 2019

Note: d:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-6.0.8\android\src\main\java\io\flutter\plugins\firebasemessaging\FirebaseMessagingPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

-----------------------Using this flutter--------------------

Flutter 1.12.13+hotfix.5 ΓÇó channel stable ΓÇó
https://github.com/flutter/flutter.git
Framework ΓÇó revision 27321ebbad (2 days ago) ΓÇó 2019-12-10 18:15:01 -0800
Engine ΓÇó revision 2994f7e1e6
Tools ΓÇó Dart 2.7.0
@iapicca
Copy link

iapicca commented Dec 13, 2019

Hi @jcvw75
could you please run
flutter clean
flutter pub cache repair
if the issue persists please your flutter doctor -v
and your flutter run --verbose?
thank you

@iapicca iapicca added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Dec 13, 2019
@jcvw75
Copy link
Author

jcvw75 commented Dec 13, 2019

I did the first 2 and the issue is still there, but I also enabled -Xlint:deprecation in gradle and got some other warning message this time. Builds fine though.

------flutter build apk --split-per-abi---------------------

Running Gradle task 'assembleRelease'...
d:\flutter.pub-cache\hosted\pub.dartlang.org\firebase_messaging-6.0.9\android\s
rc\main\java\io\flutter\plugins\firebasemessaging\FirebaseMessagingPlugin.java:8
1: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated

    binding.getApplicationContext(), binding.getFlutterEngine().getDartExecutor());

-------------------------------flutter doctor -v---------------------------

[√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 6.3.9600], locale en-US)
• Flutter version 1.12.13+hotfix.5 at d:\flutter
• Framework revision 27321ebbad (3 days ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\jason\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.

[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code, 64-bit edition (version 1.41.0)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.7.1

[!] Connected device
! No devices available

! Doctor found issues in 1 category.

----flutter run --verbose-----------------------------------------------------------------------------

flutter run --verbose
[ +30 ms] executing: [d:\flutter] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +62 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 27321ebbad34b0a3fafe99fac037102196d655ff
[ ] executing: [d:\flutter] git describe --match v*.. --first-parent --long --tags
[ +36 ms] Exit code 0 from: git describe --match v*.. --first-parent --long --tags
[ ] v1.12.13+hotfix.5-0-g27321eb
[ +8 ms] executing: [d:\flutter] git rev-parse --abbrev-ref --symbolic @{u}
[ +36 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/stable
[ ] executing: [d:\flutter] git ls-remote --get-url origin
[ +41 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +92 ms] executing: [d:\flutter] git rev-parse --abbrev-ref HEAD
[ +39 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ +128 ms] executing: C:\Users\jason\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[ +15 ms] Exit code 0 from: C:\Users\jason\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[ ] List of devices attached
[ +10 ms] No supported devices connected.
[ +14 ms] "flutter run" took 206ms.

#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:289:7)

#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:590:11)
#3 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:515:33)

#4 AppContext.run. (package:flutter_tools/src/base/context.dart:146:29)
#5 _rootRun (dart:async/zone.dart:1126:13)
#6 _CustomZone.run (dart:async/zone.dart:1023:19)
#7 _runZoned (dart:async/zone.dart:1518:10)
#8 runZoned (dart:async/zone.dart:1465:12)
#9 AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#10 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:505:20)
#11 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#12 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:413:21)

#13 AppContext.run. (package:flutter_tools/src/base/context.dart:146:29)
#14 _rootRun (dart:async/zone.dart:1126:13)
#15 _CustomZone.run (dart:async/zone.dart:1023:19)
#16 _runZoned (dart:async/zone.dart:1518:10)
#17 runZoned (dart:async/zone.dart:1465:12)
#18 AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#19 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:19)
#20 CommandRunner.run. (package:args/command_runner.dart:112:25)
#21 new Future.sync (dart:async/future.dart:224:31)
#22 CommandRunner.run (package:args/command_runner.dart:112:14)
#23 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:250:18)
#24 run.. (package:flutter_tools/runner.dart:63:22)
#25 _rootRun (dart:async/zone.dart:1126:13)
#26 _CustomZone.run (dart:async/zone.dart:1023:19)
#27 _runZoned (dart:async/zone.dart:1518:10)
#28 runZoned (dart:async/zone.dart:1502:12)
#29 run. (package:flutter_tools/runner.dart:61:18)

#30 AppContext.run. (package:flutter_tools/src/base/context.dart:146:29)
#31 _rootRun (dart:async/zone.dart:1126:13)
#32 _CustomZone.run (dart:async/zone.dart:1023:19)
#33 _runZoned (dart:async/zone.dart:1518:10)
#34 runZoned (dart:async/zone.dart:1465:12)
#35 AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#36 runInContext (package:flutter_tools/src/context_runner.dart:64:24)
#37 run (package:flutter_tools/runner.dart:50:10)
#38 main (package:flutter_tools/executable.dart:65:9)
#39 main (file:///C:/b/s/w/ir/k/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#40 _startIsolate. (dart:isolate-patch/isolate_patch.dart:305:32)
#41 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

@hungbu
Copy link

hungbu commented Dec 26, 2019

Launching lib\main.dart on MI MAX 2 in debug mode... Running Gradle task 'assembleDebug'... Note: D:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-6.0.9\android\src\main\java\io\flutter\plugins\firebasemessaging\FirebaseMessagingPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. D:\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.6\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext()); ^ 1 warning √ Built build\app\outputs\apk\debug\app-debug.apk. Installing build\app\outputs\apk\app.apk... Syncing files to device MI MAX 2...

-------------------------------flutter doctor -v---------------------------
`D:\project\workspace>flutter doctor -v
[√] Flutter (Channel unknown, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18362.535], locale en-US)
• Flutter version 1.12.13+hotfix.5 at D:\flutter
• Framework revision 27321ebbad (2 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\hungb\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.

[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.41.1)
• VS Code at C:\Users\hungb\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.7.1

[√] Connected device (1 available)
• MI MAX 2 • b0e5de04 • android-arm64 • Android 7.1.1 (API 25)

• No issues found!
`

----flutter run --verbose---
flutter_run_verbose.txt


@azizainunnajib
Copy link

hai, do you solve this? i just got the error here.

@williamdes
Copy link

@iapicca I am using

Flutter 1.12.13+hotfix.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 27321ebbad (il y a 5 semaines) • 2019-12-10 18:15:01 -0800
Engine • revision 2994f7e1e6
Tools • Dart 2.7.0

firebase_messaging 6.0.9

I applied your comment #1625 (comment)

Note: /mnt/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.0+13/android/src/main/java/io/flutter/plugins/packageinfo/PackageInfoPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.                    
Note: /mnt/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.9/android/src/main/java/io/flutter/plugins/firebasemessaging/FirebaseMessagingPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.                    
Note: Some input files use or override a deprecated API.                
Note: Recompile with -Xlint:deprecation for details.                    
/mnt/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.6/android/src/main/java/io/flutter/plugins/sharedpreferences/SharedPreferencesPlugin.java:25: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated
    setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext());
                        ^                                               
1 warning                                                               
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService, unresolved supertypes: com.google.firebase.messaging.FirebaseMessagingService

And still have the issue, please fix the deprecated code :)

@williamdes
Copy link

downgrading shared_preferences: ^0.5.6 to shared_preferences: ^0.5.3 solved the deprecation errors

https://stackoverflow.com/questions/58706496/getting-error-while-adding-shared-preferences-to-flutter-app

class io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService, unresolved supertypes: com.google.firebase.messaging.FirebaseMessagingService got solved by
#1606 (comment)

@iapicca iapicca removed the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Feb 12, 2020
@iapicca iapicca added the type: bug Something isn't working label Feb 20, 2020
@Ehesp Ehesp added plugin: messaging impact: customer A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3) labels Apr 22, 2020
@Salakar
Copy link
Member

Salakar commented Nov 5, 2020

Hey all 👋

As part of our roadmap (#2582) we've just shipped a complete rework of the firebase_messaging plugin that aims to solve this and many other issues.

If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here.

Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin.

Thanks everyone.

@Salakar Salakar closed this as completed Nov 5, 2020
@firebase firebase locked and limited conversation to collaborators Dec 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
impact: customer A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3) plugin: messaging type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants