0
[2012-11-08 10:11:10 - BlueParking] Android Launch!
[2012-11-08 10:11:10 - BlueParking] adb is running normally.
[2012-11-08 10:11:10 - BlueParking] No Launcher activity found!
[2012-11-08 10:11:10 - BlueParking] The launch will only sync the application package on the device!
[2012-11-08 10:11:10 - BlueParking] Performing sync
[2012-11-08 10:11:10 - BlueParking] Automatic Target Mode: using device 'S5830bf8abc43'
[2012-11-08 10:11:10 - BlueParking] Uploading BlueParking.apk onto device 'S5830bf8abc43'
[2012-11-08 10:11:11 - BlueParking] Installing BlueParking.apk...
[2012-11-08 10:11:15 - BlueParking] Success!
[2012-11-08 10:11:15 - BlueParking] \BlueParking\bin\BlueParking.apk installed on device
[2012-11-08 10:11:15 - BlueParking] Done!

当我想安装我的应用程序时,我得到了这个控制台输出。但是,这是我的 Android 清单:

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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

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

    <uses-feature
        android:name="android.hardware.location"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.location.gps"
        android:required="false" />

    <application
        android:name=".application.BlueParkingApplication"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Light.NoTitleBar" >
        <activity
            android:name=".LoginActivity"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="androi.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
            android:screenOrientation="portrait" />

        <receiver
            android:name="com.littlefluffytoys.littlefluffylocationlibrary.StartupBroadcastReceiver"
            android:exported="true" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.littlefluffytoys.littlefluffylocationlibrary.PassiveLocationChangedReceiver"
            android:exported="true" />
    </application>

</manifest>

如您所见,LoginActivity 是 Launcher Activity。谁能告诉我这里发生了什么?

4

2 回答 2

1

Manifest.xml 似乎没问题。

类的名称是 LoginActivity?扩展活动?您是否正确加载布局?

如果你把 LoginActivity 的代码放在这里,我们可以看到失败

于 2012-11-08T09:24:30.580 回答
0

您需要像这样在清单中指定启动器活动

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

看起来您已经这样做了,因此您可以尝试在 Android Studio 中的 Edit Configuration 中选择“Launch Options” - Default Activity。我也有这个问题。

在这里查看有关 android 活动的更多信息

于 2016-04-04T10:01:22.340 回答