Material-dialogs: Update to Support Library 27.0.0

Created on 1 Sep 2017  路  34Comments  路  Source: afollestad/material-dialogs

  • [x] I have verified there are no duplicate active or recent bugs, questions, or requests
  • [X] I have verified that I am using the latest version of Material Dialogs.
  • [X] I have given my issue a non-generic title.
  • [X] I have read over the documentation (before asking questions on how to do something).
Include the following:
  • Material Dialogs version: 0.9.4.7
improvement

Most helpful comment

@P-Zenker It's working solution but to keep transitive dependencies (and to avoid an explicit dependency on me.zhanghai.android.materialprogressbar:library:1.4.1) you can use the following approach:

implementation("com.afollestad.material-dialogs:core:0.9.4.7") {
    exclude group: 'com.android.support', module: 'support-v13'
}

All 34 comments

I have this issue too

this issue can have more info from @farsiad and @pooya1366
I say because I don't have a problem, I using
support-v4:26.0.2 and support-v13:26.0.2
and only using material-dialogs for progress dialogs.
So extra info from what is the problem and how it happens, will probably help.

I'm getting the same issue. I'm using support libraries version 26.0.2. When syncing Gradle, I get the following error:

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

Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:preference-v14:26.0.2] AndroidManifest.xml:25:13-35
is also present at [com.android.support:support-v13:26.0.1] AndroidManifest.xml:28:13-35 value=(26.0.1).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:23:9-25:38 to override.

As a followup, if I change the tag to the latest commit, it works (that is, if I do this: implementation 'com.afollestad.material-dialogs:core:fdec81d') . Did you create a new release when you made the latest changes and commit? if not, jitpack won't compile and package any changes.

Here's the last jitpack log:

Build starting...
Start: Thu Aug 17 16:44:32 UTC 2017
Git:
0.9.4.7
commit a29c038520970fb3d1336e1ac5d534c61305f283
Author: Aidan Follestad
Date: Thu Aug 17 10:54:17 2017 -0500

0.9.4.7

Notice it shows Aug. 17 for the build, which means it hasn't packaged any of your commits to a new aar since that date.

Well, you shouldn't really be using JitPack.

But yes, this is expected. Your app has to use the same version of the Support libs that this library does.

Yeah see, here's the thing, Here's my repositories, in order:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
}

Even using jcenter first, I still get this error
Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:preference-v14:26.0.2] AndroidManifest.xml:25:13-35
is also present at [com.android.support:support-v13:26.0.1] AndroidManifest.xml:28:13-35 value=(26.0.1).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:23:9-25:38 to override.

So I have to use this to get it to work:
implementation 'com.afollestad.material-dialogs:core:fdec81d'

@DesigningKnights yep, again, that's expected. Dependencies merge their manifests with your app, the two support library versions are trying to merge a value in your app manifest that have different values.

Ah, here's the problem. Look at the date at jcenter.

Version Publication Date Version Badge
Released Aug 17, 2017

It doesn't show anything updated, so it's still pulling the old version from jcenter.

You can exclude sub-dependencies from a dependency in your build.gradle file.

yes, true, but it would be better if jcenter was actually distributing the current build, would it not?

maven-metadata.xml | 22 days ago | 971 B | 聽
-- | -- | -- | --
maven-metadata.xml.md5 | 22 days ago | 32 B

.. | - | - | 聽
-- | -- | -- | --
core-0.9.4.7-javadoc.jar | 22 days ago | 119.9 KB | 聽
core-0.9.4.7-javadoc.jar.md5 | 22 days ago | 32 B | 聽
core-0.9.4.7-sources.jar | 22 days ago | 37.37 KB | 聽
core-0.9.4.7-sources.jar.md5 | 22 days ago | 32 B | 聽
core-0.9.4.7.aar | 22 days ago | 116.3 KB | 聽
core-0.9.4.7.aar.md5 | 22 days ago | 32 B | 聽
core-0.9.4.7.pom | 22 days ago | 1.39 KB | 聽
core-0.9.4.7.pom.md5 | 22 days ago | 32 B

@DesigningKnights I have not published a new release to jcenter. The current release as listed in the README is 0.9.4.7, https://github.com/afollestad/material-dialogs/releases/tag/0.9.4.7.

That explains the problem then.

Now I understand way this did not cause problem on one of my apps... as I use support-v4 and support-v13 for others things the build error/warning is not present. But on another app of my I don't use support-vX and get the error if I update others support related as "appcompat, cardview or recyclerview"

adding

api 'com.android.support:support-v4:26.1.0'
api 'com.android.support:support-v13:26.1.0'

to gradle dependencies fix the problem, did not notice any size difference on the apk, probably because proguard.

So minor workaround may help someone to use latest support libs, particularly I don't see a problem on dialogs or anywhere in the app
:+1:

latest support is 26.1.0 now.

I have same problem now:
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.1.0) from [com.android.support:design:26.1.0] AndroidManifest.xml:28:13-35 is also present at [com.android.support:support-v13:26.0.1] AndroidManifest.xml:28:13-35 value=(26.0.1). Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.

That's expected.

So, no have solution?

yes the solution is described on the issue, just add/compile the dependency even if you don't use it, so all are on the same version, at least it works for me as I post before.

Oh now i see. Thank so much.

I'm so sorry, but I still can't get this to work.
I'm using v26.1.0 of appcompat etc. but still get the error.
You say "just add/compile the dependency even if you don't use it..."
Where? Which dependency?
Sorry, I'm lost...

Edit:
Ok, so am I correct in saying that the current library only works with AppCompat 26.0.1?
And this issue is that it still needs to be updated to 26.1.0?

Until material-dialogs support libs are updated to v26.1.0, just try something like this:

With ./gradlew -q dependencies app:dependencies --configuration compile you see all dependencies of all packages, e.g.

|    +--- com.afollestad.material-dialogs:core:0.9.4.7
|    |    +--- com.android.support:support-annotations:26.0.1 -> 26.1.0
|    |    +--- com.android.support:support-v13:26.0.1
|    |    |    +--- com.android.support:support-annotations:26.0.1 -> 26.1.0
|    |    |    \--- com.android.support:support-v4:26.0.1 -> 26.1.0 (*)
|    |    +--- com.android.support:appcompat-v7:26.0.1 -> 26.1.0 (*)
|    |    +--- com.android.support:recyclerview-v7:26.0.1 -> 26.1.0 (*)
|    |    \--- me.zhanghai.android.materialprogressbar:library:1.4.1
|    |         +--- com.android.support:appcompat-v7:25.3.1 -> 26.1.0 (*)
|    |         \--- com.android.support:support-annotations:25.3.1 -> 26.1.0

Just add the top level dependencies from "com.afollestad.material-dialogs" and "me.zhanghai.android.materialprogressbar" manually:

compile 'com.android.support:support-annotations::26.1.0'
compile 'com.android.support:support-v13:26.1.0'
...

compile('com.afollestad.material-dialogs:core:0.9.4.7') {
    transitive = false
}
compile('me.zhanghai.android.materialprogressbar:library:1.4.1') {
    transitive = false
}

However, errors may be caused ;)

I had the same issue with Manifest Merging but when I downgraded to
implementation 'com.afollestad.material-dialogs:core:0.9.4.5'
all the problems solved completely. i think it's an issue with the new version (0.9.4.7);

I solved with making downgrade.

@P-Zenker It's working solution but to keep transitive dependencies (and to avoid an explicit dependency on me.zhanghai.android.materialprogressbar:library:1.4.1) you can use the following approach:

implementation("com.afollestad.material-dialogs:core:0.9.4.7") {
    exclude group: 'com.android.support', module: 'support-v13'
}

@vnidens Yes, that is a smart approach

If you want to use the latest library version while running the latest android support library version (since 0.9.4.7 uses android support library 26.0.1), put this in your build.gradle file
```// Material dialog
final MATERIAL_DIALOG_LIB_VERSION = '0.9.4.7'
compile ("com.afollestad.material-dialogs:core:$MATERIAL_DIALOG_LIB_VERSION") {
exclude group: 'com.android.support'
}

The goal should be to just _update_ the support library dependencies in material-dialogs, not _downgrading_ the app's support lib version or making other workarounds.

For now I guess the right way as described in the gradle docs is not to use exclude but to work around it usinng a resolution strategy like this:

configurations.all {
    resolutionStrategy.force 'com.android.support:support-v13:26.1.0'
}

That'll resolve the dependency conflict but doesn't exclude the whole _support-v13_ dependency from the classpath. Instead it loads the correct version.

Anyway, looking forward to material-dialogs being updated to support lib 26.1.0!

I'm doing it this way and it's working.

compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:support-compat:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
// ... other dependencies here
compile ('com.afollestad.material-dialogs:commons:0.9.4.7') {
    exclude group: 'com.android.support'
}

this project depend on the AndroidX,and maybe your project also use the support library,and it makes the confict

if i use the support library ,don't use AndroidX,so i can't use material-dialogs?

@aloneSingingStar nope - the Support Library is deprecated by Google.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MFlisar picture MFlisar  路  3Comments

Supercaly picture Supercaly  路  3Comments

jahirfiquitiva picture jahirfiquitiva  路  6Comments

dabo248 picture dabo248  路  7Comments

SixianOne picture SixianOne  路  5Comments