neither user or current process has android.permission.BLUETOOTH - android

I have a simple app that so far just turns bluetooth on/off, when i run it on emulator or on a nexus 7 it says my app has stopped responding and then closes itself upon launch.
I tried adding an onStart() method since that fixed this issue in a similar question, adding the intent that gets users permission and switching around various things to different methods, still crashing however.
Logcat has these messages:
07-29 01:05:41.541: E/AndroidRuntime(9745): FATAL EXCEPTION: main
07-29 01:05:41.541: E/AndroidRuntime(9745): java.lang.RuntimeException: Unable to start activity ComponentInfo{mypackagename/mmypackagename.MainActivity}: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10067 nor current process has android.permission.BLUETOOTH.
Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mypackagename"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature android:name="android.hardware.bluetooth" android:required="true" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BlUETOOTH"/>
<uses-sdk
android:minSdkVersion="5"
android:targetSdkVersion="16" />
<application
android:icon="#drawable/homeiconsmall"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:launchMode="singleTask"
android:alwaysRetainTaskState="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

You misspelled the permission in your manifest (BlUE != BLUE):
<uses-permission android:name="android.permission.BlUETOOTH"/>

Related

Android Permission: App crashes needing bluetooth permission

I was recently creating an app that uses bluetooth. The problem is my app crashes when ever I start the bluetooth service. Here's my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.petalappstudio.fit" >
<uses-permission android:name="ANDROID.PERMISSION.BLUETOOTH"/>
<uses-permission android:name="ANDROID.PERMISSION.BLUETOOTH_ADMIN"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".bluetoothManager"
android:enabled="true"
android:exported="true">
</service>
</application>
Now as you can see I have added permission for bluetooth and bluetooth admin.
How ever my app crashes and in LOGCAT the error is
"java.lang.RuntimeException: Unable to start service " and is caused by
"java.lang.SecurityException: Need BLUETOOTH ADMIN permission: Neither user 10145 nor current process has android.permission.BLUETOOTH_ADMIN."
But I have added permission as you can see. Now why is this happening ?
Try to add one more permission :
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Refe. : Android Permission BLUETOOTH Manifest error
Note : also check device support Bluetooth feature or not using :
<uses-feature android:name="android.hardware.bluetooth" android:required="true" />

Error: Activity class {} does not exist

My application launches well both on Nexus 7 and Nook Tablet, but doesn't start on Kindle Fire with the following error:
Error: Activity class {com.js.pathoflight/com.js.pathoflight.JSNativeActivity} does not exist.
Here is my manifest complete:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.js.pathoflight"
android:versionCode="3"
android:versionName="0.8.3">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:allowBackup="true"
android:hasCode="true" >
<activity android:name=".JSNativeActivity"
android:label="#string/app_name"
android:configChanges="orientation|keyboardHidden"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
<meta-data android:name="android.app.lib_name"
android:value="PathOfLight" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
It seems like a device issue, but I have another (similar) application which runs on the same device well.
How can I solve it?
The real problem was that there were another application with the same package name on device (I tried a sample and gave it my real app package name)! When I removed it everything became working right!

Android bluetooth permission exception

In my bluetooth application i got the below exception anyone can help to solve this.
08-29 13:07:08.370: E/DatabaseUtils(31342):
java.lang.SecurityException: Permission
Denial: writing com.android.bluetooth.opp.BluetoothOppProvider uri
content://com.android.bluetooth.opp/btopp from pid=9760, uid=10110
requires android.permission.ACCESS_BLUETOOTH_SHARE, or
grantUriPermission()
My manifest file is
<?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>
if you are trying it for Android 4.1 or above, then the permission to write directly to the content provider is now protected with "signed" meaning you would have to sign your app with the same key used to sign the bluetooth app.
Source this answer on almost similar question Android bluetooth print stopped working on 4.1 . See link for solution.

Package Installer has stopped

I am developing some app for android which worked well untill this evening.
However the app is working well in emulator but on Archos 80 G9 tablet with android 3.2.80 I got this error
The application Package installer (process com.android.packageinstaller) has stopped unexpectedly. Please try again.
Also here is my manifest XML
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="oni.dani"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="13"
/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:debuggable="true"
>
<activity
android:label="#string/app_name"
android:screenOrientation="portrait"
android:name="com.android.onidani.Dashboard" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.android.onidani.KlasaPrikazBaze"></activity>
<activity android:name="com.android.onidani.Dashboard"></activity>
<activity android:name="com.android.onidani.OniDaniActivity"></activity>
</application>
</manifest>
This error is occuring because you have declared your Dashboard activity twice.
<activity android:name="com.android.onidani.Dashboard"></activity>
You should add permission declaration in your manifest file. E.g
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
error: 'unfortunately package installer has stopped'. This happens when application needs permissions like location, phone call, Read external storage, write external storage etc. If permission is not defined in the manifest file then i get this kind of error message.
Add permission in manifest file according to your need
i need read/write file so i added below permission (outside of application)
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
in my situation i was passing empty array to requestPermissions. so check if your array is'not empty (String[] permissions)

Service failing to run because of "Permission Denial", permission required is null

My program has been running fine, but I think I must have accidentally changed something I shouldn't have done. I had my program running "UpdateService" on the press of a button, but now it doesn't run, and debug brings up the following two lines:
01-05 21:43:39.945: WARN/ActivityManager(98): Permission denied: checkComponentPermission() reqUid=10084
01-05 21:43:39.955: WARN/ActivityManager(98): Permission Denial: Accessing service ComponentInfo{com.android.datausagemonitor/com.android.datausagemonitor.UpdateService} from pid=98, uid=1000 requires null
Here is my manifest, judging by similar posts it could well be a problem with this, but I can't see it and am pretty sure I haven't changed anything since it was last working:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.datausagemonitor"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
<uses-permission android:name="android.permission.READ_SMS"></uses-permission>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".DataUsageMonitorActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.android.datausagemonitor.UpdateService"></service>
<service android:name="com.android.datausagemonitor.ResetService"></service>
</application>
[Solved] There was some problem with the Uid between Eclipse and the device I was testing on. Rebooting the device solved the problem.

Categories

Resources