locked
Can't deploy on device (Android MarshMallow) RRS feed

  • Question

  • User102085 posted

    Hi!

    I have a weird problem.

    It happens on any xamarin project (Xamarin forms project in my case). I can run it on my Android api 22 (Samsung Core prime) and on a simulator but I cannot deploy it on my Android api 23 (Asus Zenfone 3). I get Index was outside the bounds of the array in the error panel. I tried on my mac and on my pc. If I remember well, I was able to deploy on my Zenfone before an update. After that, there is no way

    This is what I get in the output panel :

    [E:]: Deployment failed System.IndexOutOfRangeException: Index was outside the bounds of the array. at Mono.AndroidTools.AndroidInstalledPackage..ctor(String value) at Mono.AndroidTools.Internal.AdbOutputParsing.ParseLastResortPackageList(String output) at Mono.AndroidTools.AndroidDevice.<>cDisplayClass65_0.b0(Task1 t) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.Tasks.Task.Execute()

    In the diagnostic panel, I have among other (maybe) normal things :

    [INPUT] cat /data/system/packages.xml [OUTPUT] /system/bin/sh: cat: /data/system/packages.xml: Permission denied -- End GetPackages -- [D:RunShellCommand]: GBAXGY16K66457B cat /dbdata/system/packages.xml -- Start GetPackages - 04/15/2017 23:35:00 (12.1516ms) -- [INPUT] cat /dbdata/system/packages.xml [OUTPUT] /system/bin/sh: cat: /dbdata/system/packages.xml: No such file or directory -- End GetPackages --

    Is it a Xamarin bug?

    Thanks!

    Monday, April 17, 2017 8:02 AM

Answers

  • User102085 posted

    I bought another phone (Samsung Galaxy A3) and it works fine.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, April 18, 2017 12:16 PM
  • User269222 posted

    Problem solved. On Asus Zenfone 3, there is an app called Auto-start Manager. This app blocked the Mono Shared Runtime.

    I opened the setting and disabled all possible blocks and it worked.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 5, 2017 5:56 AM

All replies

  • User12817 posted

    Please try the following:

    http://stackoverflow.com/questions/43397981/xamarin-app-closes-immediately-on-startup/43399416#43399416

    If that still doesn't work, try to uncheck the "Use Shared Runtime" item in your project properties and see if that resolves the issue.

    Monday, April 17, 2017 5:34 PM
  • User102085 posted

    I still have the problem. Only adb uninstall Mono.Android.DebugRuntime succeeded. I must precise that the application icon had never appeared (/been listed) on the phone. I reset again the phone with no success. I may try a firmware downgrade to see what happen.

    I would like to see the source code of Mono.AndroidTools.AndroidInstalledPackage ctor but I did not find it on the internet. If you can read it maybe you could find the problem (and maybe the solution).

    [E:]:                     Deployment failed
    System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at Mono.AndroidTools.AndroidInstalledPackage..ctor(String value)
       at Mono.AndroidTools.Internal.AdbOutputParsing.ParseLastResortPackageList(String output)
       at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass65_0.<GetPackagesLastResort>b__0(Task`1 t)
       at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
       at System.Threading.Tasks.Task.Execute()
    
    Monday, April 17, 2017 8:46 PM
  • User102085 posted

    I bought another phone (Samsung Galaxy A3) and it works fine.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, April 18, 2017 12:16 PM
  • User269222 posted

    Hi! I'm facing the same problem with the Zenfone 3. After I upgraded de Android version, now it's impossible to deploy to it. \

    2> Deployment failed 2>System.IndexOutOfRangeException: Index was outside the bounds of the array. 2> at Mono.AndroidTools.AndroidInstalledPackage..ctor(String value) 2> at Mono.AndroidTools.Internal.AdbOutputParsing.ParseLastResortPackageList(String output) 2> at Mono.AndroidTools.AndroidDevice.cAnonStorey4.<>m0(Task1 t) 2> at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() 2> at System.Threading.Tasks.Task.Execute()

    Friday, May 5, 2017 1:07 AM
  • User269222 posted

    Problem solved. On Asus Zenfone 3, there is an app called Auto-start Manager. This app blocked the Mono Shared Runtime.

    I opened the setting and disabled all possible blocks and it worked.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 5, 2017 5:56 AM
  • User365137 posted

    @Fernando said: Problem solved. On Asus Zenfone 3, there is an app called Auto-start Manager. This app blocked the Mono Shared Runtime. I opened the setting and disabled all possible blocks and it worked.

    Thanks! It worked!

    Wednesday, January 31, 2018 7:05 PM