我的应用程序能够从Galaxy Tab上的启动器运行,但在HTC Legend上,我在logcat中收到以下错误:
--------- beginning of /dev/log/main D/Rosie ( 194): can't start activity: android.intent.action.MAIN --------- beginning of /dev/log/system I/ActivityManager( 97): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.company.myapp/.Myapp } W/ActivityManager( 97): Permission denied: checkComponentPermission() reqUid=10015 W/ActivityManager( 97): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.company.myapp/.Myapp } from ProcessRecord{450f1ac8 194:com.htc.launcher/9999} (pid=194, uid=9999) requires null
我的清单文件如下:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.myapp"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
<activity android:name="com.company.SplashScreenActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity><activity android:screenOrientation="portrait" android:label="@string/app_name" android:multiprocess="true" android:configChanges="orientation" android:name="Myapp">
</activity><activity android:name="com.company.CameraActivity" android:multiprocess="true" android:screenOrientation="landscape"></activity>
<activity android:name="com.company.MainMenu">
</activity>
<activity android:name="com.company.ImagePicker">
</activity>
</application>
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
</manifest>
编辑:修复
只需从设备上卸载并重新安装即可。
答案 0 :(得分:1)
清单中有一个空的<uses-permission></uses-permission>
元素。尝试删除它。
答案 1 :(得分:1)
我是OP。我编辑了我的修复问题,但这里也是:
只需从设备上卸载并重新安装即可。
答案 2 :(得分:0)
尝试删除清单中声明空权限的行。系统可能不知道如何处理(参见空警告)。
删除此行:
<uses-permission></uses-permission>