Forum Xamarin Xamarin.Android

Mono.AndroidTools.InstallFailedException: Unexpected install output: Error: Unknown option: -d

AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

I have this error when I try to deploy to a device connected via USB. I am using Visual Studio 2017 last release, but same problem with VS4MAC

what could be? @dortinau @JamesMontemagno

ADB0000: Deployment failed
1>Mono.AndroidTools.InstallFailedException: Unexpected install output: Error: Unknown option: -d
1>usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [FILTER]
1> pm list permission-groups
1> pm list permissions [-g] [-f] [-d] [-u] [GROUP]
1> pm list instrumentation [-f] [TARGET-PACKAGE]
1> pm list features
1> pm list libraries
1> pm path PACKAGE
1> pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f]
1> [--algo --key --iv ] PATH
1> pm uninstall [-k] PACKAGE
1> pm clear PACKAGE
1> pm enable PACKAGE_OR_COMPONENT
1> pm disable PACKAGE_OR_COMPONENT
1> pm disable-user PACKAGE_OR_COMPONENT
1> pm grant PACKAGE PERMISSION
1> pm revoke PACKAGE PERMISSION
1> pm set-install-location [0/auto] [1/internal] [2/external]
1> pm get-install-location
1> pm set-permission-enforced PERMISSION [true|false]
1>
1>pm list packages: prints all packages, optionally only
1> those whose package name contains the text in FILTER. Options:
1> -f: see their associated file.
1> -d: filter to only show disbled packages.
1> -e: filter to only show enabled packages.
1> -s: filter to only show system packages.
1> -3: filter to only show third party packages.
1> -i: see the installer for the packages.
1> -u: also include uninstalled packages.
1>
1>pm list permission-groups: prints all known permission groups.
1>
1>pm list permissions: prints all known permissions, optionally only
1> those in GROUP. Options:
1> -g: organize by group.
1> -f: print all information.
1> -s: short summary.
1> -d: only list dangerous permissions.
1> -u: list only the permissions users will see.
1>
1>pm list instrumentation: use to list all test packages; optionally
1> supply to list the test packages for a particular
1> application. Options:
1> -f: list the .apk file for the test package.
1>
1>pm list features: prints all features of the system.
1>
1>pm path: print the path to the .apk of the given PACKAGE.
1>
1>pm install: installs a package to the system. Options:
1> -l: install the package with FORWARD_LOCK.
1> -r: reinstall an exisiting app, keeping its data.
1> -t: allow test .apks to be installed.
1> -i: specify the installer package name.
1> -s: install package on sdcard.
1> -f: install package on internal flash.
1>
1>pm uninstall: removes a package from the system. Options:
1> -k: keep the data and cache directories around after package removal.
1>
1>pm clear: deletes all data associated with a package.
1>
1>pm enable, disable, disable-user: these commands change the enabled state
1> of a given package or component (written as "package/class").
1>
1>pm grant, revoke: these commands either grant or revoke permissions
1> to applications. Only optional permissions the application has
1> declared can be granted or revoked.
1>
1>pm get-install-location: returns the current install location.
1> 0 [auto]: Let system decide the best location
1> 1 [internal]: Install on internal device storage
1> 2 [external]: Install on external media
1>
1>pm set-install-location: changes the default install location.
1> NOTE: this is only intended for debugging; using this can cause
1> applications to break and other undersireable behavior.
1> 0 [auto]: Let system decide the best location
1> 1 [internal]: Install on internal device storage
1> 2 [external]: Install on external media
1>
1> in Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A_work\293\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:riga 345
1> in Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.b__0(Task1 t) in E:\A\_work\293\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:riga 753 1> in System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke()
1> in System.Threading.Tasks.Task.Execute()
1>ADB0010: Unexpected install output: Error: Unknown option: -d
1>usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [FILTER]
1> pm list permission-groups
1> pm list permissions [-g] [-f] [-d] [-u] [GROUP]
1> pm list instrumentation [-f] [TARGET-PACKAGE]
1> pm list features
1> pm list libraries
1> pm path PACKAGE
1> pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f]
1> [--algo --key --iv ] PATH
1> pm uninstall [-k] PACKAGE
1> pm clear PACKAGE
1> pm enable PACKAGE_OR_COMPONENT
1> pm disable PACKAGE_OR_COMPONENT
1> pm disable-user PACKAGE_OR_COMPONENT
1> pm grant PACKAGE PERMISSION
1> pm revoke PACKAGE PERMISSION
1> pm set-install-location [0/auto] [1/internal] [2/external]
1> pm get-install-location
1> pm set-permission-enforced PERMISSION [true|false]
1>
1>pm list packages: prints all packages, optionally only
1> those whose package name contains the text in FILTER. Options:
1> -f: see their associated file.
1> -d: filter to only show disbled packages.
1> -e: filter to only show enabled packages.
1> -s: filter to only show system packages.
1> -3: filter to only show third party packages.
1> -i: see the installer for the packages.
1> -u: also include uninstalled packages.
1>
1>pm list permission-groups: prints all known permission groups.
1>
1>pm list permissions: prints all known permissions, optionally only
1> those in GROUP. Options:
1> -g: organize by group.
1> -f: print all information.
1> -s: short summary.
1> -d: only list dangerous permissions.
1> -u: list only the permissions users will see.
1>
1>pm list instrumentation: use to list all test packages; optionally
1> supply to list the test packages for a particular
1> application. Options:
1> -f: list the .apk file for the test package.
1>
1>pm list features: prints all features of the system.
1>
1>pm path: print the path to the .apk of the given PACKAGE.
1>
1>pm install: installs a package to the system. Options:
1> -l: install the package with FORWARD_LOCK.
1> -r: reinstall an exisiting app, keeping its data.
1> -t: allow test .apks to be installed.
1> -i: specify the installer package name.
1> -s: install package on sdcard.
1> -f: install package on internal flash.
1>
1>pm uninstall: removes a package from the system. Options:
1> -k: keep the data and cache directories around after package removal.
1>
1>pm clear: deletes all data associated with a package.
1>
1>pm enable, disable, disable-user: these commands change the enabled state
1> of a given package or component (written as "package/class").
1>
1>pm grant, revoke: these commands either grant or revoke permissions
1> to applications. Only optional permissions the application has
1> declared can be granted or revoked.
1>
1>pm get-install-location: returns the current install location.
1> 0 [auto]: Let system decide the best location
1> 1 [internal]: Install on internal device storage
1> 2 [external]: Install on external media
1>
1>pm set-install-location: changes the default install location.
1> NOTE: this is only intended for debugging; using this can cause
1> applications to break and other undersireable behavior.
1> 0 [auto]: Let system decide the best location
1> 1 [internal]: Install on internal device storage
1> 2 [external]: Install on external media
1>
1> in Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A_work\293\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:riga 345
1> in Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.b__0(Task1 t) in E:\A\_work\293\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:riga 753 1> in System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke()
1> in System.Threading.Tasks.Task.Execute()
1>Esecuzione attività "InstallPackageAssemblies" NON COMPLETATA.
1>Compilazione destinazione "_Upload" nel progetto "Fev-distribuzione.Droid.csproj" NON COMPLETATA.
1>Compilazione progetto "Fev-distribuzione.Droid.csproj" NON COMPLETATA.
1>Compilazione NON RIUSCITA.
1>Deployment failed to Pegatron Getac Z710.

Posts

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    The problem seems to be in a Android 4.1 device. In a 6.0 device I can deploy and debug

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    @AlessandroCaliaro Hey Alessandro!

    This is a regression issue with older Android devices as the pm arguments changed between versions. We added a check to ensure this won't happen for older devices. With that said, we have hotfixed this and will be available in an upcoming service release to both Visual Studio 2017 and Visual Studio for Mac:

    https://github.com/xamarin/xamarin-android/issues/2391

    For now, you can use > Android 4.4 Devices/Emulators. As the arguments are correct and supported.

    If this is completely blocking you for < Android 4.4 Devices/Emulators, you should still be able to install respective .apks to these devices with your current version.

    If you need debugger support against these devices today and cannot wait for the hotfix, you can also use an older version of Visual Studio found here:

    https://docs.microsoft.com/en-us/visualstudio/productinfo/installing-an-earlier-release-of-vs2017

    (I believe the latest 15.8 version should suffice)

    We truly apologize for the inconvenience and thank you for your patience.

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    Thanks @JonDouglas
    No problem, I will debug with a more recent device

    Happy Christmas
  • JeffGonzalesJeffGonzales USMember ✭✭

    What would cause this if I have been building/running fine for a long time before encountering this error?

  • EhsanJahanagiriEhsanJahanagiri USMember ✭✭

    In my case seems app uncompleted version was installed on my device
    Because after
    "adb shell pm uninstall com.packagename" command

    The problem solved !

Sign In or Register to comment.