更改清单中的内容后无法启动应用程序

时间:2016-04-08 12:43:12

标签: android manifest

我试图向清单添加共享意图,但我做错了什么,现在当我删除我添加的内容后,我会在启动应用程序后不断回来。所以我不能像以前那样启动应用程序,如果需要,我可以添加更多代码或日志。我不知所措

我的文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="nl.drieo.soundwave.test.cms"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="18"
    android:targetSdkVersion="23" />

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

<activity
    android:name="nl.drieo.soundwave.test.cms.ShareActivity"
    android:label="@string/title_activity_share" >
    <intent-filter>
        <action android:name="android.intent.action.SEND" />

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

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

<application
    android:allowBackup="true"
    android:fullBackupContent="true"
    android:icon="@mipmap/ic_launcher"
    android:label="Multi-CMS"
    android:screenOrientation="portrait"
    android:supportsRtl="true"
    android:theme="@style/AppTheme.NoActionBar" >
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainActivity"
        android:label="Drie-O  CMS"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainAdministration"
        android:label="Administration"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainComponents"
        android:label="Components"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainUsers"
        android:label="Users"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainComp_Content"
        android:label="Content"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainComp_Label"
        android:label="Label"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainComp_Content_edit"
        android:label="EditContent"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar"
        android:windowSoftInputMode="stateHidden|adjustResize" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainComp_news"
        android:label="MainComp_news"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainComp_News_Edit"
        android:label="MainComp_news_edit"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar"
        android:windowSoftInputMode="stateHidden|adjustResize" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainComp_Label_edit"
        android:label="MainComp_news_edit"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar"
        android:windowSoftInputMode="stateHidden|adjustResize" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainComp_AgendaItem"
        android:label="MainComp_news_edit"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.MainComp_AgendaItem_edit"
        android:label="MainComp_news_edit"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar"
        android:windowSoftInputMode="stateHidden|adjustResize" />
    <activity
        android:name="nl.drieo.soundwave.test.cms.new_content_item"
        android:label="MainComp_news_edit"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.NoActionBar" />
</application>

启动时出现的错误:

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2320Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72320Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2320Library UP-TO-DATE
:app:prepareComAndroidSupportPercent2320Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72320Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42320Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2320Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest
:app:processDebugResources
C:\Users\r.devries\AndroidStudioProjects\CMS2\app\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error:(18, 24) No resource found that matches the given name (at 'label' with value '@string/title_activity_share').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\r.devries\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 1.166 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console

2 个答案:

答案 0 :(得分:3)

当您收到与清单绑定的构建错误,并双击构建输出中的错误时,Android Studio(通过2.0.0)将弹出 a 清单上的选项卡

不幸的是,这是错误的表现。

这是a long-standing bug in Android Studio,点击错误会打开一个生成的清单,该清单会混合模块清单,库,build.gradle等信息。如果您不介意,可以编辑此信息一旦你进行下一次构建,你的更改就会消失。

确保编辑真实模块清单文件。当您编辑生成的标签时,该标签将显示debug/AndroidManifest.xml之类的内容。

答案 1 :(得分:0)

找不到与给定名称匹配的资源('label'的值为'@string/title_activity_share') 请检查strings.xml中是否有title_activity_share项。