Android蓝牙权限例外

Android蓝牙权限例外,android,android-manifest,android-bluetooth,Android,Android Manifest,Android Bluetooth,在我的蓝牙应用程序中,我遇到了以下例外情况:任何人都可以帮助解决这个问题 08-29 13:07:08.370:E/DatabaseUtils(31342): java.lang.SecurityException:权限 拒绝:写入com.android.bluetooth.opp.bluetoothopp提供商uri content://com.android.bluetooth.opp/btopp 从pid=9760,uid=10110 需要android.permission.ACCESS

在我的蓝牙应用程序中,我遇到了以下例外情况:任何人都可以帮助解决这个问题

08-29 13:07:08.370:E/DatabaseUtils(31342): java.lang.SecurityException:权限 拒绝:写入com.android.bluetooth.opp.bluetoothopp提供商uri content://com.android.bluetooth.opp/btopp 从pid=9760,uid=10110 需要android.permission.ACCESS\u BLUETOOTH\u共享,或 授予许可证()

我的清单文件是

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="process.bluetooth.sendfile"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk android:minSdkVersion="7"
    android:maxSdkVersion="17"
    android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.BLUETOOTH" android:label="BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

<permission android:name="android.permission.ACCESS_BLUETOOTH_SHARE"
    android:protectionLevel="signature" />

<application android:icon="@drawable/bluetooth" 
    android:label="@string/app_name"
    android:allowBackup="true">
    <activity android:name="process.bluetooth.sendfile.SendFileActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>


如果您尝试在Android 4.1或更高版本上使用它,那么直接向内容提供商写入的权限现在受到“已签名”的保护,这意味着您必须使用与签署蓝牙应用程序相同的密钥来签署应用程序


资料来源对几乎类似问题的回答。有关解决方案,请参阅链接

我没有使用那种意图类型,我使用的是bluetoothShare类来发送文件。你提到的答案是完美的,我已经做到了。我也在使用android 2.3和4.3