【问题标题】:Internet permission in Android app not granted未授予 Android 应用程序中的 Internet 权限
【发布时间】:2012-10-14 13:45:41
【问题描述】:

我尝试在我的项目中使用 ACRA,但每当我的应用启动时,我都会在日志中看到以下消息。

E/ACRA    (11618): com.example.TestApp should be granted permission android.permission.INTERNET if you want your crash reports to be sent. If you don't want to add this permission to your application you can also enable sending reports by email. If this is your will then provide your email address in @ReportsCrashes(mailTo="your.account@domain.com"

下面是我的AndroidManifest.xml,它有互联网权限,所以不知道这里发生了什么。任何帮助表示赞赏!

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.TestApp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />

    <application
        android:icon="@drawable/ic_launcher"
        android:name="TestApplication"
        android:label="@string/app_name" >
        <activity
            android:name="MainActivity_"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

    <uses-permission android:name="android.permission.INTERNET"/>

</manifest>

【问题讨论】:

  • 您是否尝试过清理和重建?
  • 当您查看 ACRA 源代码以查看他们在哪里记录此内容时,您发现了什么?
  • @CommonsWare 这是一个使用PackageManager 的非常简单的权限检查。我不认为这个问题真的与 ACRA 有关。
  • 尝试将&lt;uses-permission&gt;移动到&lt;application&gt;之前(例如,在&lt;uses-sdk&gt;之后)。打包工具可能对这些元素的去向有些挑剔,而这正是我经常看到的地方。
  • @CommonsWare 我已经尝试过了,因为我在其他地方找到了相同的信息。没有帮助。

标签: android acra android-permissions


【解决方案1】:

我在 JellyBean 上运行时遇到了这个问题,因为在 JB 中删除了 READ_LOGS 权限。

请参阅此问题以了解如何在 API 16 及更高版本中解决此问题: READ_LOGS permission on Jelly Bean (api 16)

【讨论】:

    猜你喜欢
    • 2016-03-08
    • 1970-01-01
    • 2012-04-29
    • 2016-07-12
    • 2013-01-29
    • 2012-03-23
    • 2020-08-22
    相关资源
    最近更新 更多