problem with react component on Android 6
Hello,
I programmed the board to turn on the LED when angular speed goes above a threshold. This is the code:
12-29 16:56:49.545 10800-10800/it.beonsolutions.rehab_home I/DATA_STREAM: setupLedActivation started
12-29 16:56:50.002 10800-10968/it.beonsolutions.rehab_home E/DATA_STREAM: Error setting up route
java.util.concurrent.TimeoutException: Creating data processor timed out
at com.mbientlab.metawear.impl.DataProcessorImpl$1.run(DataProcessorImpl.java:129)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
12-29 16:56:50.035 10800-11346/it.beonsolutions.rehab_home W/BluetoothGatt: Unhandled exception in callback
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.Queue.poll()' on a null object reference
at com.mbientlab.metawear.impl.DataProcessorImpl$2.onResponseReceived(DataProcessorImpl.java:138)
at com.mbientlab.metawear.impl.JseMetaWearBoard$5.onMwNotifyCharChanged(JseMetaWearBoard.java:579)
at com.mbientlab.metawear.android.BtleService$1.onCharacteristicChanged(BtleService.java:193)
at android.bluetooth.BluetoothGatt$1.onNotify(BluetoothGatt.java:487)
at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:399)
at android.os.Binder.execTransact(Binder.java:458)
Any help would be much appreciated.
Regards
I programmed the board to turn on the LED when angular speed goes above a threshold. This is the code:
Log.i(LOG_DATA_STREAM, "setupLedActivation started");This works fine in Android 4.4, but on a different device with Android 6.0 it fails, with the following output in the Android Monitor:
gyro.angularVelocity().addRouteAsync(new RouteBuilder() {
@Override
public void configure(RouteComponent source) {
//source.split().index(0).filter(ThresholdOutput.ABSOLUTE,minAngularSpeed,1f).react(new RouteComponent.Action() {
source.split().index(0).average((byte)3)
.map(Function1.ABS_VALUE)
.filter(ThresholdOutput.BINARY, minAngularSpeed, 10)
.multicast()
.to()
.filter(Comparison.EQ, 1)
.react(new RouteComponent.Action() {
@Override
public void execute(DataToken token) {
led.editPattern(Led.Color.GREEN, Led.PatternPreset.SOLID).commit();
led.play();
}
})
.to().filter(Comparison.EQ, -1)
.react(new RouteComponent.Action() {
@Override
public void execute(DataToken token) {
led.stop(true);
}
});
}
}).continueWith(
new Continuation<Route, Void>() {
@Override
public Void then(Task<Route> task) throws Exception {
if (task.isFaulted()) {
Log.e(LOG_DATA_STREAM, metawear.isConnected() ? "Error setting up route" : "Error connecting", task.getError());
} else {
Log.i(LOG_DATA_STREAM, "setupLedActivation done");
onBoardRoute = task.getResult();
//debug = mwBoard.getModule(Debug.class);
//logging= mwBoard.getModule(Logging.class);
}
return null;
}
}
);
12-29 16:56:49.545 10800-10800/it.beonsolutions.rehab_home I/DATA_STREAM: setupLedActivation started
12-29 16:56:50.002 10800-10968/it.beonsolutions.rehab_home E/DATA_STREAM: Error setting up route
java.util.concurrent.TimeoutException: Creating data processor timed out
at com.mbientlab.metawear.impl.DataProcessorImpl$1.run(DataProcessorImpl.java:129)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
12-29 16:56:50.035 10800-11346/it.beonsolutions.rehab_home W/BluetoothGatt: Unhandled exception in callback
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.Queue.poll()' on a null object reference
at com.mbientlab.metawear.impl.DataProcessorImpl$2.onResponseReceived(DataProcessorImpl.java:138)
at com.mbientlab.metawear.impl.JseMetaWearBoard$5.onMwNotifyCharChanged(JseMetaWearBoard.java:579)
at com.mbientlab.metawear.android.BtleService$1.onCharacteristicChanged(BtleService.java:193)
at android.bluetooth.BluetoothGatt$1.onNotify(BluetoothGatt.java:487)
at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:399)
at android.os.Binder.execTransact(Binder.java:458)
Any help would be much appreciated.
Regards
This discussion has been closed.
Comments
for the board information, please see this screenshot:
https://www.dropbox.com/s/ftx6ysedj7h3mxl/Screenshot_2018-01-03-10-00-08.png?dl=0
Android device: Lenovo TB3-730X
Thanks & Regards
Luca
Is there anything to do to understand the issue with the Lenovo tablet?
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
I tried to follow the suggested solution but then other issues arise. Please give the correct project setup for 3.3.0.
Thanks and Regards
Thanks!