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

Packages failure #12

Closed
rafalbednarczuk opened this issue Mar 11, 2018 · 10 comments
Closed

Packages failure #12

rafalbednarczuk opened this issue Mar 11, 2018 · 10 comments

Comments

@rafalbednarczuk
Copy link

rafalbednarczuk commented Mar 11, 2018

Running the simplest flutter app with flutter_map causes this Exception:

type 'Bounds<num>' is not a subtype of type 'Bounds<double>' where
Bounds is from package:flutter_map/src/core/bounds.dart
num is from dart:core
Bounds is from package:flutter_map/src/core/bounds.dart
double is from dart:core

Dependencies:

  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.0
  flutter_map: ^0.0.1

imports and dart code:

import 'package:flutter/material.dart';
import 'package:latlong/latlong.dart';
import 'package:flutter_map/flutter_map.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new FlutterMap(
      options: new MapOptions(
        center: new LatLng(51.5, -0.09),
        zoom: 13.0,
      ),```
      layers: [
        new TileLayerOptions(
          urlTemplate: "https://api.tiles.mapbox.com/v4/"
              "{id}/{z}/{x}/{y}@2x.png?access_token={accessToken}",
          additionalOptions: {
            'accessToken': 'my api key from mapbox',
            'id': 'mapbox.streets',
          },
        ),
        new MarkerLayerOptions(
          markers: [
            new Marker(
              width: 80.0,
              height: 80.0,
              point: new LatLng(51.5, -0.09),
              builder: (ctx) =>
              new Container(
                child: new FlutterLogo(),
              ),
            ),
          ],
        ),
      ],
    );
  }
}
@johnpryan
Copy link
Collaborator

johnpryan commented Mar 12, 2018

Can you try using a scaffold with OpenStreetMap and let me know if you still hit this issue?

import 'package:flutter/material.dart';
import 'package:latlong/latlong.dart';
import 'package:flutter_map/flutter_map.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        body: new FlutterMap(
          options: new MapOptions(
            center: new LatLng(51.5, -0.09),
            zoom: 13.0,
          ),
          layers: [
            new TileLayerOptions(
              urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
              subdomains: ['a', 'b', 'c'],
              additionalOptions: {
                'accessToken': 'my api key from mapbox',
                'id': 'mapbox.streets',
              },
            ),
            new MarkerLayerOptions(
              markers: [
                new Marker(
                  width: 80.0,
                  height: 80.0,
                  point: new LatLng(51.5, -0.09),
                  builder: (ctx) => new Container(
                        child: new FlutterLogo(),
                      ),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

@rafalbednarczuk
Copy link
Author

Still same exception:

I/flutter ( 6918): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 6918): The following assertion was thrown building Container:
I/flutter ( 6918): type 'Bounds<num>' is not a subtype of type 'Bounds<double>' where
I/flutter ( 6918):   Bounds is from package:flutter_map/src/core/bounds.dart
I/flutter ( 6918):   num is from dart:core
I/flutter ( 6918):   Bounds is from package:flutter_map/src/core/bounds.dart
I/flutter ( 6918):   double is from dart:core
I/flutter ( 6918): 
I/flutter ( 6918): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 6918): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 6918): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 6918):   https://github.com/flutter/flutter/issues/new
I/flutter ( 6918): 
I/flutter ( 6918): When the exception was thrown, this was the stack:
I/flutter ( 6918): #0      new Bounds (package:flutter_map/src/core/bounds.dart:11:20)
I/flutter ( 6918): #1      SphericalMercator._bounds (package:flutter_map/src/geo/crs/crs.dart:86:39)
I/flutter ( 6918): #2      SphericalMercator._bounds (package:flutter_map/src/geo/crs/crs.dart:86:25)
I/flutter ( 6918): #3      SphericalMercator.bounds (package:flutter_map/src/geo/crs/crs.dart:93:32)
I/flutter ( 6918): #4      Crs.getProjectedBounds (package:flutter_map/src/geo/crs/crs.dart:43:24)
I/flutter ( 6918): #5      MapState.getPixelWorldBounds (package:flutter_map/src/map/map.dart:115:24)
I/flutter ( 6918): #6      _TileLayerState._resetGrid (package:flutter_map/src/layer/tile_layer.dart:173:22)
I/flutter ( 6918): #7      _TileLayerState._setView (package:flutter_map/src/layer/tile_layer.dart:85:7)
I/flutter ( 6918): #8      _TileLayerState._resetView (package:flutter_map/src/layer/tile_layer.dart:77:10)
I/flutter ( 6918): #9      _TileLayerState.initState (package:flutter_map/src/layer/tile_layer.dart:62:5)
I/flutter ( 6918): #10     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3734:58)
I/flutter ( 6918): #11     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
I/flutter ( 6918): #12     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
I/flutter ( 6918): #13     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4738:32)
I/flutter ( 6918): #14     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
I/flutter ( 6918): #15     Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
I/flutter ( 6918): #16     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
I/flutter ( 6918): #17     Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
I/flutter ( 6918): #18     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
I/flutter ( 6918): #19     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
I/flutter ( 6918): #20     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
I/flutter ( 6918): #21     Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
I/flutter ( 6918): #22     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
I/flutter ( 6918): #23     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
I/flutter ( 6918): #24     Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
I/flutter ( 6918): #25     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4633:14)
I/flutter ( 6918): #26     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
I/flutter ( 6918): #27     Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
I/flutter ( 6918): #28     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
I/flutter ( 6918): #29     Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
I/flutter ( 6918): #30     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
I/flutter ( 6918): #31     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3752:11)
I/flutter ( 6918): #32     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
I/flutter ( 6918): #33     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
I/flutter ( 6918): #34     Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
I/flutter ( 6918): #35     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
I/flutter ( 6918): #36     Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
I/flutter ( 6918): #37     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3605:5)
I/flutter ( 6918): #38     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3600:5)
I/flutter ( 6918): #39     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2890:14)
I/flutter ( 6918): #40     Element.updateChild (package:flutter/src/widgets/framework.dart:2693:12)
I/flutter ( 6918): #41     _LayoutBuilderElement._layout.<anonymous closure> (package:flutter/src/widgets/layout_builder.dart:118:18)
I/flutter ( 6918): #42     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2205:19)
I/flutter ( 6918): #43     _LayoutBuilderElement._layout (package:flutter/src/widgets/layout_builder.dart:107:11)
I/flutter ( 6918): #44     RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1666:58)
I/flutter ( 6918): #45     PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:740:15)
I/flutter ( 6918): #46     RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1666:13)
I/flutter ( 6918): #47     _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:205:5)
I/flutter ( 6918): #48     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #49     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:124:11)
I/flutter ( 6918): #50     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:256:7)
I/flutter ( 6918): #51     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:194:7)
I/flutter ( 6918): #52     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:338:14)
I/flutter ( 6918): #53     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #54     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #55     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #56     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #57     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1141:11)
I/flutter ( 6918): #58     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #59     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #60     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #61     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #62     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #63     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #64     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #65     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #66     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #67     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #68     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:2713:13)
I/flutter ( 6918): #69     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #70     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #71     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #72     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:509:15)
I/flutter ( 6918): #73     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #74     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #75     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #76     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #77     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #78     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #79     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #80     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #81     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #82     __RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin^^#U0^#U0.performLayout (package:flutter/src/rendering/proxy_box.dart:107:13)
I/flutter ( 6918): #83     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6918): #84     RenderView.performLayout (package:flutter/src/rendering/view.dart:125:13)
I/flutter ( 6918): #85     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1445:7)
I/flutter ( 6918): #86     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:709:18)
I/flutter ( 6918): #87     _____BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:270:19)
I/flutter ( 6918): #88     ______BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:622:13)
I/flutter ( 6918): #89     _____BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
I/flutter ( 6918): #90     ___BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter ( 6918): #91     ___BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter ( 6918): #92     ___BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:751:7)
I/flutter ( 6918): #94     _Timer._runTimers (dart:isolate/timer_impl.dart:382:19)
I/flutter ( 6918): #95     _Timer._handleMessage (dart:isolate/timer_impl.dart:416:5)
I/flutter ( 6918): #96     _RawReceivePortImpl._handleMessage (dart:isolate/isolate_patch.dart:165:12)
I/flutter ( 6918): (elided one frame from package dart:async)
I/flutter ( 6918): ════════════════════════════════════════════════════════════════════════════════════════════════════
Syncing files to device Android SDK built for x86...

@johnpryan
Copy link
Collaborator

Thanks - I'll try to reproduce. It seems like a simple fix.

@rafalbednarczuk
Copy link
Author

Exception occurs when running app with --preview-dart-2

@johnpryan
Copy link
Collaborator

ah that makes sense. I'll try to find some time to work on this.

@zhangshu1
Copy link

Facing the same problem. Is there any updates?

@johnpryan
Copy link
Collaborator

@zhangshu1 what version of flutter_map are you using? this should be fixed in ^0.0.3

@zhangshu1
Copy link

@johnpryan Thanks! It fixed!

@shinygang
Copy link

shinygang commented Jun 26, 2019

flutter: #33 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame
package:flutter/…/scheduler/binding.dart:864
flutter: #37 _invoke (dart:ui/hooks.dart:220:10)
flutter: #38 _drawFrame (dart:ui/hooks.dart:178:3)
flutter: (elided 5 frames from class _AssertionError and package dart:async)
flutter:
flutter: The following RenderObject was being processed when the exception was fired: RenderIndexedStack#d594c relayoutBoundary=up1:
flutter: needs compositing
flutter: creator: IndexedStack ← MediaQuery ← LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ←
flutter: AnimatedBuilder ← DefaultTextStyle ← AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#94f92 ink
flutter: renderer] ← NotificationListener ← PhysicalModel ←
flutter: AnimatedPhysicalModel ← Material ← ⋯
flutter: parentData: offset=Offset(0.0, 0.0); id=_ScaffoldSlot.body (can use size)
flutter: constraints: BoxConstraints(0.0<=w<=414.0, 0.0<=h<=811.0)
flutter: size: Size(414.0, 811.0)
flutter: alignment: AlignmentDirectional.topStart
flutter: textDirection: ltr
flutter: fit: loose
flutter: overflow: clip
flutter: index: 2
flutter: This This RenderObject had the following descendants (showing up to depth 5):
flutter: child 1: RenderPhysicalModel#51fb2 relayoutBoundary=up2
flutter: child: _RenderInkFeatures#d68ea relayoutBoundary=up3
flutter: child: RenderCustomMultiChildLayoutBox#70dc7 relayoutBoundary=up4
flutter: child 1: _RenderScrollSemantics#374d4 relayoutBoundary=up5
flutter: child: RenderPointerListener#3462c relayoutBoundary=up6
flutter: child 2: RenderConstrainedBox#7fc99 relayoutBoundary=up5
flutter: child: RenderSemanticsAnnotations#76aa6 relayoutBoundary=up6
flutter: child 3: RenderStack#18df4 relayoutBoundary=up5
flutter: child 1: RenderTransform#37fd6 relayoutBoundary=up6
flutter: child 4: RenderPointerListener#ede90
flutter: child 2: RenderLimitedBox#2f89a relayoutBoundary=up2 NEEDS-PAINT
flutter: child: RenderConstrainedBox#a21bd relayoutBoundary=up3 NEEDS-PAINT
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: Another exception was thrown: 'package:flutter/src/rendering/stack.dart': Failed assertion: line 666 pos 12: 'child != null': is not true.
flutter: Another exception was thrown: 'package:flutter/src/rendering/stack.dart': Failed assertion: line 666 pos 12: 'child != null': is not true.

flutter_map: "^0.6.1"

@johnpryan
Copy link
Collaborator

johnpryan commented Jun 26, 2019

@shinygang can you file a separate issue for this please? thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants