google / flutter.widgets

https://pub.dev/packages/flutter_widgets
BSD 3-Clause "New" or "Revised" License
1.38k stars 484 forks source link

Can't build app on Android or IOS #20

Closed LucasTejero3DIQ closed 5 years ago

LucasTejero3DIQ commented 5 years ago

indepent from the platform i can't build the app. it gave me this error

Compiler message: ../.pub-cache/hosted/pub.dartlang.org/flutter_widgets-0.1.5/lib/src/visibility_detector/src/visibility_detector_layer.dart:277:18: Error: This expression has type 'void' and can't be used. return super.addToScene(builder, layerOffset);

miguelcmedeiros commented 5 years ago

Same here. I was trying to upgrade to v1.9.1+hotfix.1 when I detected this failure:

$ flutter doctor -v
[✓] Flutter (Channel unknown, v1.9.1+hotfix.1, on Mac OS X 10.14.4 18E226, locale en-NL)
    • Flutter version 1.9.1+hotfix.1 at /Users/user/IdeaProjects/hue_blue/dev/flutter
    • Framework revision a1fb3fabec (8 hours ago), 2019-09-03 18:07:52 -0700
    • Engine revision cc88fa45db
    • Dart version 2.5.0

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/user/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.3, Build version 10G8
    • CocoaPods version 1.7.5

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 38.2.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Community Edition (version 2019.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 35.2.2
    • Dart plugin version 191.6183.88

[✓] Connected device (1 available)
    • iPhone Xʀ • D8EACBEA-E98E-4C87-B93D-48A79E08A5A9 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)

• No issues found!
miguelcmedeiros commented 5 years ago

It seems that there were backwards incompatible changes done in the framework: https://github.com/flutter/flutter/pull/36402/files#diff-58600d3d2645a66835eb03f3c41b447bR848

lifenautjoe commented 5 years ago

Any workaround for this? Facing the same issue..

jamesderlin commented 5 years ago

Yes, VisibilityDetector is broken with Flutter's dev branch. We have a fix for this already, but we need to maintain compatibility with the Flutter stable branch. To satisfy both stable and dev, we expect to push out a dev release soon (this means that you will need to specify the version explicitly in pubspec.yaml; the package won't be upgraded automatically).

In the meantime, you can apply the following patch:

--- a/lib/src/visibility_detector/src/visibility_detector_layer.dart
+++ b/lib/src/visibility_detector/src/visibility_detector_layer.dart
@@ -270,11 +270,10 @@ class VisibilityDetectorLayer extends ContainerLayer {

   /// See [Layer.addToScene].
   @override
-  ui.EngineLayer addToScene(ui.SceneBuilder builder,
-      [Offset layerOffset = Offset.zero]) {
+  void addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) 
     _layerOffset = layerOffset;
     _scheduleUpdate();
-    return super.addToScene(builder, layerOffset);
+    super.addToScene(builder, layerOffset);
   }

   /// See [AbstractNode.attach].