2

I am facing problem as Manifest Merging problem with FBReader third party library. I tried all the solutions available on StackOverflow, but it doesn't helped me. Please suggest me solution regarding the same. Please have a look on my Manifest file and Error below:

Manifest:

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

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

    <application
        tools:replace="android:icon, android:label, android:theme"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".xxxxxxxxxxxx"
            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=".TestAcitivity"
            android:label="@string/title_activity_test_acitivity"
            android:theme="@style/AppTheme.NoActionBar"></activity>




        <activity
            android:name="org.geometerplus.android.fbreader.crash.FixBooksDirectoryActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":crash"
            android:theme="@style/FBReader.Dialog" >
            <intent-filter>
                <action android:name="android.fbreader.action.CRASH" />

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

                <data android:scheme="CachedCharStorageException" />
            </intent-filter>
        </activity>
        <activity
            android:name="org.geometerplus.android.fbreader.crash.MissingNativeLibraryActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":crash"
            android:theme="@style/FBReader.Dialog" >
            <intent-filter>
                <action android:name="android.fbreader.action.CRASH" />

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

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

        <service
            android:name="org.geometerplus.android.fbreader.api.ApiService"
            android:exported="false"
            android:launchMode="singleTask" >
            <intent-filter>
                <action android:name="android.fbreader.action.API" />

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

        <!--<activity
            android:name="com.artifex.mupdfdemo.ScreenShotsActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" >
        </activity>-->
        <activity
            android:name="org.geometerplus.android.fbreader.SpeakActivity"
            android:configChanges="orientation|keyboardHidden"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Light.Panel" />
        <activity
            android:name="org.geometerplus.android.fbreader.FBReader"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:icon="@drawable/app_icon"
            android:label="Rockstand"
            android:launchMode="singleTask"
            android:theme="@style/FBReader.Activity" >
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />
        </activity>
        <activity android:name="org.geometerplus.android.fbreader.DictionaryBrowser" />
        <activity
            android:name="org.geometerplus.android.fbreader.CancelActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FBReader.Dialog" />
        <activity
            android:name="org.geometerplus.android.fbreader.style.StyleListActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FBReader.Dialog" />
        <activity
            android:name="org.geometerplus.android.fbreader.style.EditStyleActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FBReader.Dialog" />
        <activity
            android:name="org.geometerplus.android.fbreader.image.ImageViewActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FBReader.Activity" />
        <!-- android:process=":imageView" -->
        <service
            android:name="org.geometerplus.android.fbreader.libraryService.LibraryService"
            android:exported="false"
            android:launchMode="singleTask"
            android:process=":libraryService" >
            <intent-filter>
                <action android:name="android.fbreader.action.LIBRARY_SERVICE" />
            </intent-filter>
        </service>

        <activity
            android:name="org.geometerplus.android.fbreader.library.BookInfoActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":library"
            android:theme="@style/FBReader.Activity" />
        <activity
            android:name="org.geometerplus.android.fbreader.library.LibrarySearchActivity"
            android:process=":library"
            android:theme="@android:style/Theme.NoDisplay" >
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />
        </activity>
        <activity
            android:name="org.geometerplus.android.fbreader.library.LibraryActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:launchMode="singleTask"
            android:process=":library"
            android:theme="@style/FBReader.Activity" >
            <meta-data
                android:name="android.app.default_searchable"
                android:value="org.geometerplus.android.fbreader.library.LibrarySearchActivity" />
        </activity>
        <activity
            android:name="org.geometerplus.android.fbreader.TOCActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FBReader.Activity" />
        <activity
            android:name="org.geometerplus.android.fbreader.BookmarksActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FBReader.Activity" >
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />
        </activity>
        <activity
            android:name="org.geometerplus.android.fbreader.BookmarkEditActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FBReader.Dialog" />
        <activity
            android:name="org.geometerplus.android.fbreader.preferences.PreferenceActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FBReader.Activity" />
        <activity
            android:name="org.geometerplus.android.fbreader.preferences.EditBookInfoActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":library"
            android:theme="@style/FBReader.Activity" />
        <activity
            android:name="org.geometerplus.android.fbreader.network.BookDownloader"
            android:process=":networkLibrary"
            android:theme="@android:style/Theme.NoDisplay" >
        </activity>

        <service
            android:name="org.geometerplus.android.fbreader.network.BookDownloaderService"
            android:launchMode="singleTask"
            android:process=":networkLibrary" />

        <activity
            android:name="org.geometerplus.android.fbreader.network.NetworkSearchActivity"
            android:process=":networkLibrary"
            android:theme="@android:style/Theme.NoDisplay" >
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />
        </activity>
        <activity
            android:name="org.geometerplus.android.fbreader.network.NetworkLibraryPrimaryActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:launchMode="singleTask"
            android:process=":networkLibrary"
            android:theme="@style/FBReader.Activity" >
        </activity>
        <activity
            android:name="org.geometerplus.android.fbreader.network.NetworkLibrarySecondaryActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":networkLibrary"
            android:theme="@style/FBReader.Activity" />
        <activity
            android:name="org.geometerplus.android.fbreader.network.AuthenticationActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":networkLibrary"
            android:theme="@style/FBReader.Dialog" />
        <activity
            android:name="org.geometerplus.android.fbreader.network.BuyBooksActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":networkLibrary"
            android:theme="@style/FBReader.Dialog" />
        <activity
            android:name="org.geometerplus.android.fbreader.network.AddCatalogMenuActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":networkLibrary"
            android:theme="@style/FBReader.Dialog" />
        <activity
            android:name="org.geometerplus.android.fbreader.network.AddCustomCatalogActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":networkLibrary"
            android:theme="@style/FBReader.Dialog" >
        </activity>
        <activity
            android:name="org.geometerplus.android.fbreader.network.AuthorizationMenuActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":networkLibrary"
            android:theme="@style/FBReader.Dialog" />
        <activity
            android:name="org.geometerplus.android.fbreader.network.TopupMenuActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":networkLibrary"
            android:theme="@style/FBReader.Dialog" />
        <activity
            android:name="org.geometerplus.android.fbreader.network.NetworkBookInfoActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:process=":networkLibrary"
            android:theme="@style/FBReader.Activity" >
        </activity>
        <!--<activity
            android:name="com.artifex.mupdfdemo.MuPDFActivity"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" >
        </activity>-->

        <receiver
            android:name="org.geometerplus.android.fbreader.network.ListenerCallback"
            android:process=":networkLibrary" >
            <intent-filter>
                <action android:name="android.fbreader.action.network.SIGNIN" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </receiver>
    </application>

</manifest>

Error Log:

/Users/sanatpandey/Desktop/Rockstand 2/app/src/main/AndroidManifest.xml:85:13-46 Error:
    Attribute activity#org.geometerplus.android.fbreader.FBReader@icon value=(@drawable/app_icon) from AndroidManifest.xml:85:13-46
    is also present at [Rockstand 2:FBReader:unspecified] AndroidManifest.xml:107:13-46 value=(@drawable/fbreader).
    Suggestion: add 'tools:replace="android:icon"' to <activity> element at AndroidManifest.xml:82:9-96:20 to override.
/Users/sanatpandey/Desktop/Rockstand 2/app/src/main/AndroidManifest.xml:86:13-38 Error:
    Attribute activity#org.geometerplus.android.fbreader.FBReader@label value=(Rockstand) from AndroidManifest.xml:86:13-38
    is also present at [Rockstand 2:FBReader:unspecified] AndroidManifest.xml:108:13-37 value=(FBReader).
    Suggestion: add 'tools:replace="android:label"' to <activity> element at AndroidManifest.xml:82:9-96:20 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:app:processDebugManifest FAILED
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
Information:BUILD FAILED
Information:Total time: 28.892 secs
Information:1 error
Information:0 warnings

Thanks in advance

1 Answer 1

2

You do not appear to have followed the instructions from the error log. Your only tools:replace is on the <application> node. The instructions from the error log tell you to also have tools:replace on the <activity> node for the FBReader activity, set to block android:label and android:icon.

1
  • This also resolved my issue where I was thrown an error saying: Multiple entries with same key: @android:theme=REPLACE and android:theme=REPLACE
    – Raymond
    Aug 15, 2016 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.