I have a scenario in which i have to hide few installed apps icon i did try my best but didn't get the problem i think following code work for root devices only.
ComponentName componentToDisable =
new ComponentName("com.androidbird.lmkt",
"com.androidbird.lmkt.Splashscreen");
getPackageManager().setComponentEnabledSetting(
componentToDisable,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
Logcat:
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidbird.lmkt/com.androidbird.lmkt.Splashscreen}: java.lang.SecurityException: Permission Denial: attempt to change component state from pid=18338, uid=10165, package uid=10140
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2377)
at android.app.ActivityThread.access$600(ActivityThread.java:167)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5341)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:929)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.SecurityException: Permission Denial: attempt to change component state from pid=18338, uid=10165, package uid=10140
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:2573)
at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:1250)
com.androidbird.dashboard.MainActivity.onCreate(MainActivity.java:64)
at android.app.Activity.performCreate(Activity.java:5125)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2289)
SecurityException: Permission Denial: attempt to change component state from pid=18338, uid=10165, package uid=10140
you cant hide other application ... for that you need root access... you can hide your app icon
Related
Please any one help.I am testing my application in marshmallow emulator.App crashes when I am using camera.
How to check our App third party Sdk's are suitable for marshmallow
// Logcat Errors
E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe81c38f0
03-02 00:32:50.804 3199-3199/com.hirewire.hirewire E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.hirewire.hirewire, PID: 3199
java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.android.camera2/com.android.camera.CaptureActivity clip={text/uri-list U:file:///storage/emulated/0/sample.jpg} (has extras) } from ProcessRecord{cd5f9bb 3199:com.hirewire.hirewire/u0a62} (pid=3199, uid=10062) with revoked permission android.permission.CAMERA
at android.os.Parcel.readException(Parcel.java:1599)
at android.os.Parcel.readException(Parcel.java:1552)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2658)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1507)
at android.app.Activity.startActivityForResult(Activity.java:3917)
at android.app.Activity.startActivityForResult(Activity.java:3877)
at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:855)
at android.support.v4.app.FragmentActivity$HostCallbacks.onStartActivityFromFragment(FragmentActivity.java:907)
at android.support.v4.app.Fragment.startActivityForResult(Fragment.java:927)
My Logcat:
08-23 01:32:12.806 1299-1299/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.haftasia.easycode, PID: 1299
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxxxxxxx cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{43f9a738 1299:com.haftasia.easycode/u0a181} (pid=1299, uid=10181) requires android.permission.CALL_PHONE
at android.os.Parcel.readException(Parcel.java:1472)
at android.os.Parcel.readException(Parcel.java:1426)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2109)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1419)
at android.app.Activity.startActivityForResult(Activity.java:3442)
at android.app.Activity.startActivityForResult(Activity.java:3403)
at android.app.Activity.startActivity(Activity.java:3645)
at android.app.Activity.startActivity(Activity.java:3613)
at com.haftasia.easycode.Day_3G_Mci$1$1.onClick(Day_3G_Mci.java:52)
at android.view.View.performClick(View.java:4448)
at android.view.View$PerformClick.run(View.java:18461)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5065)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
You must add this permission in your AppManifest.xml:
<uses-permission android:name="android.permission.CALL_PHONE" />
Your error occurred because you didn't add it.
Since the logcat is saying everything what you looking for why dont you try to add permission ?
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
You seem to have an intent which makes an call but however for any app to make a call it requires the permission.
To add it in the Manifest before the application tag add the following
<uses-permission android:name = "android.permission.CALL_PHONE"/>
I've spent the entire day attempting to fix this, please find the stack trace below, coming from the Google Play Services lib. I changed nothing, i rebuilt the app today and ever since have been given this error. I've tried upgrading GPS to the latest version, rebuilding GPS, downgrading GPS to a previous version, removing various other libraries, explicitly adding the permission it requests and other such niceties... but NOTHING.
if ANYONE can please lend some advice i'd be forever grateful.
java.lang.RuntimeException: Unable to instantiate service
com.google.android.gms.analytics.service.AnalyticsService: java.lang.SecurityException: attempting to
read gservices without permission: Neither user 10064 nor current process has
com.google.android.providers.gsf.permission.READ_GSERVICES. at
android.app.ActivityThread.handleCreateService(ActivityThread.java:1929) at
android.app.ActivityThread.access$2500(ActivityThread.java:117) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:985) at
android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at
android.app.ActivityThread.main(ActivityThread.java:3683) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:507) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:895) at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653) at dalvik.system.NativeStart.main(Native
Method) Caused by: java.lang.SecurityException: attempting to read gservices without permission:
Neither user 10064 nor current process has
com.google.android.providers.gsf.permission.READ_GSERVICES. at
android.app.ContextImpl.enforce(ContextImpl.java:1289) at
android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:1318) at
android.content.ContextWrapper.enforceCallingOrSelfPermission(ContextWrapper.java:395) at
imq.c(SourceFile:107) at imq.a(SourceFile:121) at blw.a(SourceFile:276) at blu.b(SourceFile:203) at
blo.c(SourceFile:135) at com.google.android.gms.analytics.service.AnalyticsService.<init
(SourceFile:53) at java.lang.Class.newInstanceImpl(Native Method) at
java.lang.Class.newInstance(Class.java:1409) at
android.app.ActivityThread.handleCreateService(ActivityThread.java:1926) ... 10 more
The game crashes when I click at login button as the game is in landscape mode. If I use portrait mode, everything works fine and correctly.
I got the following stack trace from bugsense when I got the crash.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.adssdk.plugins/com.facebook.unity.FBUnityLoginActivity}: java.lang.UnsupportedOperationException: Session: an attempt was made to request new permissions for a session that has a pending request.
1at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2205)
2at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2240)
3at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3809)
4at android.app.ActivityThread.access$700(ActivityThread.java:139)
5at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1266)
6at android.os.Handler.dispatchMessage(Handler.java:99)
7at android.os.Looper.loop(Looper.java:156)
8at android.app.ActivityThread.main(ActivityThread.java:4987)
9at java.lang.reflect.Method.invokeNative(Native Method)
10at java.lang.reflect.Method.invoke(Method.java:511)
11at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
13at dalvik.system.NativeStart.main(Native Method)
14Caused by: java.lang.UnsupportedOperationException: Session: an attempt was made to request new permissions for a session that has a pending request.
15at com.facebook.Session.requestNewPermissions(Session.java:1006)
16at com.facebook.Session.requestNewPublishPermissions(Session.java:512)
17at com.facebook.unity.FB.initAndLogin(FB.java:200)
18at com.facebook.unity.FB.LoginUsingActivity(FB.java:249)
19at com.facebook.unity.FBUnityLoginActivity.onCreate(FBUnityLoginActivity.java:13)
20at android.app.Activity.performCreate(Activity.java:4538)
21at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
22at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
If anyone of you has implemented this in landscape mode and is not getting a crash while logging in, do let me know.
yes, this is a bug, we are working on proper fix right now.
Meanwhile you can edit your android manifest in Plugins/Android and add android:configChanges so that FBUnityLoginActivity isn't destroyed when orientation/whatever changes:
<activity
android:name="com.facebook.unity.FBUnityLoginActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
you may also want to remove "Translucent" from activity style.
I confirm that the change in the manifest file fixed the crash for me also. As additional info: the location of manifest the file was in Assets\Plugins\Android and the name was AndroidManifest.xml. I tested the fix on Sony Xperia M.
I'm working with android studio and when I launch the app it doesn't work and on android studio show this problem:
09-13 23:41:37.579 2228-2380/? A/SdkSpecific17﹕ null
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.google.android.location.os.real.SdkSpecific17.d(SourceFile:266)
at ees.run(SourceFile:797)
at java.lang.Thread.run(Thread.java:856)
Caused by: java.lang.SecurityException: Permission Denial: getCurrentUser() from pid=2228, uid=10011 requires android.permission.INTERACT_ACROSS_USERS
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at android.app.ActivityManagerProxy.getCurrentUser(ActivityManagerNative.java:3871)
at android.app.ActivityManager.getCurrentUser(ActivityManager.java:1948)
... 5 more
09-13 23:41:37.719 2228-2380/? A/SdkSpecific17﹕ null
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.google.android.location.os.real.SdkSpecific17.d(SourceFile:266)
at efb.D(SourceFile:933)
at dno.c(SourceFile:126)
at dno.x_(SourceFile:149)
at dnk.b(SourceFile:952)
at dmr.b(SourceFile:331)
at ees.run(SourceFile:798)
at java.lang.Thread.run(Thread.java:856)
Caused by: java.lang.SecurityException: Permission Denial: getCurrentUser() from pid=2228, uid=10011 requires android.permission.INTERACT_ACROSS_USERS
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at android.app.ActivityManagerProxy.getCurrentUser(ActivityManagerNative.java:3871)
at android.app.ActivityManager.getCurrentUser(ActivityManager.java:1948)
... 10 more
can you help me? Thanks
The clue is
Caused by: java.lang.SecurityException: Permission Denial: getCurrentUser() from pid=2228, uid=10011 requires android.permission.INTERACT_ACROSS_USERS
You need to add to your manifest.xml
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
That being said, I've not seen this permission before... I believe it's used when you require root access. So you also might need a phone that is rooted.