Android PermissionDenial: permission Bind_RemoteViews

I keep getting this error when starting a service from onReceive or onUpdate in my AppWidgetProvider class.

09-15 11:54:04.096: WARN/ActivityManager(1318): Permission Denial: Accessing service ComponentInfo{com.fttech.gameIT/com.fttech.StackWidgetService} from pid=1318, uid=1000 requires android.permission.BIND_REMOTEVIEWS 

Ive already announced permission in my Android manifest.

But it still gives me that.

Is there something I'm doing wrong?

This is what my code looks like.

 @Override public void onReceive(Context context, Intent intent){ AppWidgetManager.getInstance(context); intent = new Intent(context, StackWidgetService.class); context.startService(intent); super.onReceive(context, intent); } @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){ super.onUpdate(context, appWidgetManager, appWidgetIds); Intent intent = new Intent(context, StackWidgetService.class); context.startService(intent); } 

}

EDIT: I declared this in my manifest.

Here is what I still get ...

 09-15 12:13:03.818: WARN/ActivityManager(1318): Permission Denial: Accessing service ComponentInfo{com.fttech/com.fttech.StackWidgetService} from pid=1318, uid=1000 requires android.permission.BIND_REMOTEVIEWS 09-15 12:13:03.864: WARN/ActivityManager(1318): Permission Denial: Accessing service ComponentInfo{com.fttech/com.fttech.StackWidgetService} from pid=1318, uid=1000 requires android.permission.BIND_REMOTEVIEWS 09-15 12:13:03.872: WARN/ActivityManager(1318): finishReceiver called but no pending broadcasts 09-15 12:13:03.919: WARN/WidgetAidService(21261): BroadcastReceiver onReceive called 09-15 12:13:03.919: WARN/ActivityManager(1318): Permission Denial: Accessing service ComponentInfo{com.fttech/com.fttech.StackWidgetService} from pid=1318, uid=1000 requires android.permission.BIND_REMOTEVIEWS 

EDIT: manifest

 <uses-permission android:name="android.permission.BIND_REMOTEVIEWS"></uses-permission> <service android:name="StackWidgetService" android:enabled="true" /> 

There is permission and service declared in my manfiest

+6
source share
2 answers

Try entering your permission in your service tag:

 <application> ... <service android:name=".StackWidgetService" android:exported="false" android:permission="android.permission.BIND_REMOTEVIEWS" /> </application> 

In addition, the dot in front of your class name is important, as it is a shortcut (so you do not need to write the full class name), and the android: enabled attribute is true by default.

+6
source

I also had this problem,

Fortunately, this happened in the project 3 months after the first permission was added.

There must be an error in the SDK, because he told me unequivocally: "This is a system resolution" and did not allow me to run my project through Eclipse. However, through ant he built perfectly. What else, after cleaning and building the project, he decided that this was not a system resolution, and everything was in order.

I hope your error has now disappeared, but it is worth noting that someone else is wandering around so that it is safe to ignore this (AFAIK) if a few clean and realignments make it go away.

0
source

Source: https://habr.com/ru/post/897403/


All Articles