Skip to content

Crash launching on android #3825

Closed
Closed

Description

@Hixie2

command

flutter run --checked --debug-port=16164 --start-paused --device-id HT49CJT00009

exception

Exit code 1 from: /android-sdk/platform-tools/adb -s HT49CJT00009 shell pm path com.yourcompany.youngShadow1391

package:flutter_tools/src/base/process.dart 142                   _runWithLoggingSync
package:flutter_tools/src/base/process.dart 84                    runCheckedSync
package:flutter_tools/src/android/android_device.dart 169         AndroidDevice.isAppInstalled
package:flutter_tools/src/commands/install.dart 37                installApp
package:flutter_tools/src/commands/run.dart 206                   startApp.<async>
===== asynchronous gap ===========================
dart:async                                                        _Completer.completeError
package:flutter_tools/src/commands/run.dart 241                   startApp.<async>
===== asynchronous gap ===========================
dart:async                                                        _asyncThenWrapperHelper
package:flutter_tools/src/commands/run.dart                       startApp
package:flutter_tools/src/commands/run.dart 124                   RunCommand.runInProject.<async>
===== asynchronous gap ===========================
dart:async                                                        Future.Future.microtask
package:flutter_tools/src/commands/run.dart                       RunCommand.runInProject
package:flutter_tools/src/runner/flutter_command.dart 176         FlutterCommand._run.<async>
dart:async                                                        _SyncCompleter.complete
package:flutter_tools/src/cache.dart 108                          Cache.updateAll.<async>
===== asynchronous gap ===========================
dart:async                                                        _asyncThenWrapperHelper
package:flutter_tools/src/runner/flutter_command.dart             FlutterCommand._run
package:flutter_tools/src/runner/flutter_command.dart 106         FlutterCommand.run
package:args/command_runner.dart 176                              CommandRunner.runCommand.<fn>
dart:async                                                        Future.Future.sync
package:args/command_runner.dart 129                              CommandRunner.runCommand
package:flutter_tools/src/runner/flutter_command_runner.dart 242  FlutterCommandRunner.runCommand
package:args/command_runner.dart 103                              CommandRunner.run.<fn>
dart:async                                                        Future.Future.sync
package:args/command_runner.dart 103                              CommandRunner.run
package:flutter_tools/src/runner/flutter_command_runner.dart 189  FlutterCommandRunner.run
package:flutter_tools/executable.dart 86                          main.<async>.<fn>.<async>
===== asynchronous gap ===========================
package:stack_trace                                               Chain.capture
package:flutter_tools/executable.dart 80                          main.<async>

Activity

  1. sethladd commented on May 9, 2016

    @sethladd
    Contributor

    We think is when we run on Android N. This happens on a Nexus 6 and Nexus 9.

  2. devoncarew commented on May 10, 2016

    @devoncarew
    Contributor

    Can you run flutter -v run, find the adb command (w/ args) that it's failing on, and run that command manually? It might print out better text that would help us narrow down the failure.

  3. sethladd commented on May 10, 2016

    @sethladd
    Contributor

    I just tried on Android N, build NPC91K, on a 5X, and I was able to "flutter run" the gallery.

  4. sethladd commented on May 10, 2016

    @sethladd
    Contributor

    This line (

    if (runCheckedSync(adbCommandForDevice(<String>['shell', 'pm', 'path', app.id])).isEmpty)
    ) is failing on the devices we're testing on. We tried running this adb command manually, and it failed with the same error ("Exit code 1...")

    If we run flutter build apk and then manually install the APK onto the device, the app works.

    The adb on the test machine is "Android debug bridge version 1.0.35", fwiw.

  5. devoncarew commented on May 10, 2016

    @devoncarew
    Contributor

    I have 1.0.32 locally. We should probably change to wrapping the call with a try-catch; we don't need to fail the build if the app isn't installed, just return false. Perhaps the exit code convention changed for that adb call.

  6. sethladd commented on May 10, 2016

    @sethladd
    Contributor

    After debugging, we deduced that 1.0.35 changed behavior, and prints a 1 if the path isn't found. On 1.0.32, nothing is printed.

    Meanwhile, pm list packages seems to have consistent behavior on 1.0.32 and 1.0.35 and could be used to answer the question "does the apk exist on the device".

  7. added a commit that references this issue on May 11, 2016
    e2ab858
  8. github-actions commented on Sep 6, 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.

  9. locked as resolved and limited conversation to collaborators on Sep 6, 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

    c: crashStack traces logged to the console

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions