googlecodelabs / photos-sharing

Code for the "Build a Photo Sharing app with Google Photos and Flutter" codelab
Apache License 2.0
98 stars 76 forks source link

project does not build #9

Closed lwisne closed 5 years ago

lwisne commented 5 years ago

I run

git clone https://github.com/googlecodelabs/photos-sharing.git cd photos-sharing flutter run

And I get a long string of errors like so:

file:///usr/local/google/home/lwisne/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/svg.dart:158:18: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///usr/local/google/home/lwisne/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
        context: 'picture failed to precache',                          
                 ^                                                      
file:///usr/local/google/home/lwisne/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:335:20: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///usr/local/google/home/lwisne/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
          context: 'while resolving a picture',                         
                   ^                                                    
file:///usr/local/google/home/lwisne/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:337:33: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.                                  
 - 'Iterable' is from 'dart:core'.                                      
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///usr/local/google/home/lwisne/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
          informationCollector: (StringBuffer information) {

(this goes on for a while, cut off for brevity)

Any thoughts on what to do?

lwisne commented 5 years ago

FYI you can fix this by upgrading versions on a couple packages:

--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -28,10 +28,10 @@ dependencies:
   http: ^0.12.0+1
   json_annotation: ^2.1.0
   image_picker: ^0.5.1
-  cached_network_image: ^0.7.0
+  cached_network_image: ^1.1.1
   fluttertoast: ^3.0.3
   path: any
-  flutter_svg: ^0.12.4
+  flutter_svg: ^0.14.0
itsgreggreg commented 5 years ago

Just cloned the repo following along here https://codelabs.developers.google.com/codelabs/google-photos-sharing/index.html?index=..%2F..index#2 and ran into the same issue.

jfschmakeit commented 5 years ago

Looks like we need to bump the dependencies.

Thanks, for providing a workaround - we'll take a look.

carlzimmerman commented 5 years ago

Yeah dude same tutorial same issue.

jfschmakeit commented 5 years ago

Just bumped all dependencies and verified that this fixes the issue.