I have added the permission for accessing phone_state but im still getting this exception " Caused by: java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10052 nor current process has android.permission.READ_PHONE_STATE."
<?xml version="1.0" encoding="utf-8"?>
<manifestxmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.goh2.pronoornotepad" >
<uses-permission android:name="android.permission.read_phone_state" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<application
android:allowBackup="true"
android:icon="#drawable/pronoorpng"
android:label="#string/app_name"
android:theme="#android:style/Theme.Light" >
<activity
android:name=".Login"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:theme="#style/Theme.AppCompat.Light.NoActionBar"
android:name=".MainScreen"
android:label="#string/title_activity_main_screen" >
</activity>
</application>
You must declare the permission this way:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
instead of that
<uses-permission android:name="android.permission.read_phone_state" />
Related
This is the error i get when i try to submit app to play store.
"You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher. See: developer.android.com/about/versions/12/behavior-changes-12#exported"
This is my androidmanifest.xml file, i had set android:exported to true each time, but still its throwing this error, could someone please check and see what can be done to eliminate this error, here is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.xxx.xxx">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission
android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
<application
android:name="com.xxx.xxx.AppController"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name="com.xxx.xxx.activity.SplashActivity"
android:noHistory="true"
android:theme="#style/Splash" />
<activity
android:name="com.xxx.xxx.activity.MainActivity"
android:label="">
</activity>
<activity android:name="com.xxx.xxx.activity.VPNListActivity" />
<activity
android:name="com.xxx.xxx.activity.VPNInfoActivity"
android:launchMode="singleTop" />
<activity
android:name="com.xxx.xxx.activity.SettingsActivity"
android:label="#string/action_settings"
android:noHistory="true" />
<service
android:name="de.blinkt.openvpn.core.OpenVPNService"
android:permission="android.permission.BIND_VPN_SERVICE"
android:exported="true">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
</service>
<activity
android:name="com.xxx.xxx.activity.SpeedTestActivity"
android:label="Speed Test" />
<activity
android:name="com.xxx.xxx.activity.TOSActivity"
android:theme="#style/AppTheme2" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
<activity
android:name="com.xxx.xxx.activity.StepActivity"
android:theme="#style/Splash">
</activity>
<activity android:name="com.xxx.xxx.activity.FragmentWrapperActivity" />
<activity android:name="com.xxx.xxx.activity.WelcomeActivity"
android:theme="#style/AppThemes"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="#string/admob_app_id" />
<receiver android:name="com.xxx.xxx.service.BoostAlarm" />
</application>
</manifest>
Please Note: I had set the package name to xxx.xxx. When i had submitted it to play store i submitted it with correct name.
I have an application that may or may not work with NFC. I have added these lines to manifest:
<manifest ...>
<uses-feature android:name="android.hardware.nfc" android:required="false"/>
<uses-permission android:name="android.permission.NFC" />
</manifest>
When I search for the application in google play, the message continues: "Your device is not compatible with this version"
I have verified that the NFCAdapter is not null, I have requested the pertinent permissions directly in execution ... but that message continues to come out.
APORTACION:
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.app.app">
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-feature android:name="android.hardware.nfc" android:required="false"/>
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<service
android:name=".timer.UploadService"
android:enabled="true"
android:exported="true">
</service>
<service
android:name=".services.uploaddata.ui.UploadDataService"
android:enabled="true"
android:exported="true">
</service>
<activity android:name=".main.ui.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:launchMode="singleTask"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".p1.ui.class1"
android:label="#string/title_activity_class1"
android:screenOrientation="portrait"
android:launchMode="singleTask">
</activity>
<activity
android:name=".p2.ui.class2"
android:label="#string/title_activity_class2"
android:screenOrientation="portrait"
android:theme="#style/class2ActivityTheme"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<activity
android:name=".p3.ui.class3"
android:theme="#style/AppTheme.ActionBar"
android:label="#string/title_activity_class3"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".p4.ui.class4"
android:label="#string/title_activity_class4"
android:theme="#style/AppTheme.ActionBar"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".p5.ui.class5"
android:label="#string/title_activity_class5"
android:screenOrientation="portrait">
</activity>
</application>
</manifest>
my problem is not a bad code. I waited for one to two days and the problem was solved. It is possible that google servers did not resolve the request well and took a little longer to update. I really do not know what the reason was but my app is already working :)
When built my application, the built apk is not working any other devices. It is only working in my mobile. The error message i founded is user permission is not available and security exception. It is only working in my phone.
Here is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dineshkumar.panicbutton">
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<application
android:allowBackup="true"
android:icon="#drawable/welcome"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:exported="true"
android:theme="#style/AppTheme">
<activity
android:name=".Welcome"
android:label="Panic Button"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
</activity>
<activity android:name=".Emergency" />
<activity android:name=".Contacts" />
<activity android:name=".ManualCadd" />
<activity android:name=".Message" />
<activity android:name=".Guide" />
<activity android:name=".Updatecontacts" />
<activity android:name=".ShowContacts" />
</application>
Your device should have Android 6.0 version or above to handle Runtime Permissions. Also you need to set the Target SDK version to 23 or above for listing dangerous permissions.
I am a newbie in Android development.
After build I get error in my manifest file: The markup in the document following the root element must be well-formed.
Here's the AndroidManifest.xml code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="smart.tuke.sk.makac" >
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<permission
android:name="smart.tuke.sk.makac.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name=".TrackerActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SummaryActivity"
android:label="#string/title_activity_summary" >
</activity>
</application>
</manifest>
I cannot see there any error. Thanks in advance for your help.
You have to close tag </manifest>, since Google Play Services 3.1.59 permission is now completely unnecessary, use this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="smart.tuke.sk.makac" >
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:supportsRtl="true">
<activity
android:name=".TrackerActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SummaryActivity"
android:label="#string/title_activity_summary" >
</activity>
</application>
</manifest>
Clean and Rebuild!
I'm writing a app in android studio 0.8.14(latest) and I am trying to add
<uses-permission android:name="android.permission.GET_TASKS"/>
After adding the permission I clean, rebuild and make the project but I still get error:
E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.SecurityException: Permission Denial: getTasks() from pid=6608, uid=10061 requires android.permission.GET_TASKS
Another peculiar thing is if I remove any of my current permissions(like "android.permission.WR") the app still runs fine like I didn't change a thing
Another permission that isn't working is REORDER_TASKS, but I think it will be fixed once the manifest applies permissions.
This permission doesn't require any special permission as per: https://android.googlesource.com/platform/frameworks/base/+/master/core/res/AndroidManifest.xml
Below is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="*package*" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme2">
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.REORDER_TASKS"/>
<uses-permission android:name="android.permission.WR" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<activity
android:name=".Activity_main"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="sensorLandscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks.
Put your uses-permission tag outside application tag
From Documentation:
CONTAINED IN:
<manifest>
Like this.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="*package*" >
<!-- put it here -->
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.REORDER_TASKS"/>
<uses-permission android:name="android.permission.WR" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme2">
<activity
android:name=".Activity_main"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="sensorLandscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>