AAPT2错误:检查日志以获取详细信息:未知元素< action>发现 [英] AAPT2 error: check logs for details: unknown element <action> found

查看:273
本文介绍了AAPT2错误:检查日志以获取详细信息:未知元素< action>发现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的 debug \AndroidManifest.xml



获得如此多的错误,如


元素操作在这里是不允许的。

元素类别不允许在这里。

属性android:versionCode不是允许在这里。
属性android:versionName不允许在这里。

属性android:theme不允许在这里。和那么多。




 <?xml version =1.0encoding =utf-8?> ; 
< manifest xmlns:android =http://schemas.android.com/apk/res/android
package =com.company.sqh.adio
android:versionCode =1
android:versionName =1.0>

< uses-sdk
android:minSdkVersion =16
android:targetSdkVersion =26/>

<使用权限android:name =android.permission.INTERNET/>
< uses-permission android:name =android.permission.ACCESS_NETWORK_STATE/>

< application
android:allowBackup =true
android:debuggable =true
android:icon =@ drawable / logo_remaking2
android:label =@ string / label
android:supportsRtl =true
android:theme =@ style / AppTheme>
< activity
android:name =com.company.sqh.adio.MainActivity
android:icon =@ drawable / logo_remaking2>
< intent-filter>

< category android:name =android.intent.category.LAUNCHER/>
< / intent-filter>
< / activity>
< activity android:name =com.company.sqh.adio.registraion_form>
< intent-filter>

< category android:name =android.intent.category.DEFAULT/>
< / intent-filter>
< / activity>
< activity android:name =com.company.sqh.adio.contact_us>
< intent-filter>

< category android:name =android.intent.category.DEFAULT/>
< / intent-filter>
< / activity>
< activity android:name =com.company.sqh.adio.about_us>
< intent-filter>

< category android:name =android.intent.category.DEFAULT/>
< / intent-filter>
< / activity>
< activity android:name =com.company.sqh.adio.ProfileActivity/>


< category android:name =android.intent.category.DEFAULT/>

< activity android:name =com.company.sqh.adio.EmplyReg/>
< activity android:name =com.company.sqh.adio.SubCategory/>
< activity android:name =com.company.sqh.adio.User_Profile/>
< activity android:name =com.company.sqh.adio.Emp_list/>
< activity android:name =com.company.sqh.adio.Forgot_Pass/>

< meta-data
android:name =android.support.VERSION
android:value =26.1.0/> <! - 包含AdActivity和InAppPurchaseActivity configChanges和主题。 - >
< activity
android:name =com.google.android.gms.ads.AdActivity
android:configChanges =keyboard | keyboardHidden | orientation | screenLayout | uiMode | screenSize | smallestScreenSize
android:theme =@ android:style / Theme.Translucent/>
< activity
android:name =com.google.android.gms.ads.purchase.InAppPurchaseActivity
android:theme =@ style / Theme.IAPTheme/>
< activity
android:name =com.google.android.gms.common.api.GoogleApiActivity
android:exported =false
android:theme = @android:style / Theme.Translucent.NoTitleBar/>

< meta-data
android:name =com.google.android.gms.version
android:value =@ integer / google_play_services_version/>
< meta-data
android:name =android.arch.lifecycle.VERSION
android:value =27.0.0-SNAPSHOT/>
< / application>

< / manifest>

请检查


AndroidManifest.xml:15:错误:发现未知元素。

$ b $ b

标记错误。
$ b


为了改善增量资源处理,Android插件3.0.0 默认启用AAPT2。
在之前的AAPT版本中,嵌套在Android清单不正确节点中的元素会被忽略,或者会导致警告。

要解决该问题,请确保您的清单元素嵌套正确。有关更多信息,请阅读
清单文件结构


您必须修改您的Manifest:

 < action android:name =com.company.sqh.adio.ProfileActivity/> 
< category android:name =android.intent.category.DEFAULT/>

它们应该包含在< activity> 标签。



您可以阅读更多这里


Here's my debug\AndroidManifest.xml

Getting so many errors like

Element action is not allowed here.
Element category is not allowed here.
Attribute android:versionCode is not allowed here.
Attribute android:versionName is not allowed here.
Attribute android:theme is not allowed here. and so many.

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.company.sqh.adio"
        android:versionCode="1"
        android:versionName="1.0" >

        <uses-sdk
            android:minSdkVersion="16"
            android:targetSdkVersion="26" />

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

        <application
            android:allowBackup="true"
            android:debuggable="true"
            android:icon="@drawable/logo_remaking2"
            android:label="@string/label"
            android:supportsRtl="true"
            android:theme="@style/AppTheme" >
            <activity
                android:name="com.company.sqh.adio.MainActivity"
                android:icon="@drawable/logo_remaking2" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name="com.company.sqh.adio.registraion_form" >
                <intent-filter>
                    <action android:name="com.company.sqh.adio.registraion_form" />

                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </activity>
            <activity android:name="com.company.sqh.adio.contact_us" >
                <intent-filter>
                    <action android:name="com.company.sqh.adio.contact_us" />

                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </activity>
            <activity android:name="com.company.sqh.adio.about_us" >
                <intent-filter>
                    <action android:name="com.company.sqh.adio.about_us" />

                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </activity>
            <activity android:name="com.company.sqh.adio.ProfileActivity" />

            <action android:name="com.company.sqh.adio.ProfileActivity" />

            <category android:name="android.intent.category.DEFAULT" />

            <activity android:name="com.company.sqh.adio.EmplyReg" />
            <activity android:name="com.company.sqh.adio.SubCategory" />
            <activity android:name="com.company.sqh.adio.User_Profile" />
            <activity android:name="com.company.sqh.adio.Emp_list" />
            <activity android:name="com.company.sqh.adio.Forgot_Pass" />

            <meta-data
                android:name="android.support.VERSION"
                android:value="26.1.0" /> <!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. -->
            <activity
                android:name="com.google.android.gms.ads.AdActivity"
                android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
                android:theme="@android:style/Theme.Translucent" />
            <activity
                android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
                android:theme="@style/Theme.IAPTheme" />
            <activity
                android:name="com.google.android.gms.common.api.GoogleApiActivity"
                android:exported="false"
                android:theme="@android:style/Theme.Translucent.NoTitleBar" />

            <meta-data
                android:name="com.google.android.gms.version"
                android:value="@integer/google_play_services_version" />
            <meta-data
                android:name="android.arch.lifecycle.VERSION"
                android:value="27.0.0-SNAPSHOT" />
        </application>

    </manifest>

Please check this

解决方案

AndroidManifest.xml:15: error: unknown element found.

You have a misplaced tag.

To improve incremental resource processing, Android plugin 3.0.0 enables AAPT2 by default. In previous versions of AAPT, elements nested in incorrect nodes in the Android manifest are either ignored or result in a warning.
To resolve the issue, make sure your manifest elements are nested correctly. For more information, read Manifest file structure.

You have to modify your Manifest:

 <action android:name="com.company.sqh.adio.ProfileActivity" />         
 <category android:name="android.intent.category.DEFAULT" />

They should be included inside an <activity> tag.

You can read more here.

这篇关于AAPT2错误:检查日志以获取详细信息:未知元素&lt; action&gt;发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆