问题描述
我试图用凹凸API在我的应用程序。我导入凹凸库项目到我的项目。有谁知道为什么发生这种情况?
I'm trying to use the bump API in my app. I import the Bump library project into my project. Does anybody know why this is happening?
04-26 21:00:15.828: W/ActivityManager(528): Permission denied: checkComponentPermission() owningUid=10072
04-26 21:00:15.828: W/BroadcastQueue(528): Permission Denial: broadcasting Intent { act=com.bump.core.util.LocationDetector.PASSIVE_LOCATION_UPDATE flg=0x10 (has extras) } from com.helloworld.utility (pid=-1, uid=10071) is not exported from uid 10072 due to receiver com.bumptech.bumpga/com.bump.core.service.PassiveLocationReceiver
下面是我AndroidManifest.xml中的相关部分:
Here is the relevant portion of my AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<service android:name="com.bump.api.BumpAPI">
<intent-filter>
<action android:name="com.bump.api.IBumpAPI" />
</intent-filter>
</service>
我想看看Android操作系统里面,它是从这里起源于ActivtiyManagerService.java:
I tried to look inside the Android source, and it's originating from here in ActivtiyManagerService.java:
// If the target is not exported, then nobody else can get to it.
if (!exported) {
Slog.w(TAG, "Permission denied: checkComponentPermission() owningUid=" + owningUid);
return PackageManager.PERMISSION_DENIED;
}
我不知道什么是目标就是在这种情况下,需要出口是什么。有没有其他人见过这个?
I'm not sure what the "target" is in this case and what needs to be "exported". Has anyone else seen this before?
谢谢你们!
推荐答案
使用导出
服务标记属性。例如&LT;服务机器人:出口=真正的机器人:名字=com.bump.api.BumpAPI&GT;
的清单。导出的属性意味着,其他应用程序将有机会获得与否(活动/服务/广播等)。在您的code,它导出
布尔是假
这样的条件如果(!导出)
始终是真实的,因此它从那里回国。做出改变我所提到的,让我们知道,如果问题仍然存在。
Use exported
attribute in service tag. e.g. <service android:exported="true" android:name="com.bump.api.BumpAPI">
in Manifest. Exported attribute means, other applications will have access to it or not (activity/service/broadcast etc). In your code that exported
boolean is false
so condition if(!exported)
is always true and hence the it's returning from there. Make change I mentioned and let us know if problem persist.
有关文档去。
这篇关于拒绝权限:广播意图不出口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!