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

Theme used in the library conflicts with others #68

Closed
lfdversluis opened this issue Oct 11, 2015 · 5 comments
Closed

Theme used in the library conflicts with others #68

lfdversluis opened this issue Oct 11, 2015 · 5 comments

Comments

@lfdversluis
Copy link

If you use this library you get an error that the app theme is already defined (in my own project). To fix this, you can for example add tools:replace="android:icon, android:label, android:theme, android:name" in your application tag in the manifest. However, this causes instability with other libraries such as com.daimajia.slider:library:1.1.5.

Giving the error

Caused by: android.view.InflateException: Binary XML file line #83: Error inflating class com.daimajia.slider.library.SliderLayout

Is there a way to make them all work happily together?

@avluis
Copy link

avluis commented Oct 30, 2015

Would love to get more info on this as I am attempting to use this library while getting the same errors as above.

@passy
Copy link
Owner

passy commented Oct 30, 2015

I have not run into this issue. Any input on how we can make this easier for users on the library site would be very welcome.

@AndreiD
Copy link

AndreiD commented Feb 18, 2016

`Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute application@theme value=(@style/AppTheme) from AndroidManifest.xml:15:7-38
is also present at [net.rdrei.android.dirchooser:library:3.2] AndroidManifest.xml:9:18-62 value=(@style/DirectoryChooserTheme).
Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:11:3-41:17 to override.`

@avluis
Copy link

avluis commented Mar 27, 2016

@passy

Just wanted to update this.

The issue is simple:
If your app and the library have anything that is incompatible by the merge tool, then you'll get this error.

The merge tool is complaining about the theme attribute value (@style/AppTheme) but when I quickly scan the library, I don't see it - so the error it throws is not helpful.
What is helpful is the suggestion.

It literally means just that - to override the manifest merge (which should fix the issue), add 'tools:replace="android:theme" to your tag.
That should let you compile.
If you still cannot compile, make sure you don't have any tools:ignore statements, that seems to break it - I'm referring to com.gu.option, even maven complains about it:

Not Found: /artifact/com.gu/option/1.3

@BraisGabin BraisGabin mentioned this issue Sep 21, 2016
3 tasks
@geeteshk
Copy link

Gentlemen I have found a workaround for those facing this issue. It seems to only show up when android:theme is set for the tag. Remove it and add it to each of your activities separately. Worked fine for me.

@passy passy closed this as completed in d3da68a Jan 21, 2018
passy added a commit that referenced this issue Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants