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

Build error #9

Closed
ghost opened this issue Apr 5, 2019 · 6 comments
Closed

Build error #9

ghost opened this issue Apr 5, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Apr 5, 2019

Spec:
compileSdkVersion 28
minSdkVersion 19
targetSdkVersion 28

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:5:5-20:19 to override.

After add 'tools:replace="android:appComponentFactory"' to manifest
Manifest merger failed with multiple errors, see logs

@addisonElliott
Copy link
Owner

Thanks for posting the issue.

From a basic search, it seems to be because I use androidx rather than the support libraries. See here for more info: https://stackoverflow.com/questions/51742697/android-manifest-merger-fails-after-adding-dependency-com-google-android-materia

Are you able to upgrade to AndroidX? If not, what do you suggest I do to fix this problem in the library?

@addisonElliott
Copy link
Owner

addisonElliott commented Apr 5, 2019

I just remembered that a similar library ButterKnife uses AndroidX as well. Try adding android.useAndroidX=true in gradle.properties.

If that fixes your problem, then maybe I can include a note in the README.

@ghost
Copy link
Author

ghost commented Apr 5, 2019

thanks alot for you response.

Now, i still using kotlin without andoidx. i have not planning for upgrade to androidx.
And also have not suggestion about this issue.

@addisonElliott
Copy link
Owner

No problem. Did you try adding android.useAndroidX=true to your gradle.properties? Give that a try and report back to me first

If that doesn't work, let me experiment with a solution this weekend and get back to you.

Also, if you like this library (and assuming we can get it working for you), don't forget to star the repository! The stars will help others find & use this library.

@addisonElliott
Copy link
Owner

I've came up with a solution that will work for now.

I released a version of SegmentedButton that uses the Android support library rather than AndroidX. The version is 3.1.3-support. Change this in your Gradle file and it should work. I tested this on my machine using Android support library and Kotlin as well.

The README contains more information on this setup now as well. However, this approach is only temporary to give developers time to switch to AndroidX. With that in mind, I would recommend switching to AndroidX as soon as possible.

Closing this issue. Make a comment here if you're having issues and I'll re-evaluate.

@ghost
Copy link
Author

ghost commented Apr 7, 2019

thank very much for your solution and response.
Sorry, now i can't to contribution about this project. Hopefully in the future I can contribute
keep you the spirit

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

1 participant