【问题标题】:Android "No content provider found for permission revoke"Android“未找到可撤销权限的内容提供者”
【发布时间】:2012-07-18 21:41:53
【问题描述】:

我在 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

我已经在 .android 目录上设置了读/写/执行权限。

【问题讨论】:

标签: android android-emulator


【解决方案1】:

在我的例子中,我忘记定义 ma​​in 活动。因此,我在 AndroidManifest.xml ma​​in 活动中添加了以下代码。

<intent-filter>
   <action android:name="android.intent.action.MAIN"/>
   <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

这是 Activity 定义的结果:

<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>

【讨论】:

    【解决方案2】:

    我认为问题出在安装目录权限上。 /data/local 需要对其他人具有写入和执行权限才能正确安装 adb 包。

    Source

    也试试这个:Android - Download App

    【讨论】:

      【解决方案3】:

      我刚刚找到了 Linux 的解决方案,但我没有找到 Windows 的解决方案,可能是因为在 Windows 中目录和权限被混淆了。

      这对我有用:在文件夹“C://YourUser//.Android//”中添加用户“Everyone”并完全控制,然后重新启动模拟器。

      【讨论】:

      • 我刚刚更改了avd 子文件夹的权限和所有权,效果非常棒。
      【解决方案4】:

      我在所有设备上都遇到了同样的问题。我的问题来自运行配置,我没有检查“启动默认活动”。

      【讨论】:

        【解决方案5】:

        我在构建新的签名 APK 时遇到了这个问题。

        我检查了 V2(完整的 APK 签名)。在设备上安装 APK 不再起作用。

        我的解决方案是改为检查 V1(Jar 签名)。这确实有效。

        【讨论】:

        • 这并不能真正回答问题。在这种情况下,“检查”是什么意思?您正在“检查”的签名在哪里?解决方案“工作”意味着什么?
        • 我猜他说的是 android studio -> 生成签名的 apk -> 使用 V1 选项签名
        【解决方案6】:

        https://stackoverflow.com/a/8646393/375929 - 他们说这与 /data/local 权限有关。

        这里:Change /data/local Permissions 是解决此问题的方法。

        【讨论】:

        • 我把 /data/local 改成 755,但还是有这个问题
        • 你重启模拟器了吗?
        【解决方案7】:

        我的解决方案是删除 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">

        【讨论】:

          【解决方案8】:

          在 Cordova 和模拟器上工作,

          对我来说,问题是 apk 太大而 AVD RAM 太小,

          安装新版本的 apk 时出现问题,并且失败并显示“No content provider found for permission revoke”消息

          其中任何一个都为我解决了这个问题:

          • 在安装新版本之前手动卸载旧apk
          • 减小apk大小
          • 增加设备内存

          【讨论】:

            【解决方案9】:

            这对我有用

            检查您的清单应用程序,如果它包含此行 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">

            去掉这一行就变成这样 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" >

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2016-06-05
              • 1970-01-01
              • 2014-05-24
              • 1970-01-01
              相关资源
              最近更新 更多