Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library is having application icon and theme #43

Open
Raghuramchowdary-tech opened this issue Nov 5, 2014 · 5 comments
Open

Library is having application icon and theme #43

Raghuramchowdary-tech opened this issue Nov 5, 2014 · 5 comments

Comments

@Raghuramchowdary-tech
Copy link

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

<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

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
@curtinmartis
Copy link

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
Copy link
Author

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" [email protected] 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
):

<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
#43 (comment)
.

@curtinmartis
Copy link

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

@Raghuramchowdary-tech
Copy link
Author

alright thanks.

good day
On 5 Nov 2014 14:16, "curtinmartis" [email protected] 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
#43 (comment)
.

@ghost
Copy link

ghost commented Apr 2, 2015

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants