Internet permission in Android app not granted - android

I'm trying to use ACRA in my project but whenever my app launches, I see the following message in the log.
E/ACRA (11618): com.example.TestApp should be granted permission android.permission.INTERNET if you want your crash reports to be sent. If you don't want to add this permission to your application you can also enable sending reports by email. If this is your will then provide your email address in #ReportsCrashes(mailTo="your.account#domain.com"
Below is my AndroidManifest.xml, which has Internet permissions, so not sure what's going on here. Any help appreciated!
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.TestApp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application
android:icon="#drawable/ic_launcher"
android:name="TestApplication"
android:label="#string/app_name" >
<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>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

I had this problem when I ran on JellyBean, since the READ_LOGS permission was removed in JB.
See this question for how to work around this problem in API 16 and above:
READ_LOGS permission on Jelly Bean (api 16)

Related

Permissions don't work and are not asked when i install the program

We wrote all permission codes between suitable tags. But when i install the program there is no ask about permissions.
Where is my fault?
this my manifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.berker.notkayit">
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="24" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Writing permissions in Manifest file won't ask permissions on runtime. In order to show permissions, you need to write code in your application instances. Refer this link https://developer.android.com/training/permissions/requesting.html
are u testing the app in marshmallow or above device means it won't ask for permission during installation but it will permission during run time have u added the runtime permission codes
It dependences on your devices, if you device Android version is below 6.0, then you way is ok, however, if you device version is 6.0 and above then you need add runtime permission, check this link https://github.com/googlesamples/easypermissions

android application resetting to older version

I have made an app which is pre-installed on android device of particular manufacturer. After this I have release an upgrade of application for example initial version 1.0.0.0 to upgrade version of 1.2.0.0. After upgrading the app if user restarts its phone then my application goes to the initial version of 1.0.0.0.
Don't know why this is happening ? Is there a problem in bundling the application to devices ?
Note: I am updating my app via my server and not from play store and this issue is reproducible only when app is pre-installed on devices.
In mainfest file of both the versions I forgot to change android:versionCode value, in both the versions android:versionCode=3. Is it creating problem because of this?
I have also changed the package name of Application class so is this is creating the problem ?
Manifest for first version:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.apps.spinr"
android:versionCode="1"
android:versionName="1.0.0.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#style/SpinrTheme"
android:name="com.abc.xyz.GDApplication">
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Mainfest for second version:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.apps.spinr"
android:versionCode="1"
android:versionName="1.2.0.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#style/SpinrTheme"
android:name="com.xxx.apps.GDApplication">
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks for the suggestion. As #Mahmoud in comment suggested that "google play never release update for the app with the same version code", so I incremented version code of app and it worked fine. #Rat-a-tat-a-tat Ratatouille as I said in question I am not updating my app via google play neither my app is on play store so I was not able to figure this out initially. Anyways thanks for help.
So conclusion is
whenever you want to send upgrade of app always increase version code
of the app

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.

neither user or current process has android.permission.BLUETOOTH

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"/>

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