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

duplicate value for resource 'attr/strokeWidth' with config #16

Open
yehyatt opened this issue Oct 1, 2018 · 16 comments
Open

duplicate value for resource 'attr/strokeWidth' with config #16

yehyatt opened this issue Oct 1, 2018 · 16 comments

Comments

@yehyatt
Copy link

yehyatt commented Oct 1, 2018

When Updating to latest gradle and android studio
buildToolsVersion '28.0.3'
compileSdkVersion 28
targetSdkVersion 28
classpath 'com.android.tools.build:gradle:3.2.0'

@davidpini
Copy link

+1

1 similar comment
@kernelpanicsoft
Copy link

+1

@aliasgarlabs
Copy link

@yehyatt How did you fix the duplicate strokeWidth issue?

@yehyatt
Copy link
Author

yehyatt commented Jan 28, 2019

@aliasgarlabs I removed the library and its uses in my app

@aliasgarlabs
Copy link

@yehyatt I had to do the same thing

@lucianoborgesumovme
Copy link

Hi, I have the same problem. I've tried a lot of strategies. @yehyatt Could you detail a little bit more your answer - "I removed the library and its uses in my app" - for @aliasgarlabs ?
Did you remove from build.gradle as a lib and add again as an Android module?
Thanks

@Radwan43
Copy link

Radwan43 commented Apr 6, 2019

+1 anyone found a way to solve this ?

@lucianoborgesumovme
Copy link

I've tried to use androidx packages, last version of build tools and nothing changes the result, always the same problem

@Oleksandr1990
Copy link

Oleksandr1990 commented Jul 13, 2019

Created a temporary solution:
color-picker.zip
this lib can be imported this way:

  • add this file to your app/libs folder ( PROJECT_ROOT / app / libs)
  • update dependencies for app module:
    repositories { ... flatDir { dirs 'libs' } ... } dependencies { ... implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs') ... }
    there are other options to import aar - this one is provided as an example

I have just renamed attribute strokeWidth to customStrokeWidth and updated it in all places where it is used

@lucianoborgesumovme
Copy link

Hi @Oleksandr1990

Thanks by your answer. I've removed the remote lib and add the .aar as a local dependency (implementation files('libs/color-picker.aar'))

The build was done with success, but the "setOnColorChangedListener()" method from LineColorPicker was not found.

Could you help me about this issue?

Thank you so much,

Luciano Borges

@Oleksandr1990
Copy link

Oleksandr1990 commented Aug 25, 2019

Hi @lucianoborgesumovme!
Have you tried this step? Seems the lib isn't imported properly

update dependencies for app module:
repositories { ... flatDir { dirs 'libs' } ... } dependencies { ... implementation fileTree(include: ['.jar', '.aar'], dir: 'libs') ... }

or check this thread how to include aar manually:
https://stackoverflow.com/a/23326397

@lucianoborgesumovme
Copy link

Hi @Oleksandr1990
Yes, I did your steps. I've tried to add a lib through this line to: implementation files('libs/color-picker.aar'). Both doesn't work.
P.S. My class is written in Kotlin (but I belive that this is not the problem)
Thanks!

@Oleksandr1990
Copy link

Oleksandr1990 commented Aug 26, 2019

Hi @Oleksandr1990
Yes, I did your steps. I've tried to add a lib through this line to: implementation files('libs/color-picker.aar'). Both doesn't work.
P.S. My class is written in Kotlin (but I belive that this is not the problem)
Thanks!

@lucianoborgesumovme
Try to import lib this way:
implementation 'org.xdty.preference.colorpicker:color-picker:0.0.5@aar'

@lucianoborgesumovme
Copy link

@Oleksandr1990
This message was showed when I used your line above:
ERROR: Failed to resolve: org.xdty.preference.colorpicker:color-picker:0.0.5

@locofocos
Copy link

locofocos commented Apr 21, 2020

Many thanks to @Oleksandr1990 for the tip. That was the last blocker for a 4 am side project release, phew!

edit - see my fork and it's readme if you want an easier workaround

To give this workaround a bit more posterity than a zip file, if you want to recreate yourself:

Clone the color picker repo. Bump version from 0.0.5 to 0.0.6 (or whatever version you like). Replace all occurrences of strokeWidth to customStrokeWidth like @Oleksandr1990 said. There's a constant to rename too, may be needed, not sure.

Then run these commands in the color picker repo to install it into your local m2 repo:

gradlew clean
gradlew build -x lintVitalRelease -x lint
gradlew install
gradlew publishToMavenLocal

Then in the project where you consume it, add mavenLocal() as a repository in both places. See https://stackoverflow.com/a/39015691. Consume the new 0.0.6 version you made.

Poke me and ask me to publish my fork if I don't followup!

But definitely +1 to migrating to another color picker library. It probably would have been about the same amount of work as supporting this one.

@locofocos
Copy link

Here's my fork where I made this tweak: https://github.com/locofocos/ColorPicker The readme has some instructions on consuming it. Someone please feel free to publish this on maven central! TBH I'll probably switch to another color picker library that's still supported. Probably a better use of time than getting a fork published.

@xdtianyu if you're interested in maintaining this, I can tidy up my fork and submit a PR. Just let me know if you're still hanging around.

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

8 participants