Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Android during scan #292

Closed
alfacommunication-alessandro opened this issue Jun 19, 2018 · 3 comments
Closed

Crash on Android during scan #292

alfacommunication-alessandro opened this issue Jun 19, 2018 · 3 comments

Comments

@alfacommunication-alessandro
Copy link

alfacommunication-alessandro commented Jun 19, 2018

Hi.
Start a device scan make my application always crash with following stacktrace.

My test device is an Huawei Y6 2018 with Android 8.

java.lang.NoSuchMethodError: No virtual method position(I)Ljava/nio/ByteBuffer; in class Ljava/nio/ByteBuffer; or its super classes (declaration of 'java.nio.ByteBuffer' appears in /system/framework/core-oj.jar)
        at com.polidea.reactnativeble.advertisement.AdvertisementData.parseScanResponseData(AdvertisementData.java:57)
        at com.polidea.reactnativeble.converter.RxBleScanResultConverter.toJSObject(RxBleScanResultConverter.java:43)
        at com.polidea.reactnativeble.converter.RxBleScanResultConverter.toJSObject(RxBleScanResultConverter.java:17)
        at com.polidea.reactnativeble.converter.JSObjectConverter.toJSCallback(JSObjectConverter.java:14)
        at com.polidea.reactnativeble.BleModule$3.call(BleModule.java:294)
        at com.polidea.reactnativeble.BleModule$3.call(BleModule.java:287)
        at rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39)
        at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134)
        at rx.observers.Subscribers$5.onNext(Subscribers.java:235)
        at rx.internal.operators.OnSubscribeRefCount$2.onNext(OnSubscribeRefCount.java:120)
        at rx.internal.operators.OperatorPublish$PublishSubscriber.dispatch(OperatorPublish.java:585)
        at rx.internal.operators.OperatorPublish$PublishSubscriber.onNext(OperatorPublish.java:283)
        at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
        at rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:395)
        at rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:355)
        at rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:846)
        at rx.observers.Subscribers$5.onNext(Subscribers.java:235)
        at rx.internal.operators.OnSubscribeCreate$NoneEmitter.onNext(OnSubscribeCreate.java:173)
        at rx.internal.util.ObserverSubscriber.onNext(ObserverSubscriber.java:34)
        at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134)
        at rx.internal.operators.OperatorUnsubscribeOn$1.onNext(OperatorUnsubscribeOn.java:52)
        at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.onNext(OperatorSubscribeOn.java:74)
        at rx.internal.operators.OnSubscribeCreate$NoneEmitter.onNext(OnSubscribeCreate.java:173)
        at com.polidea.rxandroidble.internal.operations.LegacyScanOperation$1.onLeScan(LegacyScanOperation.java:40)
        at android.bluetooth.BluetoothAdapter$2.onScanResult(BluetoothAdapter.java:2540)
        at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run(BluetoothLeScanner.java:535)
        at android.os.Handler.handleCallback(Handler.java:808)
        at android.os.Handler.dispatchMessage(Handler.java:101)
        at android.os.Looper.loop(Looper.java:166)
        at android.app.ActivityThread.main(ActivityThread.java:7425)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

Environment

  OS: macOS High Sierra 10.13.5
  Node: 9.11.1
  Yarn: 1.7.0
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.4 Build version 9F1027a
  Android Studio: 3.1 AI-173.4819257

Packages: (wanted => installed)
  react: ^16.3.2 => 16.4.1
  react-native: 0.55.4 => 0.55.4
@dariuszseweryn
Copy link
Collaborator

What JDK you used to build the app? JDK9?

@alfacommunication-alessandro
Copy link
Author

What JDK you used to build the app? JDK9?

Yes, switch back to jdk8 resolve the issue.
Thanks

@gre
Copy link

gre commented Nov 28, 2018

falling into this as well, is there a way we can make the code works everywhere? (idk why this is closed, the bug is still legit @alfacommunication-alessandro )

similar crash here and it was suggested to use casting: plasma-umass/doppio#497 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants