今天,在学习android时,运行案例时,总出现这两个错(这两个错初学者可能很容易遇到,问题主要在于不仔细):
错误一:
Application does not specify an API level requirement!
Device API version is 15 (Android 4.0.4) 出现这个错误是因为我当前环境中使用的是android4.0版本,可能运行的时候不知道吧!这个具体的我也不是太清楚,因为之前也用此版本的例子都没有出现过这个错误。解决办法:
在项目中AndroidManifest.xml<在manifest标签中间加>文件中加上<uses-sdk android:minSdkVersion="15"/> [这个Version是多少根据你的
android版本而定]。
错误二:
No Launcher activity found!
The launch will only sync the application package on the device! 这个错的确是一个错,根据它的字面意思来看,就是它找不到项目发布入口的activity,而实际上我的AndroidManifest.xml文件中是已经配置好的,即是这段:
<activity android:name=".BaseAdapterTest"
android:label="baseadapter"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 因为平时例子比较多,这段<intent-filter>都是直接copy的,可是运行时,问题还是出在此处,不过找了很长时间还是找到了
一个很小的错误,因为这段“android.intent.category.LAUNCHER”里面多了一个字母,所以呢,我运行的时候就总出这个错,模拟器上也没有反应。
犯这个错可能不一定都是这样的,但是问题大多都是出自这个配置文件中,这里虽然就那几个标签,但是却非常容易出错,一定要小心
问题截图如下:
|
|