Can't deploy on device (Android MarshMallow)

Daniel_EDaniel_E FRMember ✭✭

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.<>c__DisplayClass65_0.b__0(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!

Best Answers

  • Daniel_EDaniel_E FR ✭✭
    Accepted Answer

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

Answers

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    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.

  • Daniel_EDaniel_E FRMember ✭✭
    edited April 2017

    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()
    
  • Daniel_EDaniel_E FRMember ✭✭
    Accepted Answer

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

  • FernandoFernando BRMember

    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.c__AnonStorey4.<>m__0(Task1 t) 2> at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
    2> at System.Threading.Tasks.Task.Execute()

  • @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!

Sign In or Register to comment.