Hi everyone,
I have been used this code for a long time without any issue.. now, I have an error on Android 8
The code:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
The app crash on this line:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
The debug:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Could it be related to permissions? Witch one?
Thanks all
			
			I have been used this code for a long time without any issue.. now, I have an error on Android 8
The code:
			
				B4X:
			
		
		
		Dim r As Reflector
r.Target = r.RunStaticMethod("android.accounts.AccountManager", "get", _
      Array As Object(r.GetContext), Array As String("android.content.Context"))
Dim accounts() As Object
accounts = r.RunMethod2("getAccountsByType","com.google", "java.lang.String")
r.Target = accounts(0) ' read the first record
loc_ToRetun = r.GetField("name")
	The app crash on this line:
			
				B4X:
			
		
		
		r.Target = accounts(0) ' read the first record
	The debug:
			
				B4X:
			
		
		
		Error occurred on line: 267 (zzUtil)[/COLOR][/FONT][/LEFT]
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
 at java.lang.reflect.Array.get(Array.java:174)
 at anywheresoftware.b4a.shell.ArraysUtils.getElement(ArraysUtils.java:76)
 at anywheresoftware.b4a.shell.Shell.getArrayElement(Shell.java:568)
 at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:374)
 at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
 at java.lang.reflect.Method.invoke(Native Method)
 at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
 at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:259)
 at agendame.turnos.zzutil._rtn_sendpushtohabilitador(zzutil.java:2586)
 at agendame.turnos.zzutil._rtn_catcherror(zzutil.java:412)
 at agendame.turnos.zzutil._fnc_agendaidfromnro(zzutil.java:8997)
 at agendame.turnos.zzutil._rtn_generar_userdatafile(zzutil.java:7721)
 at agendame.turnos.act_soporte._mibuttonenviarlog_click(act_soporte.java:445)
 at agendame.turnos.act_soporte._ab_btn_enviarlog_click(act_soporte.java:413)
 at java.lang.reflect.Method.invoke(Native Method)
 at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
 at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
 at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
 at java.lang.reflect.Method.invoke(Native Method)
 at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
 at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1058)
 at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:1021)
 at agendame.turnos.clsactionbar._button_click(clsactionbar.java:1290)
 at java.lang.reflect.Method.invoke(Native Method)
 at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
 at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
 at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
 at java.lang.reflect.Method.invoke(Native Method)
 at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
 at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
 at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
 at android.view.View.performClick(View.java:6294)
 at android.view.View$PerformClick.run(View.java:24770)
 at android.os.Handler.handleCallback(Handler.java:790)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loop(Looper.java:164)
 at android.app.ActivityThread.main(ActivityThread.java:6494)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
	Could it be related to permissions? Witch one?
Thanks all