2

我有一个非常奇怪的问题。当我从 Eclipse 运行应用程序时,一切似乎都很好。但是,一旦在设备上安装了 apk,单击图标会返回一条消息,提示“应用程序未安装”。我收到了以下 Logcat 读数:

    08-07 08:06:43.183: E/Launcher(502): Launcher does not have the permission to launch Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.dsi.ant.HCAApplication/.WelcomeActivity }. Make sure to create a MAIN intent-filter for the corresponding activity or use the exported attribute for this activity. tag=ApplicationInfo(title=Health Creation Australia) intent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.dsi.ant.HCAApplication/.WelcomeActivity }
    08-07 08:06:43.183: E/Launcher(502): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.dsi.ant.HCAApplication/.WelcomeActivity } from ProcessRecord{4203f5b0 502:com.android.launcher/u0a13} (pid=502, uid=10013) requires android.permission.ACCESS_NETWORK_STATE
    08-07 08:06:43.183: E/Launcher(502):    at android.os.Parcel.readException(Parcel.java:1425)
    08-07 08:06:43.183: E/Launcher(502):    at android.os.Parcel.readException(Parcel.java:1379)
    08-07 08:06:43.183: E/Launcher(502):    at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1761)
    08-07 08:06:43.183: E/Launcher(502):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    08-07 08:06:43.183: E/Launcher(502):    at android.app.Activity.startActivityForResult(Activity.java:3351)
    08-07 08:06:43.183: E/Launcher(502):    at android.app.Activity.startActivity(Activity.java:3518)
    08-07 08:06:43.183: E/Launcher(502):    at com.android.launcher2.Launcher.startActivity(Launcher.java:1952)
    08-07 08:06:43.183: E/Launcher(502):    at com.android.launcher2.Launcher.startActivitySafely(Launcher.java:1970)
    08-07 08:06:43.183: E/Launcher(502):    at com.android.launcher2.AppsCustomizePagedView.onClick(AppsCustomizePagedView.java:597)
    08-07 08:06:43.183: E/Launcher(502):    at android.view.View.performClick(View.java:4088)
    08-07 08:06:43.183: E/Launcher(502):    at android.view.View$PerformClick.run(View.java:16984)
    08-07 08:06:43.183: E/Launcher(502):    at android.os.Handler.handleCallback(Handler.java:615)
    08-07 08:06:43.183: E/Launcher(502):    at android.os.Handler.dispatchMessage(Handler.java:92)
    08-07 08:06:43.183: E/Launcher(502):    at android.os.Looper.loop(Looper.java:137)
    08-07 08:06:43.183: E/Launcher(502):    at android.app.ActivityThread.main(ActivityThread.java:4745)
    08-07 08:06:43.183: E/Launcher(502):    at java.lang.reflect.Method.invokeNative(Native Method)
    08-07 08:06:43.183: E/Launcher(502):    at java.lang.reflect.Method.invoke(Method.java:511)
    08-07 08:06:43.183: E/Launcher(502):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    08-07 08:06:43.183: E/Launcher(502):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    08-07 08:06:43.183: E/Launcher(502):    at dalvik.system.NativeStart.main(Native Method)

由此我认为这是一个权限问题,但我相信我拥有所有正确的权限集:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  android:versionCode="020400"
  android:versionName="2.4.1"
  package="com.dsi.ant.HCAApplication">

<supports-screens
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="false"
/>

<uses-permission android:name="com.dsi.ant.permission.ANT" />
<uses-permission android:name="com.dsi.ant.permission.ANT_ADMIN" /><application     android:label="@string/app_name" android:icon="@drawable/hca_logo"     android:permission="android.permission.ACCESS_NETWORK_STATE">
    <activity android:label="@string/app_name" android:name="com.dsi.ant.HCAApplication.TakeMeasurements" android:launchMode="singleTask" android:screenOrientation="sensorLandscape">
    </activity>

    <service android:name="com.dsi.ant.HCAApplication.ANTPlusService" android:label="@string/app_name" android:exported="false" />
    <activity android:name="com.dsi.ant.HCAApplication.FairwellActivity" android:label="Fairwell" android:screenOrientation="sensorLandscape"></activity>
    <activity android:name="com.dsi.ant.HCAApplication.ScreenSaver" android:label="Health Creation Australia" android:screenOrientation="sensorLandscape"></activity>
    <activity android:name="com.dsi.ant.HCAApplication.WelcomeActivity" android:label="@string/app_name" android:screenOrientation="sensorLandscape">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

<uses-sdk android:minSdkVersion="7"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

如果您能以任何方式帮助我,我将不胜感激,因为我不知所措。

4

4 回答 4

2

在 Manifest 中查找此行以获取导出的标签并制作它

安卓:导出=“真”

于 2019-04-03T12:02:05.170 回答
1

从应用程序标记中删除此行

    <application     

          android:permission="android.permission.ACCESS_NETWORK_STATE">

   </application>
于 2013-08-07T12:45:44.450 回答
0
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
</application>
于 2013-08-07T12:46:14.947 回答
0

只需将您的清单代码替换为以下

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.dsi.ant.HCAApplication"
    android:versionCode="020400"
    android:versionName="2.4.1" >

    <supports-screens
        android:anyDensity="false"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true" />

    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="18" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
    <uses-permission android:name="com.dsi.ant.permission.ANT" />
    <uses-permission android:name="com.dsi.ant.permission.ANT_ADMIN" />

    <application
        android:label="@string/app_name"
        android:permission="android.permission.ACCESS_NETWORK_STATE" >
        <activity
            android:name="com.dsi.ant.HCAApplication.TakeMeasurements"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:screenOrientation="sensorLandscape" >
        </activity>

        <service
            android:name="com.dsi.ant.HCAApplication.ANTPlusService"
            android:exported="false"
            android:label="@string/app_name" />

        <activity
            android:name="com.dsi.ant.HCAApplication.FairwellActivity"
            android:label="Fairwell"
            android:screenOrientation="sensorLandscape" >
        </activity>
        <activity
            android:name="com.dsi.ant.HCAApplication.ScreenSaver"
            android:label="Health Creation Australia"
            android:screenOrientation="sensorLandscape" >
        </activity>
        <activity
            android:name="com.dsi.ant.HCAApplication.WelcomeActivity"
            android:label="@string/app_name"
            android:screenOrientation="sensorLandscape" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

希望它会帮助你。

于 2013-08-07T12:52:59.303 回答