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

No beacon found on Android 9 (Nokia 6.1+) #8

Open
wolfag opened this issue Nov 22, 2019 · 11 comments
Open

No beacon found on Android 9 (Nokia 6.1+) #8

wolfag opened this issue Nov 22, 2019 · 11 comments

Comments

@wolfag
Copy link

wolfag commented Nov 22, 2019

I used another phone to broacast beacon signal (Beacon Simulator). And use your example code to catch. But nothing appear on log. Please help me.
The example repo here: https://github.com/wolfag/demo_beacon

Thanks

@nicholasc
Copy link
Contributor

nicholasc commented Nov 29, 2019

Hi @wolfag,

I realized that bluetooth requires location permission and that in order to discover devices you need the bluetooth admin permission. I have gone ahead and commited changes that should fix this in master. It seems to work fine on my side. Can you test it before I got ahead and close this and publish a new version.

You'll need to add this to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Thank you!

@wolfag
Copy link
Author

wolfag commented Dec 3, 2019

I will notify you after testing.

Thank you!

@wolfag
Copy link
Author

wolfag commented Dec 4, 2019

Hi @nicholasc ,
I got this error on android:
2019-12-04 17:02:00.035 2505-2758/? E/ViewRootImpl: Accessibility content change on non-UI thread. Future Android versions will throw an exception. android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.runOrPost(ViewRootImpl.java:8428) at android.view.ViewRootImpl.postSendWindowContentChangedCallback(ViewRootImpl.java:7513) at android.view.ViewRootImpl.notifySubtreeAccessibilityStateChanged(ViewRootImpl.java:7696) at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3675) at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3675) at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3675) at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3675) at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3675) at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3675) at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3675) at android.view.View.notifyViewAccessibilityStateChangedIfNeeded(View.java:11953) at android.view.View.setContentDescription(View.java:9165) at com.android.systemui.keyguard.glance.clockstyle.AnalogClock.updateContentDescription(AnalogClock.java:255) at com.android.systemui.keyguard.glance.clockstyle.AnalogClock.onTimeChanged(AnalogClock.java:235) at com.android.systemui.keyguard.glance.clockstyle.AnalogClock.access$200(AnalogClock.java:47) at com.android.systemui.keyguard.glance.clockstyle.AnalogClock$1.onReceive(AnalogClock.java:245) at com.android.systemui.fih.utils.SystemUIUpdateMonitor$5.run(SystemUIUpdateMonitor.java:1423) at android.os.Handler.handleCallback(Handler.java:874) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:198) at android.os.HandlerThread.run(HandlerThread.java:65)

2019-12-04 17:02:00.490 28092-28158/com.transistorsoft.backgroundgeolocation.react E/olocation.reac: No implementation found for com.facebook.react.bridge.Inspector com.facebook.react.bridge.Inspector.instance() (tried Java_com_facebook_react_bridge_Inspector_instance and Java_com_facebook_react_bridge_Inspector_instance__) 2019-12-04 17:02:00.496 28092-28158/com.transistorsoft.backgroundgeolocation.react E/unknown:ReactNative: Inspector doesn't work in open source yet java.lang.UnsatisfiedLinkError: No implementation found for com.facebook.react.bridge.Inspector com.facebook.react.bridge.Inspector.instance() (tried Java_com_facebook_react_bridge_Inspector_instance and Java_com_facebook_react_bridge_Inspector_instance__) at com.facebook.react.bridge.Inspector.instance(Native Method) at com.facebook.react.bridge.Inspector.getPages(Inspector.java:27) at com.facebook.react.devsupport.InspectorPackagerConnection.getPages(InspectorPackagerConnection.java:152) at com.facebook.react.devsupport.InspectorPackagerConnection.handleProxyMessage(InspectorPackagerConnection.java:72) at com.facebook.react.devsupport.InspectorPackagerConnection$Connection.onMessage(InspectorPackagerConnection.java:223) at okhttp3.internal.ws.RealWebSocket.onReadMessage(RealWebSocket.java:323) at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:219) at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:105) at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:274) at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:214) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:206) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)

Please help me.
Thank you.

@nicholasc
Copy link
Contributor

Hey @wolfag,

I'm afraid I cannot be much help debugging this since the error you are getting does not seem to be related to the Eddystone library and I do not possess a Nokia 6.1+.

If you google No implementation found for com.facebook.react.bridge.Inspector, you should be able to find several helpful links such as this one or this one.

Hope that helps!

@pm5
Copy link

pm5 commented Sep 22, 2020

Hello. I bumped into the same problem on Android 10 (Pixel 3a). These are the steps I took:

  1. Clone https://github.com/wolfag/demo_beacon
  2. Add permission per No beacon found on Android 9 (Nokia 6.1+) #8 (comment)
  3. Run demo_beacon and being asked to allow Location permission; allow only while app is in use.
  4. Nothing appears on the log.

I didn't see the error in #8 (comment) so that might be caused by other issues.

@pm5
Copy link

pm5 commented Sep 22, 2020

Oh, but it works on another demo app I made previously. Apparently that demo app was explicitly forbidden to use Location, maybe some time ago. Once I changed its Location permission it starts working.

@JaioSkura
Copy link

Hi! I added permissions in manifest but still can't scan beacons. Is there anything else I must do?

@gaurav-naik
Copy link

@JaioSkura

Ensure that your AndroidManifest.xml has the following permissions

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

If your phone is running Android 10, the ACCESS_FINE_LOCATION must be included.

@JaioSkura
Copy link

Thanks for the response @gaurav-naik . I have that in android manifest, but I don't can't get any result on scan. If I download compileSdkVersion to 28 it works perfect, but with 29 or 30 doesn't. Any help?
By the way, does this app require all those permissions because of something? I only want to find beacons in foreground, so with ACCESS_COARSE_LOCATION should be enought, isn't it?
I am using other bluetooth libraries in other project and work right with only COARSE, for foreground.
Any clue of what is happening here?

@feerposser
Copy link

Same issue here. No beacons showing in the logs.
RN: 0.63.3
All permissions set

@feerposser
Copy link

I solved the problem!
Talking with a friend from master degree I realize that the project need to ask explicity permission to the user. I just get the docs from RN (https://reactnative.dev/docs/permissionsandroid) and set the ACCESS_FINE_LOCATION on my constructor and everything runs fine (:

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

6 participants