Android“找不到要撤销权限的内容提供者”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11550798/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android "No content provider found for permission revoke"
提问by Sean McCully
I have a simple app HelloWorld Android app in Eclipse (Mac OS X), when I install to the emulator/AVD the app shows up in "Settings->[Devices] Apps" but not in the launcher. I notice in logcat that I get these errors
我在 Eclipse (Mac OS X) 中有一个简单的应用程序 HelloWorld Android 应用程序,当我安装到模拟器/AVD 时,该应用程序显示在“设置->[设备] 应用程序”中,但不在启动器中。我在 logcat 中注意到我收到这些错误
W/ActivityManager( 160): No content provider found for permission revoke: file:///data/local/tmp/HelloWorld.apk
W/ActivityManager( 160): No content provider found for permission revoke: file:///data/local/tmp/HelloWorld.apk
I/PackageManager( 160): Running dexopt on: com.example.helloworld
D/dalvikvm( 870): DexOpt: load 124ms, verify+opt 459ms, 720236 bytes
I/ActivityManager( 160): Force stopping package com.example.helloworld uid=10044
I have set read/write/execute permissions on the .android directory.
我已经在 .android 目录上设置了读/写/执行权限。
采纳答案by rgrun
In my case I forgot to define mainactivity. So, I add the following code inside AndroidManifest.xml mainactivity.
就我而言,我忘记定义主要活动。因此,我在 AndroidManifest.xml主要活动中添加了以下代码。
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
That was the result for Activity definition:
这是活动定义的结果:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity android:name="RssfeedActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="DetailActivity"></activity>
</application>
回答by Ionic? Biz?u
I think that the problem is with the install directory permissions. /data/local
needs to have write and execute rights to others in order for adb packages to install correctly.
我认为问题出在安装目录权限上。/data/local
需要对其他人具有写入和执行权限才能正确安装 adb 包。
Try this, too: Android - Download App
也试试这个:Android - 下载应用程序
回答by M. Oosterlee
I ran into this problem building a new signed APK.
我在构建一个新的签名 APK 时遇到了这个问题。
I checked the V2(Full APK signature). Installing the APK on a device did not work anymore.
我检查了 V2(完整的 APK 签名)。在设备上安装 APK 不再起作用。
My solution was to check the V1 (Jar signature) instead. This did work.
我的解决方案是检查 V1(Jar 签名)。这确实有效。
回答by Fernando JS
I just found solution to Linux, but I not found for Windows, maybe because in Windows the directories and permissions were confused.
我刚刚找到了 Linux 的解决方案,但我没有找到适用于 Windows 的解决方案,可能是因为在 Windows 中目录和权限被混淆了。
It's work for me: Add the user "Everyone" in folder "C://YourUser//.Android//" with full control, then restart the emulador.
这对我有用:完全控制在文件夹“C://YourUser//.Android//”中添加用户“Everyone”,然后重新启动模拟器。
回答by Shayan_Aryan
I had the same problem on all of my devices. My problem was from the run configuration, I didn't checked the "launch default Activity".
我在所有设备上都遇到了同样的问题。我的问题来自运行配置,我没有检查“启动默认活动”。
回答by Ramesh Bhupathi
This works for me
这对我有用
Check your manifest application, if it contains this line
tools:replace="android:icon"
检查您的清单应用程序,如果它包含此行
tools:replace="android:icon"
<application
android:name=".activities.MyApplication"
android:allowBackup="true"
android:icon="@drawable/launcher_icon"
android:label="@string/app_name"
android:largeHeap="true"
tools:replace="android:icon">
<application
android:name=".activities.MyApplication"
android:allowBackup="true"
android:icon="@drawable/launcher_icon"
android:label="@string/app_name"
android:largeHeap="true"
tools:replace="android:icon">
make it like this by remove this line
tools:replace="android:icon"
通过删除这一行使它像这样
tools:replace="android:icon"
<application
android:name=".activities.MyApplication"
android:allowBackup="true"
android:icon="@drawable/launcher_icon"
android:label="@string/app_name"
android:largeHeap="true"
>
<application
android:name=".activities.MyApplication"
android:allowBackup="true"
android:icon="@drawable/launcher_icon"
android:label="@string/app_name"
android:largeHeap="true"
>
回答by Ivan Bartsov
https://stackoverflow.com/a/8646393/375929- they say it's about /data/local permissions.
https://stackoverflow.com/a/8646393/375929- 他们说这是关于 /data/local 权限。
And here: Change /data/local Permissionsis how to fix this.
在这里:更改/数据/本地权限是解决此问题的方法。
回答by Mustey
My Solution was to remove the android:sharedUserId-Tag in the AndroidManifest.xml...
我的解决方案是删除 AndroidManifest.xml 中的 android:sharedUserId-Tag ...
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.app"
android:theme="@style/MyAppTheme"
android:versionCode="9"
android:versionName="1.2.5" android:sharedUserId="mc">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.app"
android:theme="@style/MyAppTheme"
android:versionCode="9"
android:versionName="1.2.5" android:sharedUserId="mc">
回答by user1929819
Working on Cordova and emulator,
在 Cordova 和模拟器上工作,
For me the problem was that the apk size was large and AVD RAM was too small,
对我来说,问题是 apk 大小太大而 AVD RAM 太小,
problem happen when install new version of the apk and it failed with the message "No content provider found for permission revoke"
安装新版本的 apk 时出现问题,但失败并显示消息“找不到内容提供者进行权限撤销”
any one of those fixed the problem for me:
其中任何一个为我解决了问题:
- uninstall the old apk manually before install the new version
- decrease the apk size
- increase the device RAM
- 在安装新版本之前手动卸载旧的 apk
- 减小apk大小
- 增加设备 RAM