添加ids.xml后清单合并失败

时间:2019-10-24 08:48:07

标签: android manifest

最初,我遇到如下问题:

  

/home/sibolang/.gradle/caches/transforms-2/files-2.1/97084f9b64d76326fce3b08d095f532d/jetified-library-0.0.2/res/values/values.xml:   AAPT:错误:内部元素必须是资源引用   或为空。

此错误将我链接到文件,其中包含错误/home/sibolang/.gradle/caches/transforms-2/files-2.1/97084f9b64d76326fce3b08d095f532d/jetified-library-0.0.2/res/values/values.xml :

<item name="animator" type="id">false</item>
    <item name="date_picker_day" type="id">false</item>
    <item name="date_picker_header" type="id">false</item>
    <item name="date_picker_month" type="id">false</item>
    <item name="date_picker_month_and_day" type="id">false</item>
    <item name="date_picker_year" type="id">false</item>
    <item name="day_picker_selected_date_layout" type="id">false</item>
    <item name="done" type="id">false</item>
    <item name="month_text_view" type="id">false</item>

我在stackoverflow中发现了我的第一个问题,以创建没有值的 ids.xml 包含资源项type =“ id”,因此我必须更改一些类似项:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:ns1="http://schemas.android.com/apk/res/android">
    <item name="animator" type="id" />
    <item name="cancel_button" type="id"/>
    <item name="date_picker_month_and_day" type="id"/>
    <item name="date_picker_year" type="id"/>
    <item name="day_picker_back" type="id"/>
    <item name="day_picker_forward" type="id"/>
    <item name="day_picker_pager" type="id"/>
    <item name="day_picker_selected_date_layout" type="id"/>
    <item name="done_button" type="id"/>
    <item name="month_text_view" type="id"/>
    <item name="date_picker_day" type="id" />
    <item name="date_picker_header" type="id" />
    <item name="date_picker_month" type="id" />
    <item name="done" type="id" />
</resources>

我做了那个改变。但是,我还有另一个无法构建项目的问题:

“清单合并失败,出现多个错误,请参阅日志”

你们都可以帮助我找到我的问题吗?谢谢。

我给我我的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.sinergi.sharemaster">

    <uses-permission android:key="android.permission.INTERNET" />
    <uses-permission android:key="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:key="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:key="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:key="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:key="android.permission.VIBRATE" />
    <uses-permission android:key="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:key="android.permission.RECORD_AUDIO" />
    <uses-permission android:key="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:key="com.android.alarm.permission.SET_ALARM" />
    <uses-permission android:key="com.google.android.apps.photos.permission.GOOGLE_PHOTOS" />
    <uses-permission android:key="com.android.launcher.permission.INSTALL_SHORTCUT" />
    <uses-permission android:key="com.android.launcher.permission.UNINSTALL_SHORTCUT" />
    <uses-permission android:key="android.permission.FOREGROUND_SERVICE"/>

    <uses-feature
        android:key="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:key="android.hardware.location.gps"
        android:required="false" />

    <application
        android:key=".CopyWrite"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:largeHeap="true"
        android:supportsRtl="true"
        tools:replace="android:theme"
        android:theme="@style/CopywriteTheme.ApiSpec.Branded">
        <meta-data
            android:key="android.app.default_searchable"
            android:value=".MainActivity" />

        <!-- List & Details -->
        <activity android:key="com.sinergi.sharemaster.acvities.MainActivity">
            <intent-filter>
                <action android:key="android.intent.action.MAIN" />
                <category android:key="android.intent.category.LAUNCHER" />
            </intent-filter>

            <intent-filter>
                <action android:key="android.intent.action.SEARCH" />
            </intent-filter>

            <meta-data
                android:key="android.app.searchable"
                android:resource="@xml/searchable" />

            <intent-filter>
                <action android:key="android.intent.action.SEND" />

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

                <data android:mimeType="*/*" />
            </intent-filter>
            <intent-filter>
                <action android:key="android.intent.action.SEND_MULTIPLE" />

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

                <data android:mimeType="*/*" />
            </intent-filter>

            <intent-filter>
                <action android:key="android.intent.action.VIEW" />

                <category android:key="android.intent.category.DEFAULT" />
                <category android:key="android.intent.category.BROWSABLE" />

                <data android:scheme="hashtag" />
            </intent-filter>


        </activity>
    </application>

</manifest>

0 个答案:

没有答案