Closed bqkhiem96 closed 6 years ago
You are probably running on an emulator or device that doesn't have Bluetooth. That is why it is throwing this error as it can't get its name. If you have no way around it, and wish to get rid of Bluetooth support altogether this is a quick fix
For android: Edit this file: ./node_modules/react-native-bluetooth-cross-platform/android/src/main/java/com/rctunderdark/NetworkCommunicator.java
At line 25, replace:
private String displayName = BluetoothAdapter.getDefaultAdapter().getName();
by whatever name:
private String displayName = "Whatever"
This will fix the error, but disable bluetooth. Or better yet, try...catch
to see if Bluetooth is available then get its name
The same procedure should work for IOS, even though I have never tried it. Hope it helps.
thank you for the solution, I'm closing this issue for now
How may the issue got resolved?![image](https://user-images.githubusercontent.com/17524678/34468679-bb69aabc-ef40-11e7-8319-d2fad5ce856f.png)