-
Notifications
You must be signed in to change notification settings - Fork 219
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
Another exception was thrown: NoSuchMethodError: The getter '_store' was called on null. #30
Comments
@rukundo-djamal Thanks for the report! Could you please give me a bit more info on your setup? Which version of Flutter / Dart are you using? Have you tried using Flutter Master branch? Please see this thread for more debugging info: #28 |
i am using dart 2.0.0 and flutter Flutter 0.1.5 beta version |
@rukundo-djamal Could you please try with Flutter master and see if that solves your problem? Beta has been reported as having errors with some of the new Dart 2 language features this update requires. Thanks again for the help :) |
I have the same issue after updating to 0.4.0 and flutter master branch.
|
I was facing the same issues until I properly set types using the diamond operators as demonstrated in the flutter_redux readme:
|
Same issue, after updating flutter to current master it was resolved. |
@arok Could you please try fully typing your Store, StoreProviders, and StoreConnectors + Using Flutter Master branch and let me know if that works? The SDK that ships with Beta does not seem to be fully working with some of the new Dart 2 features. |
I am seeing this issue on all of my redux examples with the current master and dev branches of flutter. |
@tensor-programming Same here! |
Same here! I am using Flutter/master and flutter_redux: 0.4.0. It worked just a few days ago. Compared to the example, I am having Store on the top of the tree instead of MaterialApp. Not sure if that matters. Same after switched to beta: Doctor summary (to see all details, run flutter doctor -v): |
@envious I just set all the types too but when I remove all the code related to the
|
Thanks for the reports everyone. So sorry about these problems... Could some of you provide a bit more code? The stack traces all look the same and indicate the same point of failure, but I'm struggling to figure out which cases lead to this failure since all the tests pass, and the example "works on my machine." Perhaps I'm missing a test case or two, but I haven't seen which ones ;( ;( ;(
flutter_redux:
git:
url: git://github.com/brianegan/flutter_redux.git
ref: generics-methods-check Thanks! |
Confirmed the fix. The magic of: class _OfType { |
@hsun-cnnxty Thanks! If this fixes the problem for others, I'm going to go ahead and release a new version of the library that reverts back to the old way of getting the store using I'd like to come back to the new API eventually, but not worth the pain in the meantime :) |
Hi, if its any value - with version 0.4.0 and dev channel of Flutter I managed to run the example by adding the flag in Android Studio: Without it it I got the same errors as @rukundo-djamal https://github.com/flutter/flutter/wiki/Trying-the-preview-of-Dart-2-in-Flutter |
Hey @veresvit, yep, 0.4.0 is meant for Dart 2, 0.3.x is meant for Dart 1! Are any others using Dart 1 by chance? |
Still seeing the same issue.
|
@StephaneBischoff Does the
|
@brianegan Still got the error. Am I doing it right? Here is my pubspec.yaml.
|
@StephaneBischoff Dang... have you provided full typing to your |
@brianegan Yes. Here's my main.dart. I am using the new full typings...
|
@StephaneBischoff Hrm, thanks so much for the help! One last thing: Would you mind cloning this repo and seeing if you can run the example app found in the It runs on my machine with the flutter Overall, I think it's best to stick with the Dart 1 version for now: 0.3.6 if you just need to get stuff done. I'm running into a lot of problems with Dart 2 :( |
Ok, so the example works. :) ... wondering why my project is failing... :( |
Hah, dang... Thanks again for taking the time to help me debug this! I definitely must not be covering some case in my tests / example that's causing failure for Dart 2, or we're running into a legit Dart 2 bug (I've run into a few upgrading thus far). I've got a couple of issues filed on the Flutter / Dart SDK repos and hopefully they'll provide a bit more info as to what's happening! |
I'm still having success with 0.4.0 version and master branch on my demo project. Just noticed, have to remove build directory after switching versions. |
Continuing the development, I encountered this error again. Debugging helped me to find out that the exception was thrown during navigation, when a new widget tree was created, without a StoreProvider wrapper. After fixing this, the error disappeared. |
I don't know if this is any help but for me the example works, however changing the state from This is with This is the main.dart after making that simple change:
I'm very, very new to both Flutter and Redux so I might be doing something wrong haha, just thought it might be helpful to point to a step that takes it from working to breaking. Thanks! |
@thibaudpeltier , I'm new too, but changing this |
Ha, yup... that's embarrassing. I was starting from scratch wanting to repro the issue as I saw it yesterday and went way too fast... It was clearly on me this time 😬 All right so I didn't help anything, but you helped me! Thanks @tabula-rasa |
I hit this problem this morning and it had me scratching my head. I think a lot of this has already been said but after experimenting this is what i found to work...
|
Hey all! Thanks again for all the feedback and reports. I think this issue is a mix of problems:
I've fixed the example, and added a new error message to the library when folks encounter this problem so it's hopefully more helpful than a crazy NullPointerException :P This is now released as
|
After updating flutter, I hit the above and updated my types etc. This got me past all the problems listed here, but I hit another. To be honest, I'm not sure if this deserves a separate issue (please let me know if it does). I'm getting this:
It seems to have a problem with this code, though I don't quite understand why: BuiltList<MiddlewareBinding<AppState, dynamic>> getMiddlewareBindings() => new BuiltList<MiddlewareBinding<AppState, dynamic>>([
new MiddlewareBinding<AppState, Initialize>(_handleInitialize),
]);
void _handleInitialize(Store<AppState> store, Initialize action, NextDispatcher next) {
// elided
} Any ideas what I'm doing wrong here? |
@kentcb All right! You've made it past the first challenge in the Dart 2 Labyrinth 😄 Now you're facing the second challenge! I'm not quite sure if we need to slightly adjust the typing in Redux for Dart 2 or if Flutter is running into an odd bug. Essentially, all Redux.dart tests pass using the pure Dart 2 SDK, but fail in the Flutter environment.
Thanks for giving Dart 2 + Redux a shot! Hopefully these type issues will be ironed out with Dart 2 soon (I've run into several legit bugs in the Dart 2 implementation and generally gotten good support from the Dart team in fixing them, so good progress is being made). If you just need to get stuff done, I'd recommend sticking with Dart 1 at the moment. |
Thanks @brianegan.
Well, it's nearly Easter so I'm inclined to do very little, but I guess I really should maintain my productivity 😃 Dumb noob question, though: how do I do that? I'm really unclear on how to know what versions of tools/language is in use. All I did was Do I need to roll back to a specific flutter commit? If so, in the interests of teaching a man to fish, how would I go about figuring out which commit would be the right one to use? Is there some magical place I can go read about Dart 2 roadmap and how it all hangs together, especially as relates to flutter? Thanks again for all the help. |
@kentcb Haha, easter time!!! Dive in and just have fun 🐰 🐇 It was easy to miss, but they announced a couple weeks back that Master will now have Therefore, if you want to keep using Dart 1:
Unfortunately, going back to the beta branch / 0.3.6 means you'll need to remove the generic typing from your StoreProvider, but that should be a quick change. |
Wow, weird things are happening. So I undid my changes, switched to the beta channel, and cleaned my project. Now when I try to build it fails to resolve
But when I view the HTTP feed it's saying is 😕 Any ideas @brianegan? I suspect this isn't even a redux thing anymore, but rather a general Dart ecosystem breakage. |
@kentcb unfortunately the error message could be misleading. I had the similar situation where the actual conflict was caused by a different package. If you have recently added some new packages, try to remove them and see if the issue goes away. Then you can add one at a time to see which one actually causes the issue. |
Since updated to latest "beta", I got error from combineTypedReducers. Believe it is caused by the same bug reported by you: flutter/flutter#15900 I/flutter ( 8303): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═════════════════════════════════════════ |
@hsun-cnnxty Thanks for the report! Indeed, it's the problem you mention. I've added another comment on that issue, so hopefully someone will pick it up soon :) |
@kentcb Hrm, it looks like you're using |
@brianegan I ended up throwing my hands in the air and re-installing flutter because I literally couldn't switch channels anymore without it balking. Once I'd done that, I was back to a working build (using the beta channel, Dart 1.0 syntax). Have to say I'm worried that the Dart team might progress Dart 2.0 to beta before these issues are ironed out. Then I'll really be in a tight spot. Presumably I'd have to use a specific commit of flutter rather than a channel... |
@kentcb I agree... I've actually run into a lot of bugs with Dart 2 thus far. It's good to get real feedback from real projects, but it feels like they might have been a bit aggressive with the push. Luckily, the latest beta roll from a couple of days ago did not turn on Dart 2 by default, and unless these type issues are worked out and basic language features are working (like the type issues or reified generics in functions that causes the bugs in this thread), I hope they hold off on promoting it to beta. |
Hey all -- I've published a new version: 0.5.0. It now works with Redux 3.0.0, which fixes the issues with Dart 2 + combining Reducers. Please see the migration guide for Redux to update your projects. Unfortunately for some, the "No Store" problem might exist until Dart 2 is fully stable with reified generic types, which this library depends on. While beta channel works fine for me, it seems to be broken for others. Using the master channel may solve the problem. |
Its fixed for me !
Flutter --version
|
Hey all, I'm gonna go ahead and close this issue for now. The 0.5.0 version seems to be working for most folks on the beta or Master branches. Thanks for all the reports, and please let me know if you run into this any further! |
I have the same error as title on Flutter 0.2.8 • channel beta • https://github.com/flutter/flutter.git |
Hey @sckoh, sorry to hear that! Could you please provide a bit more code / details? Which version of Redux / Flutter Redux are you using? Best would be to provide a repo or some sample code to help debug! Thanks :) |
@brianegan this is the repo which produce the error here are my flutter version: Update 1: Update 2: Update 3: Update 4: |
Am aslo having the same problem. ====== EXCEPTION CAUGHT BY WIDGETS LIBRARY============= CAN YOU PLEASE HELP!!!!! class ProjectDetailsPage extends StatefulWidget { class _ProjectDetailsPageState extends State { QuerySnapshot Projects; ProjectMedthods ProjectObj = new ProjectMedthods(); @OverRide
|
I/flutter (12940): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════ |
its super long cant paste all of the error |
i am using the example you provided on your github repo and it throwing this error
The text was updated successfully, but these errors were encountered: