Android 应用程序未启动,尽管加载成功
我遇到了一个奇怪的问题,请看看这里是否有人能帮忙。每当我运行我的应用程序(无论是在emulator中还是在phone中),我都可以看到安装成功,但活动没有显示出来。以下是我在控制台中收到的消息Android 应用程序未启动,尽管加载成功,android,Android,我遇到了一个奇怪的问题,请看看这里是否有人能帮忙。每当我运行我的应用程序(无论是在emulator中还是在phone中),我都可以看到安装成功,但活动没有显示出来。以下是我在控制台中收到的消息 ------------------------------ Android Launch! adb is running normally. Performing sync Uploading MyApp.apk onto device 'emulator-5554' Installing MyApp
------------------------------
Android Launch!
adb is running normally.
Performing sync
Uploading MyApp.apk onto device 'emulator-5554'
Installing MyApp.apk...
Success!
\MyApp\bin\MyApp.apk installed on device
Done!
它以前运行正常,但从昨天开始,它就开始这样运行了。理想情况下,在“Success!”语句之后,将加载意图并显示MainActivity。但现在不是了。我尝试重新启动/重新创建emulator,但没有任何帮助。我在应用程序中所做的唯一更改是为标题栏创建一些xml文件。我甚至取消了那个改动,但仍然是同一个问题。感谢您的帮助
更新以添加清单文件
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bfp.MyApp"
android:versionCode="12"
android:versionName="2.5" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="10" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<permission
android:name="com.bfp.MyApp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.bfp.MyApp.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme" >
<activity
android:name="com.bfp.MyApp.MainActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden|screenSize"
android:clearTaskOnLaunch="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.bfp.MyApp.TestQuizActivity"
android:parentActivityName="com.bfp.MyApp.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.bfp.MyApp.MainActivity" />
</activity>
<service android:name="com.bfp.MyApp.GCMIntentService" />
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.bfp.MyApp" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.bfp.MyApp" />
</intent-filter>
</receiver>
<activity
android:name="com.bfp.MyApp.RegisterActivity"
android:launchMode="singleTop" />
<activity
android:name="com.bfp.MyApp.BaseActivity"
android:label="@string/title_activity_main" >
</activity>
</application>
当您直接从手机上运行应用程序时,应用程序是否正常运行?如果是这样,可能是您不小心将运行配置从eclipse更改为启动除MainActivity之外的其他活动。这会影响通过调试界面从eclipse运行。从eclipse运行应用程序时,问题似乎更严重。在手机中安装apk文件工作正常。我删除了AVD并重新创建了它们。我还注意到,我的应用程序引用了安卓4.3版,而英特尔atom映像不适用于该版本。因此,我将其降级为4.2.2。完成这些更改后,应用程序开始正常加载。不是真正的根本原因,而是与AVD有关的问题。请从logcat发布stacktrace和清单。logcat中没有消息。自从上次成功运行清单文件以来,该清单文件未被触及。我试着在手机上运行它(从eclipse开始,手机通过USB作为设备连接)。还是一样的问题。