简体   繁体   English

从Android开发人员编写示例应用程序时未授予蓝牙权限

[英]No Bluetooth permissions granted when coding the example app from Android developer

Sorry, that questions sound stupid but drives me crazy. 抱歉,这个问题听起来很愚蠢,但却使我发疯。 I'm about implementing an app very similar to the Bluetooth App described in Developer Android. 我打算实现与开发人员Android中所述的蓝牙应用程序非常相似的应用程序。

I don't get required permissions, though. 不过,我没有获得所需的权限。

Yes, I ask for permission twice a) in my manifest 是的,我两次在清单中请求许可

b) and I check before using BT with ActivityCompat.requestPermissions(..) b)我在将BT与ActivityCompat.requestPermissions(..)一起使用之前进行检查

In logcat, see belove, I learn that my app doesn't get Bluetooth permission. 在logcat中,请见亲爱的,我了解到我的应用未获得蓝牙许可。

It isn't the first time I write a BT app. 这不是我第一次编写BT应用程序。 LAst time it was fine. 上次很好。 But was a while ago. 但是前一阵子。

My mobile (Nexus 5) told me something about Development Mode Active and apps would be routed to Developer Manager to be started as instant app. 我的手机(Nexus 5)告诉我一些有关“开发模式有效”的信息,应用程序将被路由到Developer Manager以作为即时应用程序启动。

I also learned that Bluetooth access is not granted to instant apps at all. 我还了解到,根本没有将蓝牙访问权限授予即时应用程序。 (I understand that.). (我明白那个。)。

Could that be the problem? 这可能是问题吗? Does Android Studio produce different apps now. Android Studio现在会产生不同的应用程序吗? Does it interact in a different manager with the test hardware? 它是否可以在其他管理器中与测试硬件交互?

If so, how do I pursuade Android Studio to not produce an instant app? 如果是这样,我该如何追求Android Studio 产生即时应用程序?

Thank you so much in advance. 提前非常感谢您。

my manifest code
<uses-permission android:name="android.permission.BLUETOOTH" />
   <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

Log output:
android.permission.BLUETOOTH: denied

and some lines earlier

I/ActivityManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.packageinstaller cmp=com.google.android.instantapps.supervisor/.permissions.GrantPermissionsTrampoline (has extras)} from uid 10029 on display 0
W/Isotope: UID: [10029]  PID: [14812] GrantPermissionsTrampoline : Permission not allowed: android.permission.BLUETOOTH

Sorry for bothering you... It was so easy. 抱歉打扰您了...太简单了。 I have just deactivated that instant apps dev manager on my Android phone. 我刚刚停用了Android手机上的即时应用开发经理。

Voila, my app is an app again and no instant app. 瞧,我的应用还是一个应用,没有即时应用。 It gets all permissions it need. 它获得了所需的所有权限。 Anything is fine. 一切都很好。

I'm sorry again. 再次对不起

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM