{"action":"created","issue":{"url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/115","repository_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le","labels_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/115/comments","events_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/115/events","html_url":"https://github.com/xabre/xamarin-bluetooth-le/issues/115","id":190483812,"number":115,"title":"ICharacteristic.WriteAsync(byte[])   Error on Android 5.0.1 ","user":{"login":"huyusong","id":8465319,"avatar_url":"https://avatars.githubusercontent.com/u/8465319?v=3","gravatar_id":"","url":"https://api.github.com/users/huyusong","html_url":"https://github.com/huyusong","followers_url":"https://api.github.com/users/huyusong/followers","following_url":"https://api.github.com/users/huyusong/following{/other_user}","gists_url":"https://api.github.com/users/huyusong/gists{/gist_id}","starred_url":"https://api.github.com/users/huyusong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huyusong/subscriptions","organizations_url":"https://api.github.com/users/huyusong/orgs","repos_url":"https://api.github.com/users/huyusong/repos","events_url":"https://api.github.com/users/huyusong/events{/privacy}","received_events_url":"https://api.github.com/users/huyusong/received_events","type":"User","site_admin":false},"labels":[{"id":258738157,"url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":400950192,"url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/labels/needs%20investigation","name":"needs investigation","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-19T08:08:53Z","updated_at":"2016-11-24T19:25:45Z","closed_at":null,"body":"Caused by: android.runtime.JavaProxyThrowable: Plugin.BLE.Abstractions.Exceptions.CharacteristicReadException: Gatt write characteristic FAILED.\r\n  at Plugin.BLE.Android.Characteristic.InternalWrite (System.Byte[] data) [0x00054] in <5d0080769b114fa0ac55d0d5e8f42614>:0 \r\n  at Plugin.BLE.Android.Characteristic+<>c__DisplayClass19_0.<WriteNativeAsync>b__0 () [0x00000] in <5d0080769b114fa0ac55d0d5e8f42614>:0 \r\n  at Plugin.BLE.Abstractions.Utils.TaskBuilder+<FromEvent>d__1`3[TReturn,TEventHandler,TRejectHandler].MoveNext () [0x000b3] in <17233c4b6076471cb4183230850d0bba>:0 \r\n--- End of stack trace from previous location where exception was thrown ---\r\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at Plugin.BLE.Android.Characteristic+<WriteNativeAsync>d__19.MoveNext () [0x000dc] in <5d0080769b114fa0ac55d0d5e8f42614>:0 \r\n--- End of stack trace from previous location where exception was thrown ---\r\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at Plugin.BLE.Abstractions.CharacteristicBase+<WriteAsync>d__27.MoveNext () [0x000b1] in <17233c4b6076471cb4183230850d0bba>:0 \r\n--- End of stack trace from previous location where exception was thrown ---\r\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at WeatherMonitor.PageTab+<SendToDevice>d__18.MoveNext () [0x00072] in <939c423dfe1e41988295c028824d3434>:0 \r\n--- End of stack trace from previous location where exception was thrown ---\r\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (System.Object state) [0x00000] in <a709efbb17bf4aa7b8d27ea8973c7f4c>:0 \r\n  at Android.App.SyncContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in <b56096d9aca04f2d9c2570e7f66fd957>:0 \r\n  at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in <b56096d9aca04f2d9c2570e7f66fd957>:0 \r\n  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <b56096d9aca04f2d9c2570e7f66fd957>:0 \r\n  at (wrapper dynamic-method) System.Object:1b37c8f1-1a72-4a48-8432-f868d2c67885 (intptr,intptr)\r\n\tat mono.java.lang.RunnableImplementor.n_run(Native Method)\r\n\tat mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)\r\n\tat android.os.Handler.handleCallback(Handler.java:815)\r\n\tat android.os.Handler.dispatchMessage(Handler.java:104)\r\n\tat android.os.Looper.loop(Looper.java:194)\r\n\tat android.app.ActivityThread.main(ActivityThread.java:5572)\r\n\t... 4 more\r\njava.lang.reflect.InvocationTargetException\r\n\tat java.lang.reflect.Method.invoke(Native Method)\r\n\tat java.lang.reflect.Method.invoke(Method.java:372)\r\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:966)\r\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)"},"comment":{"url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/comments/262835017","html_url":"https://github.com/xabre/xamarin-bluetooth-le/issues/115#issuecomment-262835017","issue_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/115","id":262835017,"user":{"login":"xabre","id":6204446,"avatar_url":"https://avatars.githubusercontent.com/u/6204446?v=3","gravatar_id":"","url":"https://api.github.com/users/xabre","html_url":"https://github.com/xabre","followers_url":"https://api.github.com/users/xabre/followers","following_url":"https://api.github.com/users/xabre/following{/other_user}","gists_url":"https://api.github.com/users/xabre/gists{/gist_id}","starred_url":"https://api.github.com/users/xabre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xabre/subscriptions","organizations_url":"https://api.github.com/users/xabre/orgs","repos_url":"https://api.github.com/users/xabre/repos","events_url":"https://api.github.com/users/xabre/events{/privacy}","received_events_url":"https://api.github.com/users/xabre/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T19:25:45Z","updated_at":"2016-11-24T19:25:45Z","body":"Xamarin.Forms.Device.BeginInvokeOnMainThread should be enough to workaround this issue. If WriteAsync still fails it means that the main thread is not the problem... Usually when, you call Read/Write as a resoult of the user interacting with the UI it's already on the main thread.... "}}
{"actor":{"display_login":"xabre"}}