I'm getting the following error when starting my Flutter app:
══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════
The following message was thrown:
Could not navigate to initial route.
The requested route name was: "/animals/cats/lolcats"
The following routes were therefore attempted:
* /
* /animals
* /animals/cats
* /animals/cats/lolcats
This resulted in the following objects:
* MaterialPageRoute<dynamic>("/", animation: null)
* MaterialPageRoute<dynamic>("/animals", animation: null)
* null
* MaterialPageRoute<dynamic>("/animals/cats/lolcats", animation: null)
One or more of those objects was null, and therefore the initial route specified will be ignored and
"/" will be used instead.
════════════════════════════════════════════════════════════════════════════════════════════════════
I have declared the route /animals/cats/lolcats:
'/animals': (context) => AnimalsScreen(context),
'/animals/dogs': (context) => DogsScreen(context),
'/animals/cats/lolcats': (context) => LolcatsScreen(context),
and set my initialRoute to
initialRoute: '/animals/cats/lolcats',
Why am I getting the above error even though the route is declared?
I think the error logs are quite explicit.
Since you used '/' to divide your routes it's interpreted as "sub-routes".
Actually it is trying to go through these routes one after an other:
* /
* /animals
* /animals/cats
* /animals/cats/lolcats
And since /animals/cats isn't define, t is getting an error and then is coming back to initial route : /
If you want to solve this problem rename your routes with underscore like this :
/animals_cats_lolcats
So it won't try to get /animals/cats which doesn't exist
Related
I am using instructions from here on how to get started with open layers and I got the error: Namespace "ol" already declared - source ol-debug.js and the error
this.Va is not a function - source ol.js
I am pretty sure I have included the ol.js, ol-debug.js and ol.css files properly in my index.html.
Link to open layers js and css files.
This is the relevant part from ol-debug.js file -
/**
* Defines a namespace in Closure.
*
* A namespace may only be defined once in a codebase. It may be defined using
* goog.provide() or goog.module().
*
* The presence of one or more goog.provide() calls in a file indicates
* that the file defines the given objects/namespaces.
* Provided symbols must not be null or undefined.
*
* In addition, goog.provide() creates the object stubs for a namespace
* (for example, goog.provide("goog.foo.bar") will create the object
* goog.foo.bar if it does not already exist).
*
* Build tools also scan for provide/require/module statements
* to discern dependencies, build dependency files (see deps.js), etc.
*
* #see goog.require
* #see goog.module
* #param {string} name Namespace provided by this file in the form
* "goog.package.part".
*/
goog.provide = function(name) {
if (goog.isInModuleLoader_()) {
throw Error('goog.provide can not be used within a goog.module.');
}
if (!COMPILED) {
// Ensure that the same namespace isn't provided twice.
// A goog.module/goog.provide maps a goog.require to a specific file
if (goog.isProvided_(name)) {
throw Error('Namespace "' + name + '" already declared.');
}
}
goog.constructNamespace_(name);
};
You need to declare either ol.js or ol-debug.js, not both of them. The error is coming from the fact that you're declaring both of them and it is creating a namespace conflict.
Inside a controller i just test these two lines. RaceRegistration domain has a property compositeEvent. So, i access the Registration domain first and then access the compositeevent using .compositeEvent.
println (RaceRegistration.get(r.toLong()))
println (RaceRegistration.get(r.toLong())).compositeEvent
The following error is thrown. As you can see the first print succeeds i.e it gets the Registration domain but the second println fails. My question is why is it throwing null pointer when we are certain that the RaceRegistration domain was accessed successfully.
com.runnercard.registration.RaceRegistration : 8
ERROR errors.GrailsExceptionResolver: NullPointerException occurred when processing request: [POST] /roadrace/message/sendEmail - parameters:
I appreciate any help. Thanks!
Null is null. Don't doubt this: it is true.
The 'void' println expression evaluates to null and the failing code is roughly equivalent to the following:
x = println (RaceRegistration.get(r.toLong()))
// x is null - so the following results in a NullPointerException
x.compositeEvent
It is probable that the parenthesis is merely in the wrong spot (or even over-specified):
println (RaceRegistration.get(r.toLong()).compositeEvent)
// -or
println RaceRegistration.get(r.toLong()).compositeEvent
I have some confusion debugging some simple app that uses the Web Audio API.
In the developer console I can do something like this:
var ctx = new webkitAudioContext(),
osc = ctx.createOscillator();
osc.connect(ctx.destination);
osc.start(0);
Trying to get this to work with Dart yields the following errors when I try it like this:
AudioContext ctx = new AudioContext();
OscillatorNode osc = ctx.createOscillator();
osc.connect(ctx.destination);
osc.start(0);
//Dart2JS: Uncaught TypeError: Object #<OscillatorNode> has no method 'connect$1'
//DartVM: Class 'OscillatorNode' has no instance method 'connect' with matching
arguments. NoSuchMethodError: incorrect number of arguments passed to method
named connect' Receiver: Instance of 'OscillatorNode'
Stepping through I found that there are two kinds of implementations to the connect method. So I tried to add an extra second param and since I can not really wrap my head around why it needs an int named "output", thinking maybe it is for volume I decided on the value 1 but that yields:
//Dart2JS: Uncaught Error: IndexSizeError: DOM Exception 1 flexsynth.html_bootstrap.dart.js:8698 $.main flexsynth.html_bootstrap.dart.js:8698 $$._IsolateContext.eval$1flexsynth.html_bootstrap.dart.js:565 $.startRootIsolate flexsynth.html_bootstrap.dart.js:7181 (anonymous function)
//DartVM: "Dart_IntegerToInt64 expects argument 'integer' to be non-null."
Here is where I can't figure out what to do, I think the argument is not null, it is 1.
Googling the errors only leads me to the actual Dart source code.
Is there any place that explains how to work with the dart:web_audio? What am I doing wrong?
This is because the underlying implementation seems to require the parameter input, despite it being an optional parameter. This code will work:
AudioContext ctx = new AudioContext();
OscillatorNode osc = ctx.createOscillator();
osc.connect(ctx.destination, 0, 0);
osc.start(0);
This is a known bug, you can star it here: https://code.google.com/p/dart/issues/detail?id=6728
I'm pretty new to Dart, and I'm used to working with C# (and XNA usually), so Dart is a little different, and I'm not sure why this error is happening.
double left = c.Position.x - (canvasDimensions.x * 0.5);
the Position and canvasDimensions are a type I created, called Vector2, which basically contains 2 numbers, x and y, I am getting the error
NoSuchMethodError : method not found: '-'
Receiver: null
Arguments: [600.0]
on the line shown, since I am not familiar with the language I am not sure why this is happening, please help, thanks!
Here c.Position.x is null. In Dart calling a method (or an operator - in your case) on null leads to a NoSuchMethodError.
Grails 1.3.5
When mapping to a new controller in my application:
"/order/$action/$id?" {
controller = "customerOrder"
}
the request for "/order/show/13" resolves to "/()/()?/(*)?" as seen here in the log:
17:53:02 DEBUG UrlMappingsFilter - Matched URI [/order/show/13] to URL mapping [/(*)/(*)?/(*)?], forwarding to [/grails/home/page.dispatch] with response [class org.codehaus.groovy.grails.web.sitemesh.GrailsContentBufferingResponse]
If I add this mapping:
"/order/show/13"{
controller = "customerOrder"
action = "show"
id = 13
}
It still resolves to "/()/()?/(*)?". I edited the mapping:
"/customerOrder/show/13"{
controller = "customerOrder"
action = "show"
id = 13
}
and the log reports:
18:50:08 DEBUG DefaultUrlMappingsHolder - Matched URI [/customerOrder/show/13] with pattern [/customerOrder/show/13], adding to posibilities
Later it also reports:
18:50:08 DEBUG DefaultUrlMappingsHolder - Matched URI [/customerOrder/show/13] with pattern [/(*)/(*)?/(*)?], adding to posibilities
I'm totally baffled on this one. Either way, it resolves the same. Ideas anyone?
Apparently, in 1.3.5, you have to use a named closure intstead of the function syntax when declaring a view function.
def show( Long id ) { }
versus
def show = {}
The latter is correct. If someone could shed some light as to why...