You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the following line in debug mode or compile a debug build it works fine but when I try to make a profile or release build the consumes all memory then crashes. Here's a snippet:
// Open up the xml file of recipes
String recipesXML = await rootBundle.loadString('xmlfiles/recipes.xml');
// Open up the xml parser and parse in the recipes
xml.XmlDocument recipebook = xml.parse(recipesXML);
// get an iterator that can walk through the list of recipes
Iterable<xml.XmlElement> recipeObjs = recipebook.findAllElements('RcpE');
Iterable<xml.XmlElement> subObjs;
for (int idx = 0; idx < numRecipes; idx++) {
recipes.add(new Recipe.empty());
recipes.elementAt(idx).name =
recipeObjs.elementAt(idx).getAttribute("name").toString();
recipes.elementAt(idx).author =
recipeObjs.elementAt(idx).getAttribute("author").toString();
recipes.elementAt(idx).imagePath = 'photos/' +
recipes
.elementAt(idx)
.name
.replaceAll(' ', '_')
.replaceAll('&', 'and')
.replaceAll('-', '_')
.replaceAll("'", '')
.replaceAll('__', '_')
.replaceAll(',', '')
.toLowerCase() +
'.jpg';
// get servings
subObjs = recipeObjs.elementAt(idx).findElements('Serv');
// THE BELOW LINE CAUSES RELEASE or PROFILE BUILDS TO FAIL
recipes.elementAt(idx).servings =
int.tryParse(subObjs.elementAt(0).getAttribute("qty")) ?? 1;
The text was updated successfully, but these errors were encountered:
I think you should report this to the Flutter bug-tracker, assuming that you are talking about Flutter and this happens during compile-time? Also, it would help if you could provide a self-contained minimal example, because with the provided code I cannot reproduce the problem (numRecipes is not defined, the xml file does not exist, etc.).
When I use the following line in debug mode or compile a debug build it works fine but when I try to make a profile or release build the consumes all memory then crashes. Here's a snippet:
The text was updated successfully, but these errors were encountered: