Giter Site home page Giter Site logo

Comments (6)

brianegan avatar brianegan commented on June 20, 2024

Hey hey -- sorry about the trouble! Looks like what you've pasted makes sense. Could you please also post your import statements? Dart is a bit weird about how it imports files, and if you import the PrimeAppStateModel differently in different files, it can lead to errors like the ones you've posted here.

Thanks!

from flutter_redux.

tluckett77 avatar tluckett77 commented on June 20, 2024

No worries, Flutter is still in such flux that these things tend to happen.

The main.dart function looks as follows:

import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:redux/redux.dart';
import 'package:h_app/app_settings.dart';
import 'package:h_app/models/app_state/primary_app_state_model.dart';
import 'package:h_app/views/section_s/s1_welcome.dart';
import 'package:h_app/h_localization.dart';
import 'package:h_app/hTheme/colors.dart';
import 'package:h_app/reducers/app_reducer_core.dart';
import 'package:h_app/middleware/mw_initializers.dart';

s1_welcome.dart which contains the AppLaunch class looks as follows:

import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show SystemChannels;
import 'package:flutter/widgets.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:h_app/actions/sectionS_actions.dart';
import 'package:h_app/models/app_state/primary_app_state_model.dart';
import 'package:h_app/customWidgets/buttons.dart';
import 'package:h_app/hTheme/colors.dart';
import 'package:h_app/main.dart' show getFirebaseAnalytics;
import 'package:h_app/models/section_s/s_pm_entry_modal.dart';
import 'package:h_app/h_localization.dart';
import 'package:h_app/hTheme/app_graphics.dart';
import 'package:h_app/hTheme/icons.dart';
import 'package:h_app/views/section_s/s1:m1_login_modal.dart';
import 'package:redux/redux.dart';

Maybe this is is helpful. I found it in the android IDE internal Error Log

Caused by: java.lang.RuntimeException: Error while applying io.flutter.console.FlutterConsoleFilter@238d2b2c to 'I/flutter ( 5488): #0      StoreProvider.of (package:flutter_redux/flutter_redux.dart:29:27)
'
	at com.intellij.execution.filters.CompositeFilter.applyFilter(CompositeFilter.java:81)
	at com.intellij.execution.impl.AsyncFilterRunner$HighlighterJob.analyzeLine(AsyncFilterRunner.java:214)
	at com.intellij.execution.impl.AsyncFilterRunner$HighlighterJob.analyzeNextLine(AsyncFilterRunner.java:199)
	at com.intellij.execution.impl.AsyncFilterRunner.runTasks(AsyncFilterRunner.java:151)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1130)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:85)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$2(ProgressIndicatorUtils.java:141)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:543)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:139)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:85)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:106)
	at com.intellij.execution.impl.AsyncFilterRunner.runFiltersInBackground(AsyncFilterRunner.java:69)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:212)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(String.java:1967)
	at io.flutter.console.FlutterConsoleFilter.applyFilter(FlutterConsoleFilter.java:124)
	at com.intellij.execution.filters.CompositeFilter.applyFilter(CompositeFilter.java:75)
	... 21 more

from flutter_redux.

tluckett77 avatar tluckett77 commented on June 20, 2024

I have been able to get the app to finally load without crashing. Seems the crash was related to an issue caused by incompatible google library version combinations in my pubspec.yaml. So the good new is, the crashing was unrelated to flutter_redux. However, the same problem persists with the same error Messages.

05-09 20:58:16.288 7664-7731/com.networks.haillio I/flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
05-09 20:58:16.294 7664-7731/com.networks.haillio I/flutter: The following StoreProviderError was thrown building StoreConnector<Store<PrimeAppStateModel>, () =>
05-09 20:58:16.295 7664-7731/com.networks.haillio I/flutter: void>(dirty):
    Error: No StoreProvider<Store<PrimeAppStateModel>> found. To fix, please try:

So for now we can rule out the flutter_redux package as being the cause of crashing.

from flutter_redux.

brianegan avatar brianegan commented on June 20, 2024

Ah, that's interesting -- but yah, still seems like you're hitting a snag with flutter_redux, as it seems like it's unable to find the Store in the Widget Tree. Is your code open source by chance? I'd be happy to dive in and take a look if so.

from flutter_redux.

tluckett77 avatar tluckett77 commented on June 20, 2024

Finally found the issue whew This problem was not caused by the redux package, it was directly related to strict types in Dart 2. I had a deeply nested widget in the widget tree that did not have StoreConnector<Store<PrimeAppStateModel>> it was just in my code as StoreConnector<Store>.

I will close this out as it is not an issue, but an error on my part. When you have a chance, it may be noteworthy in the documentation to highlight that the StoreConnector and StoreBuilders must be typed to match the top level StoreProvider. Any deviation causes the problem that I was having.

Thanks for the good work you're doing!

from flutter_redux.

brianegan avatar brianegan commented on June 20, 2024

Thanks @tluckett77! Dang, sorry to hear it took you a while to find this one.

I think I definitely need to add an FAQ for this issue as well -- I tried to put that information in the error message that you pasted, but it looks like that wasn't helpful.

from flutter_redux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.