Skip to content

Gradle build doesn't notice when you switch buildMode #4760

Closed

Description

@tain335

Steps to Reproduce

I change hello_service project buildMode to debug mode but it cannot start.

Flutter Doctor

[✓] Flutter (on Mac OS, channel master)
• Flutter at /Users/paul/flutter-workspace/flutter
• Framework revision 9c0c022 (24 hours ago), engine revision bb98655

[✓] Android toolchain - develop for Android devices (Android SDK 23.0.2)
• Android SDK at /Users/paul/Library/Android/sdk
• Platform android-23, build-tools 23.0.2
• Java(TM) SE Runtime Environment (build 1.8.0_65-b17)

[✓] iOS toolchain - develop for iOS devices (Xcode 7.0.1)
• XCode at /Applications/Xcode.app/Contents/Developer
• Xcode 7.0.1, Build version 7A1001
x ideviceinstaller not available; this is used to discover connected iOS devices.
Install via 'brew install ideviceinstaller'.
x ios-deploy not available; this is used to deploy to connected iOS devices.
Install via 'brew install ios-deploy'.

[✓] Atom - a lightweight development environment for Flutter
• flutter plugin version 0.2.3
• dartlang plugin version 0.6.28

Logs and Crash Reports

E/System: Uncaught exception thrown by finalizer
E/System: java.lang.IllegalStateException: Warning: Router objects should be explicitly closed when no longer required otherwise you may leak handles.
at org.chromium.mojo.bindings.AutoCloseableRouter.finalize(AutoCloseableRouter.java:113)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:194)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:177)
at java.lang.Thread.run(Thread.java:818)
I/cr.library_loader: Time to load native libraries: 21 ms (timestamps 7870-7891)
I/cr.library_loader: Expected native library version number "", actual native library version number ""
E/ApkAssets: Error while loading asset assets/icudtl.dat: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
W/art: Attempt to remove local handle scope entry from IRT, ignoring
I/OpenGLRenderer: Initialized EGL, version 1.4
I/flutter: Observatory listening on http://127.0.0.1:34821
E/flutter: [ERROR:dart_error.cc(17)] Unhandled exception:
No top-level getter 'main' declared.

       NoSuchMethodError: method not found: 'main'
       Receiver: top-level
       Arguments: [...]
       #0      NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:178)
       #1      _getMainClosure (file:///b/build/slave/Linux_Engine/build/src/out/android_debug/gen/sky/bindings/dart_ui/natives.dart:38)

I/flutter: Diagnostic server listening on http://127.0.0.1:37671
W/ActivityThread: Application com.example.flutter is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/art: Debugger is active
I/System.out: Debugger has connected
I/System.out: waiting for debugger to settle...
Connected to the target VM, address: 'localhost:8605', transport: 'socket'
I/System.out: waiting for debugger to settle...

Activity

  1. abarth commented on Jun 26, 2016

    @abarth
    Contributor

    Interesting. Does it work if you do a clean build?

  2. tain335 commented on Jun 26, 2016

    @tain335
    Author

    Oh, I clean the project and it work.But it still has error log:
    )
    I/cr.library_loader: Time to load native libraries: 35 ms (timestamps 5381-5416)
    I/cr.library_loader: Expected native library version number "", actual native library version number ""
    E/ApkAssets: Error while loading asset assets/icudtl.dat: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
    W/art: Attempt to remove local handle scope entry from IRT, ignoring
    I/OpenGLRenderer: Initialized EGL, version 1.4
    E/flutter: [ERROR:dart_error.cc(17)] Unhandled exception:
    No top-level getter 'main' declared.

           NoSuchMethodError: method not found: 'main'
           Receiver: top-level
           Arguments: [...]
           #0      NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:178)
           #1      _getMainClosure (file:///b/build/slave/Linux_Engine/build/src/out/android_debug/gen/sky/bindings/dart_ui/natives.dart:38)
    

    Can resolve it?

  3. abarth commented on Jun 26, 2016

    @abarth
    Contributor

    When you say "it works" do you mean that the project builds cleanly or that the app runs properly? The error in the log usually means that the app doesn't run properly. If the app is running properly, perhaps the error is left over in the log from a previous run.

  4. tain335 commented on Jun 26, 2016

    @tain335
    Author

    Sorry, I didn't clean the log.

  5. eseidelGoogle commented on Jun 27, 2016

    @eseidelGoogle
    Contributor

    Is this something our gradel plugin could/should detect or help Android
    Studio to detect and cause a rebuild?

    On Sat, Jun 25, 2016 at 10:31 PM, tain335 [email protected] wrote:

    Closed #4760 #4760.

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #4760 (comment), or mute
    the thread
    https://github.com/notifications/unsubscribe/ALTvi9uuo-VVA2NG5JKg6YgD5Tofl6Xlks5qPg6UgaJpZM4I-ezg
    .

  6. abarth commented on Jun 27, 2016

    @abarth
    Contributor

    Yes, the gradle build is missing a dependency somewhere.

  7. reopened this on Jun 27, 2016
  8. changed the title [-]FlutterView buildMode debug not work[/-] [+]Gradle build doesn't notice when you switch buildMode[/+] on Jun 27, 2016
  9. abarth commented on Aug 12, 2016

    @abarth
    Contributor

    @tvolkert saw something similar today.

  10. modified the milestone: on Sep 12, 2016
  11. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Sep 13, 2016
  12. modified the milestones: , on Jan 31, 2017
  13. removed
    t: gradle"flutter build" and "flutter run" on Android
    on Feb 24, 2017
  14. Hixie commented on Nov 1, 2017

    @Hixie
    Contributor

    It's not clear what this is referring to.

  15. added a commit that references this issue on May 14, 2018
  16. github-actions commented on Sep 4, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  17. locked as resolved and limited conversation to collaborators on Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions