开发者

Can't start app from launcher in Android

My application is able to run from the launch开发者_StackOverflow中文版er on the Galaxy Tab, but on the HTC Legend, I get the following error in 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

My manifest file is the following:

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

Edit: Fix

Just had to uninstall from device and reinstall.


I'm the OP. I edited my question for the fix, but here it is also:

Just had to uninstall from device and reinstall.


You have an empty <uses-permission></uses-permission> element in your manifest. Try removing it.


Try deleting the line in your manifest that declares an empty permission. It's possible the system doesn't know how to handle that (see the null warning).

Delete this line:

<uses-permission></uses-permission>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜