After running I am able to see the app, but when I restart the emulator and click the app, its just showing App isn't installed. what could be the reason?
check your android AndroidManifest.xml file carefully, there may be something wrong like you have given the wrong permission or added one permission twice. If not then add this user permission to your file
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Also check if you have specified the launcher correctly in menifest file
Related
I've got this strange error when building my project in Android Studio. Basically my app uses GPS to get the current location of the user.So in my androidmanifest.xml i've placed this line:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
But when building the app,this exception keeps popping up:
E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.SecurityException: Provider gps requires ACCESS_FINE_LOCATION permission
When using the networkprovider for the lastKnownLocation, the app works fine (and will most likely use another permission).
EDIT: the permissions tag is not within the Application tag.
Does anyone recognize this error?
Place it outside application tag.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<application.....
Make sure the uses-permission element is not inside the application element. Android Studio will not show any problem in this case.
OK, I've now rebuild the entire manifestfile and the error is gone. But essentially this is just a 1:1 copy of the old manifest file. So it's still a mystery what caused the error in the first place.
Thanks for all the help and advice!
I am trying to use "android.permission.PACKAGE_USAGE_STATS" in my app. Here it says that NOTE: This API requires the permission android.permission.PACKAGE_USAGE_STATS, which is a system-level permission and will not be granted to third-party apps. However, declaring the permission implies intention to use the API and the user of the device can grant permission through the Settings application.
It seems that I will need the user to explicitly give my app the permission to give access to the access the usage stats.
In addition, I used the intent code below to open the screen to allow user to give access to my app, but my app is not in the list.
Code I used:
Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
startActivity(intent);
When *startActivity(intent)' is fired (or going to *Settings>Security>Apps with Usage Access), a blank screen below pops up, my app is not part of it.
Bottom line question is -- How to use UsageStatsManager in Android Lollipop? Anyone tried it?
This is what worked for me.
<uses-permission xmlns:tools="http://schemas.android.com/tools"
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
You can simply make this on the manifest, ignoring just this permission error:
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions"/>
The AndroidManifest.xml error can be fixed by disabling lint errors. Specifically
Security - SignatureorSystemPermissions
I guess after that the settings app will show your app.
I am following this 2 tutorial. Tutorial 1 and Tutorial 2. But When i run thid project in my Moto G phone its unfortunately stop means after 17 api this is not working & give error
Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=8675, uid=10233
I set permission in manifest file.
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<protected-broadcast android:name="android.intent.action.AIRPLANE_MODE" />
I am also checking some solution like Permission Link. I am getting still this error. So, how can i resolve it?
Thanks in advance.
This broadcast can (now) only be sent by a system app, not by an installed app.
So unless you can get Motorola to sign your app as a system app, you are out of luck.
I had already added this permission in my Manifest
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
But it will not give me permission to cut the incoming call, I can receive the call.when I'm try to cut the call it give me
java.lang.SecurityException: Neither user 10037 nor current process has android.permission.MODIFY_PHONE_STATE.
I have gone through so many blogs,but none of work.
In some of the emulator its working fine.
MODIFY_PHONE_STATE is a system-only permission, so you can not access or use this permission in your app,
Check it out!
Place your app in the /system/priv-app folder instead of /system/app, when using Android 4.3 or higher.
On a tablet I installed a apk develloped in Eclipse under Ubuntu. The App works on the AVD and is already installed on a phone and working.
The installation of the apk gives no error, however when starting the App it gives a "not installed" toast message.
In the aLogCat output I see a Permission denial message of the Launcher for WRITE_EXTERNAL_STORAGE. Note that the USB connection is not connected when I started the App.
Furthermore I noticed the following line in aLogCat and I noted that the "-1" was added to the package name.
New package installed in /data/app/com.company.AppName-1.apk
In the manifest the lines
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
are in the manifest block and
<android:permission="android.permission.WRITE_EXTERNAL_STORAGE">
in the application block.
Why is this working on a Android 2.3 phone and in a Android 4.0.3 AVD, but not on a Android 4.0.3 tablet?
Platform info: Eclipse 3.7.2, Tablet: Yarvik TAB461EUK; Installed with "ES File Explorer"
Try removing the permission from the application block. I dont know for sure but from personal experience ICS do not support permission attribute in application block which has already been defined in the main block. It inherits from the main block. Please tell if that solves the problem.
I dont know why it works on the AVD, may be because AVD do not have any external storage.
Related documentation:
http://developer.android.com/guide/topics/manifest/manifest-intro.html describes the permission element only for the main manifest block (now)
Changes per version states:
HONEYCOMB: When an application requires a permission to access one of its components (activity, receiver, service, provider), this permission is no longer enforced when the application wants to access its own component. This means it can require a permission on a component that it does not itself hold and still access that component.
Activity states:
The name of a permission that clients must have to launch the activity or otherwise get it to respond to an intent. If a caller of startActivity() or startActivityForResult() has not been granted the specified permission, its intent will not be delivered to the activity.
If this attribute is not set, the permission set by the element's permission attribute applies to the activity. If neither attribute is set, the activity is not protected by a permission.
Not very clear to me