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] version 6.0.7 brokes builds #1606

Closed
FedericoMatera opened this issue Dec 11, 2019 · 17 comments
Closed

[firebase_messaging] version 6.0.7 brokes builds #1606

FedericoMatera opened this issue Dec 11, 2019 · 17 comments
Labels
impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) plugin: messaging type: bug Something isn't working

Comments

@FedericoMatera
Copy link

FedericoMatera commented Dec 11, 2019

My project cannot be built or runned anymore since I updated to firebase_messaging: 6.0.7.
Error log:

flutter run --verbose
...
error: cannot access FirebaseMessagingService
[        ]         FlutterFirebaseMessagingService.setPluginRegistrant(this);
[        ]                                        ^
[        ]   class file for com.google.firebase.messaging.FirebaseMessagingService not found
[        ] 1 error
[        ] FAILURE: Build failed with an exception.
[        ] * What went wrong:
[        ] Execution failed for task ':app:compileDebugJavaWithJavac'.
[        ] > Compilation failed; see the compiler error output for details.
[        ] * Try:
[        ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[        ] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 10s
[ +369 ms] Running Gradle task 'assembleDebug'... (completed in 11,5s)
[   +5 ms] "flutter run" took 13.543ms.
Gradle task assembleDebug failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      buildGradleApp (package:flutter_tools/src/android/gradle.dart:387:7)
#2      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#3      _rootRunUnary (dart:async/zone.dart:1134:38)
#4      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#7      Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#8      Future._completeWithValue (dart:async/future_impl.dart:524:5)
#9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
#10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
#11     _DefaultProcessUtils.stream (package:flutter_tools/src/base/process.dart)
#12     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#13     _rootRunUnary (dart:async/zone.dart:1134:38)
#14     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#15     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#16     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#17     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#18     Future._completeWithValue (dart:async/future_impl.dart:524:5)
#19     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:554:7)
#20     _rootRun (dart:async/zone.dart:1126:13)
#21     _CustomZone.run (dart:async/zone.dart:1023:19)
#22     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#24     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#26     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:175:5)

Additional context
Version 6.0.3 works fine

➜ flutter doctor --verbose
[✓] Flutter (Channel beta, v1.12.13+hotfix.5, on Mac OS X 10.15.1 19B88, locale it-IT)
    • Flutter version 1.12.13+hotfix.5 at /Users/federico/flutter
    • Framework revision 27321ebbad (14 hours 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.0)
    • Android SDK at /Users/federico/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0
    • 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 11.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2.1, Build version 11B500
    • CocoaPods version 1.8.3

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

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

[✓] Connected device (1 available)
    • Nexus 6 • ZX1G425QJK • android-arm • Android 7.1.1 (API 25)

• No issues found!
@FedericoMatera FedericoMatera added the type: bug Something isn't working label Dec 11, 2019
@rignaneseleo
Copy link

Same error

@ninnepinne
Copy link
Contributor

Same problem.
@kroikie Please advise:
When looking at the documentation and comparing it with the code in the example project - they are NOT the same.
Is the documentation describing the old way while the example (and plugin code) is using the new v2 embedding?
Problem: documentation out of sync?

@iapicca iapicca added the type: documentation Improvements or additions to documentation label Dec 12, 2019
@iapicca iapicca added the impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) label Dec 12, 2019
@mhadaily
Copy link
Member

Same issue here

@iapicca
Copy link

iapicca commented Dec 12, 2019

Hi @FedericoMatera
could you please try running
flutter clean
flutter pub cache repair
let me know if the issue persists
thank you

the following is not a suggestion or a recomandation,
but upgrading to master
appears to solve a similar issue for some

@ninnepinne
Copy link
Contributor

ninnepinne commented Dec 12, 2019

Temporary workaround:
Downgraded to version 6.0.3.
(Edit: "Works" as in builds) when following current (6.0.8) documentation/instructions.

With Environment:

[✓] Flutter (Channel beta, v1.12.13+hotfix.4, on Mac OS X 10.15.1 19B88, locale en-SE)
    • Flutter version 1.12.13+hotfix.4 at /Users/fredrik.dahlen/DEV/flutter
    • Framework revision fb60324e6f (3 days ago), 2019-12-09 15:58:15 -0800
    • Engine revision ac9391978e
    • Dart version 2.7.0

@FedericoMatera
Copy link
Author

Hi @FedericoMatera
could you please try running
flutter clean
flutter pub cache repair
let me know if the issue persists
thank you

the following is not a suggestion or a recomandation,
but upgrading to master
appears to solve a similar issue for some

Hi @iapicca,
No, that didn't solve the problem

@jjchiw
Copy link

jjchiw commented Dec 12, 2019

I solved it.. Adding the plugin dependencies in app/build.gradle

implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'

@wangbo4020
Copy link

Same issue here

@elliotPopina
Copy link

@jjchiw thanks you save my day

work on IOS and android with version 6.0.3 after added this in app/build.gradle

implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'

@woprandi
Copy link

That's a strange fix. Why should we add these dependencies in the gradle config file ?

@mhadaily
Copy link
Member

I don't think you need all of them but you can just add
implementation 'com.google.firebase:firebase-messaging:20.0.1' as it's also used in firebase_messaging itself.
this may help to understand 'https://stackoverflow.com/questions/44493378/whats-the-difference-between-implementation-and-compile-in-gradle?answertab=votes#tab-top'

I believe there will be a fix from the team soon but a temporary fix could be as described.

@gerryhigh
Copy link

Same issue. Still broken with latest flutter on master channel and 6.0.9 firebase_messaging

@kroikie
Copy link
Collaborator

kroikie commented Dec 16, 2019

@gerryhigh the solution presented by @mhadaily should work. The team is looking into a solution but you should be able to unblock yourself for now with by adding the dependency directly to your app's build.gradle file.

@gerryhigh
Copy link

Yes, that did work. It allowed me to move forward. I then ran into this issue: #1591

@elrafal
Copy link

elrafal commented Jan 18, 2020

All you need is only first first line from @jjchiw:

implementation 'com.google.firebase:firebase-messaging:20.0.1'

@iapicca iapicca removed the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Feb 12, 2020
@Ehesp Ehesp added plugin: messaging and removed type: documentation Improvements or additions to documentation labels Apr 22, 2020
@ztobs
Copy link

ztobs commented Jun 10, 2020

@jjchiw thanks you save my day

work on IOS and android with version 6.0.3 after added this in app/build.gradle

implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'

You save me hours of debugging

@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. Dependencies are now managed internally by the plugin itself (see migration guide step on removing the old dependencies from your gradle project).

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: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) plugin: messaging type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests