It looks like there is a feature in Android manifest merging code that
allows consuming apps to specify either tools:merge="override|remove".
Declare the header of your manifest as follows:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
Then, use one of the following appropriate attributes on any activity,
activity-alias, service, receiver, or provider element that you want to
merge:
tools:merge="override"
tools:merge="remove"
This info was gleaned from:
https://android.googlesource.com/platform/tools/base/+/idea133/build-system/manifest-merger/src/main/java/com/android/manifmerger/ManifestMerger.java
Pv
On Thursday, September 5, 2013 4:37:18 PM UTC-7, Traun Leyden wrote:
>
>
> Nevermind. Looks like this was a bug on my end, and things are now
> working.
>
> On Wednesday, September 4, 2013 11:30:35 AM UTC-7, Traun Leyden wrote:
>>
>>
>> Just a follow up on this - have there been any changes that might have
>> fixed this?
>>
>> Anything I can do to help reproduce the issue?
>>
>> On Thursday, July 18, 2013 12:06:37 AM UTC-7, Traun Leyden wrote:
>>>
>>>
>>> I dug into it further and figured out why that unwanted activity is
>>> there.
>>>
>>> Here is the original manifest in the
>>> 'com.couchbase.cblite:CBLiteEktorp:0.7.4' library dependency source code:
>>>
>>> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
>>> package="com.couchbase.cblite"
>>> android:versionCode="1"
>>> android:versionName="1.0">
>>>
>>> *<application/>*
>>>
>>> </manifest>
>>>
>>> if I remove the <application/> element and try to build a "wrapper"
>>> project which directly uses this library, I get the following error:
>>>
>>> [AndroidManifest.xml:1] Could not find element /manifest/application.
>>> :CBLiteEktorp:processDebugManifest FAILED
>>>
>>> FAILURE: Build failed with an exception.
>>>
>>> * What went wrong:
>>> Execution failed for task ':CBLiteEktorp:processDebugManifest'.
>>> > Manifest merging failed. See console for more info.
>>>
>>>
>>> and according to this Stack Overflow
>>> post<http://stackoverflow.com/questions/16987512/building-android-studio-project-with-holoeverywhere-fails>,
>>>
>>> the workaround you recommended for this error is to add the <application/>
>>> element. (which in my case, leads to the double-icons issue originally
>>> reported)
>>>
>>> Is there a way to remove the <application/> element from a library
>>> manifest in such a way that it will still build?
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Jul 17, 2013 at 11:10 PM, Traun Leyden <> wrote:
>>>
>>>> Ah, I see it now, I didn't think to look there. The bug is definitely
>>>> on our end. Thanks!
>>>>
>>>>
>>>> On Wed, Jul 17, 2013 at 5:59 PM, Xavier Ducrohet <> wrote:
>>>>
>>>>> This other activity is coming from
>>>>> your 'com.couchbase.cblite:CBLiteEktorp:0.7.4' dependency.
>>>>>
>>>>>
>>>>> On Tue, Jul 16, 2013 at 7:11 PM, Traun Leyden <> wrote:
>>>>>
>>>>>>
>>>>>> An app with only maven artifact dependencies is ending up with two
>>>>>> icons.
>>>>>>
>>>>>> Here is the manifest that is generated in
>>>>>> build/manifests/debug/AndroidManifest.xml:
>>>>>>
>>>>>> <activity android:label="@string/app_name"
>>>>>> android:name="com.couchbase.grocerysync.MainActivity">
>>>>>> <intent-filter>
>>>>>> <action android:name="android.intent.action.MAIN"/>
>>>>>>
>>>>>> <category
>>>>>> android:name="android.intent.category.LAUNCHER"/>
>>>>>> </intent-filter>
>>>>>> </activity>
>>>>>> <activity
>>>>>> android:name="com.couchbase.grocerysync.GrocerySyncPreferencesActivity">
>>>>>> </activity>
>>>>>> * <activity android:label="@string/app_name"
>>>>>> android:name="com.couchbase.cblite.MainActivity">*
>>>>>> * <intent-filter>*
>>>>>> * <action android:name="android.intent.action.MAIN"/>*
>>>>>> * <category
>>>>>> android:name="android.intent.category.LAUNCHER"/>*
>>>>>> * </intent-filter>*
>>>>>> * </activity>*
>>>>>>
>>>>>> the activity for com.couchbase.cblite.MainActivity should not be
>>>>>> included, and seems to be included due to a bug (or misunderstanding).
>>>>>>
>>>>>> The original manifest for that maven artifact is in
>>>>>> build/exploded-bundles/ComCouchbaseCbliteCBLite072.aar/AndroidManifest.xml:
>>>>>>
>>>>>> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
>>>>>> android:versionCode="1" android:versionName="1.0"
>>>>>> package="com.couchbase.cblite">
>>>>>> <uses-sdk android:minSdkVersion="7"
>>>>>> android:targetSdkVersion="16"/>
>>>>>> <uses-permission android:name="android.permission.INTERNET"/>
>>>>>> </manifest>
>>>>>>
>>>>>>
>>>>>>
>>>>>> and there is no such class com.couchbase.cblite.MainActivity in the
>>>>>> classes.jar (although there used to be at one point in previous versions
>>>>>> of
>>>>>> that artifact)
>>>>>>
>>>>>> I've included the entire project here:
>>>>>> GrocerySyncAndroid.tar.gz<http://cl.ly/3q413g250I1N/download/GrocerySync-Android.tar.gz>
>>>>>>
>>>>>> and the build output from "./gradlew --debug build" is in
>>>>>> build_output.txt inside the .gz file
>>>>>>
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "adt-dev" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected] <javascript:>.
>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Xavier Ducrohet
>>>>> Android SDK Tech Lead
>>>>> Google Inc.
>>>>> http://developer.android.com | http://tools.android.com
>>>>>
>>>>> Please do not send me questions directly. Thanks!
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "adt-dev" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to .
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.