Azure Mobile Center causes Exception

Felipe_BaltazarFelipe_Baltazar Felipe BaltazarBRMember ✭✭

Hello!
I am trying to use the "azure mobile center". But it is returning me an exception "out of array index".

If I remove the code below, the exception is not thrown:

MobileCenter.Start("android={My secret};" + 
                   "uwp={My secret};" +
                   "ios={My secret}",
                   typeof(Analytics), typeof(Crashes));

any idea?

Best Answer

Answers

  • JohnMillerJohnMiller John Miller USForum Administrator, Xamarin Team Xamurai
    edited May 22

    @Felipe_Baltazar,

    Can you post the full stack trace of the error? Make sure also that you don't actually have any { } in your key value.

  • Felipe_BaltazarFelipe_Baltazar Felipe Baltazar BRMember ✭✭
    edited May 24

    @JohnMiller

    this is ok! :smiley:

    Make sure also that you don't actually have any { } in your key value.

    the output error:

    System.IndexOutOfRangeException: Index was outside the bounds of the array.`
    
    
    `05-23 22:06:32.686 D/Mono    ( 2715): Found as 'java_interop_jnienv_call_boolean_method'.`
    `Unhandled Exception:`
    
    `System.IndexOutOfRangeException: Index was outside the bounds of the array.`
    
    `Thread finished: <Thread Pool> #2`
    `The thread 'Unknown' (0x2) has exited with code 0 (0x0).`
    `05-23 22:07:51.112 D/Mono    ( 2715): DllImport attempting to load: '/system/lib/liblog.so'.`
    `Thread started: <Thread Pool> #8`
    `05-23 22:07:51.113 D/Mono    ( 2715): DllImport loaded library '/system/lib/liblog.so'.`
    `05-23 22:07:51.113 D/Mono    ( 2715): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').`
    `Thread started: <Thread Pool> #9`
    `05-23 22:07:51.113 D/Mono    ( 2715): Searching for '__android_log_print'.`
    `Thread started: <Thread Pool> #10`
    `Thread started: <Thread Pool> #11`
    `05-23 22:07:51.113 D/Mono    ( 2715): Probing '__android_log_print'.`
    `05-23 22:07:51.114 D/Mono    ( 2715): Found as '__android_log_print'.`
    `05-23 22:07:51.204 I/MonoDroid( 2715): UNHANDLED EXCEPTION:`
    `05-23 22:07:51.210 D/Mono    ( 2715): [0x9cd5e930] hill climbing, change max number of threads 11`
    `05-23 22:07:51.272 D/Mono    ( 2715): [0x9acff930] worker starting`
    `05-23 22:07:51.339 D/Mono    ( 2715): [0x9aafd930] worker starting`
    `05-23 22:07:51.342 D/Mono    ( 2715): [0x9abfe930] worker starting`
    `05-23 22:07:51.364 I/MonoDroid( 2715): System.IndexOutOfRangeException: Index was outside the bounds of the array.`
    `05-23 22:07:51.364 I/MonoDroid( 2715):   at Microsoft.Azure.Mobile.MobileCenter.SetWrapperSdkAndGetApplication () [0x00029] in <549b68d408b14e40b17050d10c4e9b86>:0 `
    `05-23 22:07:51.364 I/MonoDroid( 2715):   at Microsoft.Azure.Mobile.MobileCenter.Start (System.String appSecret, System.Type[] services) [0x00027] in <549b68d408b14e40b17050d10c4e9b86>:0 `
    `05-23 22:07:51.365 I/MonoDroid( 2715):   at Promob_Draw.App.OnStart () [0x00001] in D:\DADOS\Documents\Desenvolvimento\Draw\Promob Draw\Promob_Draw\Aplication\App.cs:334 `
    `05-23 22:07:51.365 I/MonoDroid( 2715):   at Xamarin.Forms.Application.SendStart () [0x00000] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Core\Application.cs:228 `
    `05-23 22:07:51.365 I/MonoDroid( 2715):   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity+<OnStateChanged>d__43.MoveNext () [0x0003b] in C:\BuildAgent2\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:426 `
    `05-23 22:07:51.375 I/MonoDroid( 2715): --- End of stack trace from previous location where exception was thrown ---`
    `05-23 22:07:51.375 I/MonoDroid( 2715):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3511/501e63ce/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 `
    `05-23 22:07:51.376 I/MonoDroid( 2715):   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (System.Object state) [0x00000] in /Users/builder/data/lanes/3511/501e63ce/source/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018 `
    `05-23 22:07:51.376 I/MonoDroid( 2715):   at Android.App.SyncContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/3511/501e63ce/source/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:18 `
    `05-23 22:07:51.376 I/MonoDroid( 2715):   at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/3511/501e63ce/source/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36 `
    `05-23 22:07:51.376 I/MonoDroid( 2715):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3511/501e63ce/source/monodroid/src/Mono.Android/platforms/android-24/src/generated/Java.Lang.IRunnable.cs:81 `
    `05-23 22:07:51.376 I/MonoDroid( 2715):   at (wrapper dynamic-method) System.Object:d97893fd-955f-409e-9f53-052da5f51bf5 (intptr,intptr)`
    `05-23 22:07:51.563 W/art     ( 2715): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable`
    `05-23 22:07:51.578 D/Mono    ( 2715): DllImport searching in: '__Internal' ('(null)').`
    `05-23 22:07:51.578 D/Mono    ( 2715): Searching for 'java_interop_jnienv_throw'.`
    `05-23 22:07:51.578 D/Mono    ( 2715): Probing 'java_interop_jnienv_throw'.`
    `05-23 22:07:51.578 D/Mono    ( 2715): Found as 'java_interop_jnienv_throw'.`
    `An unhandled exception occured.`
    
    `05-23 22:07:57.699 E/mono    ( 2715): `
    `05-23 22:07:57.699 E/mono    ( 2715): Unhandled Exception:`
    `05-23 22:07:57.699 E/mono    ( 2715): System.IndexOutOfRangeException: Index was outside the bounds of the array.`
    `referenceTable GDEF length=814 1`
    `referenceTable GSUB length=11364 1`
    `referenceTable GPOS length=47302 1`
    `referenceTable GDEF length=808 1`
    `referenceTable GSUB length=11364 1`
    `referenceTable GPOS length=49206 1`
    `referenceTable head length=54 1`
    `referenceTable head length=54 1`
    `05-23 22:07:57.699 E/mono-rt ( 2715): [ERROR] FATAL UNHANDLED EXCEPTION: System.IndexOutOfRangeException: Index was outside the bounds of the array.`
    
  • LiyaElsaThomasLiyaElsaThomas Liya Elsa Thomas USMember

    @JohnMiller said:
    @Felipe_Baltazar,

    Can you post the full stack trace of the error? Make sure also that you don't actually have any { } in your key value.

    Hi,

       Any updates on this ? Even i have the same issue. Here is my stack trace below. 
    

    {System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at Microsoft.Azure.Mobile.MobileCenter.SetWrapperSdkAndGetApplication () [0x00029] in <3f0c4f6c7bef4106856b5295e4caf2d8>:0
    at Microsoft.Azure.Mobile.MobileCenter.Start (System.String appSecret, System.Type[] services) [0x00027] in <3f0c4f6c7bef4106856b5295e4caf2d8>:0
    at MobileCentreXamarin.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00016] in c:\Users\let\Documents\Visual Studio 2013\Projects\MobileCentreXamarin\MobileCentreXamarin\MainActivity.cs:20 }

    This will not throw any exception, if i remove the key.

    //MobileCenter.Start("xxxxxxx-xxx-xxx-xxx-xxxxxxxxxx", typeof(Analytics), typeof(Crashes));
    MobileCenter.Start(typeof(Analytics), typeof(Crashes));

    Thanks.

  • LiyaElsaThomasLiyaElsaThomas Liya Elsa Thomas USMember

    @JohnMiller said:
    @Felipe_Baltazar,

    Can you post the full stack trace of the error? Make sure also that you don't actually have any { } in your key value.

    Hi,

       Any updates on this ? Even i have the same issue. Here is my stack trace below. 
    

    {System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at Microsoft.Azure.Mobile.MobileCenter.SetWrapperSdkAndGetApplication () [0x00029] in <3f0c4f6c7bef4106856b5295e4caf2d8>:0
    at Microsoft.Azure.Mobile.MobileCenter.Start (System.String appSecret, System.Type[] services) [0x00027] in <3f0c4f6c7bef4106856b5295e4caf2d8>:0
    at MobileCentreXamarin.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00016] in c:\Users\let\Documents\Visual Studio 2013\Projects\MobileCentreXamarin\MobileCentreXamarin\MainActivity.cs:20 }

    This will not throw any exception, if i remove the key.

    //MobileCenter.Start("dbf93161-e3d4-414b-80b6-e7a298b46a10", typeof(Analytics), typeof(Crashes));
    //MobileCenter.Start(typeof(Analytics), typeof(Crashes));

  • Felipe_BaltazarFelipe_Baltazar Felipe Baltazar BRMember ✭✭

    @GuillaumePerrot
    In the version 0.12.0, of the nuget, the bug is fixed!
    Thks!

  • GuillaumePerrotGuillaumePerrot Guillaume Perrot USMember ✭✭

    Glad it worked for you Felipe.

    @LiyaElsaThomas are you using v0.12.0 of the nuget?

Sign In or Register to comment.