编译时我的问题没有错误,并且它在设备中运行良好。当我尝试创建一个已签名的apk时,它在manifest.xml文件中显示错误,如下所示
E:\updated one\Wed Studio\app\src\main\AndroidManifest.xml:842: Error: The <activity> element must be a direct child of the <application> element [WrongManifestParent]
<activity
^
E:\updated one\Wed Studio\app\src\main\AndroidManifest.xml:845: Error: The <activity> element must be a direct child of the <application> element [WrongManifestParent]
<activity
^
Explanation for issues of type "WrongManifestParent":
The <uses-library> element should be defined as a direct child of the
<application> tag, not the <manifest> tag or an <activity> tag. Similarly,
a <uses-sdk> tag much be declared at the root level, and so on. This check
looks for incorrect declaration locations in the manifest, and complains if
an element is found in the wrong place.
告诉我解决这个问题的可能解决方案的朋友 提前谢谢。
的manifest.xml
<!-- android:installLocation="preferExternal" -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission
android:name="android.permission.READ_CONTACTS"
android:required="false" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
-->
<uses-permission android:name="android.permission.FLASHLIGHT" />
<application
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:icon="@drawable/wedicon"
android:label="iWedplanner"
android:theme="@android:style/Theme.NoTitleBar" >
<activity android:name="com.google.android.gms.ads.AdActivity" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".Frontpage"
android:label="iWedPlanner" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".Fsearch"
android:label="@string/title_activity_fsearch" />
<activity
android:name=".Rsvp_listeng"
android:label="@string/title_activity_rsvp_listeng" />
<activity
android:name=".Rsvp_guestnores"
android:label="@string/title_activity_rsvp_guestnores" />
<activity
android:name=".Engagement_edit"
android:label="@string/title_activity_engagement_edit" />
<activity android:name=".Reception_edit" />
<activity android:name=".Reception_Tabledetail" />
<activity android:name=".Wedding_edit" />
<activity android:name=".Wedding_Tabledetail" />
</application>
<activity android:name=".Countdownsongplay" />
<activity android:name=".Wedtime" />
<activity android:name=".Unitcal" />
<activity android:name=".Heart" />
<activity android:name=".Kisses" />
<activity android:name=".Phrase" />
<activity android:name=".Remainshow" />
<activity android:name=".ColorPickerActivity" />
<activity android:name=".Logout" />
<activity
android:name="jim.h.common.android.zxinglib.CaptureActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity android:name=".Hair" />
<activity android:name=".Hair1" />
<activity android:name=".Inapp" />
<activity
android:name=".websiteview"
android:label="@string/title_activity_websiteview" >
</activity>
<activity
android:name=".CountdownSlideshow"
android:label="@string/title_activity_countdown_slideshow" >
</activity>
<activity
android:name=".InappCountdown"
android:label="@string/title_activity_inapp_countdown" >
</activity>
<activity
android:name=".InappSeating"
android:label="@string/title_activity_inapp_seating" >
</activity>
</manifest>
答案 0 :(得分:0)
只需剪切</application>
并将其粘贴到</manifest>
之前。