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

BLUETOOTH permission is listed as optional in docs but seems to be required #424

Closed
agramian opened this issue Feb 2, 2017 · 22 comments · Fixed by #499
Closed

BLUETOOTH permission is listed as optional in docs but seems to be required #424

agramian opened this issue Feb 2, 2017 · 22 comments · Fixed by #499

Comments

@agramian
Copy link

agramian commented Feb 2, 2017

The Android setup docs under Step 2 - Add permissions to your AndroidManifest.xml: list the BLUETOOTH permission as optional but I am seeing a consistent crash for at least a Samsung SM-925T. I have not tested enough to determine if this is device specific but either way it should not happen. It causes our app to go into a crash/restart cycle of sometimes more than 10 times.

02-02 10:09:11.688 13384-13405/? E/BluetoothAdapter: Application does not have bluetooth permission, registering is failed
02-02 10:09:11.688 13384-13405/? E/BluetoothAdapter: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10348 nor current process has android.permission.BLUETOOTH.
                                                         at android.os.Parcel.readException(Parcel.java:1620)
                                                         at android.os.Parcel.readException(Parcel.java:1573)
                                                         at android.bluetooth.IBluetoothManager$Stub$Proxy.registerStateChangeCallback(IBluetoothManager.java:350)
                                                         at android.bluetooth.BluetoothAdapter.<init>(BluetoothAdapter.java:594)
                                                         at android.bluetooth.BluetoothAdapter.getDefaultAdapter(BluetoothAdapter.java:576)
                                                         at com.mixpanel.android.mpmetrics.SystemInformation.isBluetoothEnabled(SystemInformation.java:141)
                                                         at com.mixpanel.android.mpmetrics.AnalyticsMessages$Worker$AnalyticsMessageHandler.getDefaultEventProperties(AnalyticsMessages.java:559)
                                                         at com.mixpanel.android.mpmetrics.AnalyticsMessages$Worker$AnalyticsMessageHandler.prepareEventObject(AnalyticsMessages.java:573)
                                                         at com.mixpanel.android.mpmetrics.AnalyticsMessages$Worker$AnalyticsMessageHandler.handleMessage(AnalyticsMessages.java:251)
                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                         at android.os.Looper.loop(Looper.java:158)
                                                         at android.os.HandlerThread.run(HandlerThread.java:61)
@patedit
Copy link
Contributor

patedit commented Feb 6, 2017

Hi @agramian ! Thanks for reporting this. What's the SDK Version that you are using? Also, have you modified the library somehow?

Thanks!

@agramian
Copy link
Author

agramian commented Feb 6, 2017

Hi @patedit no I have not modified the library at all. I'm using it exactly as your docs instruct. Here's the info from my gradle file.

    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 25
...
    compile "com.mixpanel.android:mixpanel-android:4.9.3"

@RockyLin
Copy link

RockyLin commented Feb 19, 2017

+1 same problem
mixpanel

@edenman
Copy link

edenman commented Mar 2, 2017

What's slightly crazy about this is that there's already this in SystemInformation.isBluetoothEnabled():

        } catch (SecurityException e) {
            // do nothing since we don't have permissions
        }

I can't figure out from the stacktrace how the app would be crashing on a SecurityException from the getDefaultAdapter() call

@patedit
Copy link
Contributor

patedit commented Mar 2, 2017

Hehe, I know. This crash is pretty crazy (hence my interest of including the permission in the AndroidManifest.xml). I suspect it's an OEM implementation that I'd need to dig into.

@ghost
Copy link

ghost commented Apr 6, 2017

+1 similar issue:
I get the same error message every time i open the app. But it does not crash at least.

Still.. it looks wierd to see error output in my logcat every time I open the app..

@aliamohsin
Copy link

same here on android N samsung device s8

05-04 08:04:41.778 12607-12634/com.sample.airwatchsdk E/BluetoothAdapter: Application does not have bluetooth permission, registering is failed
05-04 08:04:41.781 12607-12634/com.sample.airwatchsdk E/BluetoothAdapter: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10201 nor current process has android.permission.BLUETOOTH.
at android.os.Parcel.readException(Parcel.java:1693)
at android.os.Parcel.readException(Parcel.java:1646)
at android.bluetooth.IBluetoothManager$Stub$Proxy.registerStateChangeCallback(IBluetoothManager.java:375)
at android.bluetooth.BluetoothAdapter.(BluetoothAdapter.java:640)
at android.bluetooth.BluetoothAdapter.getDefaultAdapter(BluetoothAdapter.java:621)
at com.mixpanel.android.mpmetrics.SystemInformation.isBluetoothEnabled(SystemInformation.java:144)
at com.mixpanel.android.mpmetrics.AnalyticsMessages$Worker$AnalyticsMessageHandler.getDefaultEventProperties(AnalyticsMessages.java:553)
at com.mixpanel.android.mpmetrics.AnalyticsMessages$Worker$AnalyticsMessageHandler.prepareEventObject(AnalyticsMessages.java:567)
at com.mixpanel.android.mpmetrics.AnalyticsMessages$Worker$AnalyticsMessageHandler.handleMessage(AnalyticsMessages.java:247)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)

@victor5171
Copy link

victor5171 commented Jul 28, 2017

I'm having this error too:

07-28 09:24:52.657 12893-13502/br.com.sltalk E/BluetoothAdapter: Application does not have bluetooth permission, registering is failed
07-28 09:24:52.657 12893-13502/br.com.sltalk E/BluetoothAdapter: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10529 nor current process has android.permission.BLUETOOTH.
at android.os.Parcel.readException(Parcel.java:1620)
at android.os.Parcel.readException(Parcel.java:1573)
at android.bluetooth.IBluetoothManager$Stub$Proxy.registerStateChangeCallback(IBluetoothManager.java:358)
at android.bluetooth.BluetoothAdapter.(BluetoothAdapter.java:598)
at android.bluetooth.BluetoothAdapter.getDefaultAdapter(BluetoothAdapter.java:580)
at com.mixpanel.android.mpmetrics.SystemInformation.isBluetoothEnabled(SystemInformation.java:144)
at com.mixpanel.android.mpmetrics.AnalyticsMessages$Worker$AnalyticsMessageHandler.getDefaultEventProperties(AnalyticsMessages.java:620)
at com.mixpanel.android.mpmetrics.AnalyticsMessages$Worker$AnalyticsMessageHandler.prepareEventObject(AnalyticsMessages.java:634)
at com.mixpanel.android.mpmetrics.AnalyticsMessages$Worker$AnalyticsMessageHandler.handleMessage(AnalyticsMessages.java:294)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)

                                                             [ 07-28 09:24:52.667 12893:12893 W/         ]
                                                             Unable to open '/system/framework/qcom.fmradio.jar': No such file or directory

Used SDK version: "com.mixpanel.android:mixpanel-android:5.1.4"

Any updates on this issue?

@patedit
Copy link
Contributor

patedit commented Aug 12, 2017

guys, could you kindly tell me what are the devices you are seeing this issue on and their android version? thanks!

@RockyLin
Copy link

RockyLin commented Aug 14, 2017

@patedit Samsung s7 Edge
Android 7.0

@aidinism
Copy link

same issue on S6 EDGE and S7 EDGE

@patedit
Copy link
Contributor

patedit commented Aug 15, 2017

what about the android version? is it only happening on N? Do you guys see something in common with all the devices? thanks!

@aidinism
Copy link

Android API 7.0

@aidinism
Copy link

both devices

@eladkatz
Copy link

Same here, on galaxy s7 edge

@houssemzaier
Copy link

It seems like this bug is still not solved yet.
@patedit ,@Mixplanel can you please resolve the problem ASAP...
We don't really want to have a BLUETOOTH permission in our manifest ..requesting this is really permission so bad for the UX..

@dementia2029
Copy link

dementia2029 commented Sep 21, 2017

I cant even download my app from play store from emulator because emulators do not have bluetooth!!! FIX IT

@patedit
Copy link
Contributor

patedit commented Sep 22, 2017

@dementia2029 Sorry, I am not sure I understand your problem. Whether you can or can't download your app from Google Play seems unrelated to this issue. Feel free to add more details!

Guys, hopefully this PR will solve your issue #499 I'll make a release today!

@adin234
Copy link

adin234 commented Nov 15, 2017

@patedit we can't download a released app (with mixpanel) from google play to our emulator because mixpanel requires bluetooth, if the device doesn't have bluetooth then the app wont show up in google play.

@levibostian
Copy link

@adin234 because of this pull request Mixpanel no longer requires bluetooth. If you would like to remove the need from your manifest, make a release, and try installing on an emulator again, you may do so.

@adin234
Copy link

adin234 commented Nov 15, 2017

@levibostian i just explained to @patedit why this issue and the app not being downloadable from the store and an emulator are related

@patedit
Copy link
Contributor

patedit commented Nov 15, 2017

Thanks for the clarification @adin234 ! And nice profile pic 👨‍💻

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

Successfully merging a pull request may close this issue.