twotoasters / clusterkraf

A clustering library for the Google Maps Android API v2
Apache License 2.0
255 stars 57 forks source link

Library is having application icon and theme #43

Open Raghuramchowdary-tech opened 9 years ago

Raghuramchowdary-tech commented 9 years ago

As the main application will already have application icon and theme in place. While building the app fails with following

Error:(39, 9) Attribute application@icon value=(@drawable/launcher_icon) from AndroidManifest.xml:39:9 Error:(41, 9) Attribute application@theme value=(@style/Theme.rctheme) from AndroidManifest.xml:41:9 is also present at com.twotoasters.clusterkraf:library:1.0.2:5:115 value=(@style/AppTheme) Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:37:5 to override Error:Execution failed for task ':handset:processDebugManifest'.

Manifest merger failed with multiple errors, see logs

Possible Resolution replace the manifest

current one

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.twotoasters.clusterkraf" android:versionCode="3" android:versionName="1.0.2" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
</application>

new one

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.twotoasters.clusterkraf" android:versionCode="3" android:versionName="1.0.2" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

curtinmartis commented 9 years ago

The problem is that you are setting a theme, but the library also has a theme set. If you look in your log you'll see this line:

Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:37:5 to override

This is saying that you need to add that metadata to your application's manifest, and it will force your theme to override the current one when the manifests are merged.

Here's an example from the Android documentation (http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger):

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.tests.flavorlib.app"
    xmlns:tools="http://schemas.android.com/tools">

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        tools:replace=”icon, label”/>
</manifest>

You need to use tools:replace=android:theme, rather than icon, label.

Raghuramchowdary-tech commented 9 years ago

I do understand that but is it for any specific reason u have got app icon for a library? On 5 Nov 2014 14:09, "curtinmartis" notifications@github.com wrote:

The problem is that you are setting a theme, but the library also has a theme set. If you look in your log you'll see this line:

Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:37:5 to override

This is saying that you need to add that metadata to your application's manifest, and it will force your theme to override the current one when the manifests are merged.

Here's an example from the Android documentation ( http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger ):

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.tests.flavorlib.app" xmlns:tools="http://schemas.android.com/tools">

<application
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    tools:replace=”icon, label”/>

You need to use tools:replace=android:theme, rather than icon, label.

— Reply to this email directly or view it on GitHub https://github.com/twotoasters/clusterkraf/issues/43#issuecomment-61811533 .

curtinmartis commented 9 years ago

It likely was added by default when the library project was created, but never removed.

Raghuramchowdary-tech commented 9 years ago

alright thanks.

good day On 5 Nov 2014 14:16, "curtinmartis" notifications@github.com wrote:

It likely was added by default when the library project was created, but never removed.

— Reply to this email directly or view it on GitHub https://github.com/twotoasters/clusterkraf/issues/43#issuecomment-61812507 .

ghost commented 9 years ago

@curtinmartis You should not package "sample" module when building library .aar. A Library is not supposed to inject redundant/sample resources, styles, manifests and themes into library's user's projects.

There must be a way to ignore a certain module when packaging with Gradle.