Search code examples
androidgradleandroid-manifestandroid-textinputlayout

gradle error when use TextInputLayout


I'm trying to use TextInputLayout but i am getting Manifest merger failed.this Causing to gradle error. following text to show gradle message:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:design:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:appcompat-v7:26.0.0-alpha1] AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:34 to override.

Projects minSdkVersion is 19, targetSdkVersion is 26 and compileSdkVersion is 26 with buildToolsVersion 25.0.2 and gradle dependencies in project is :

compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'

Solution

  • Ensure that both versions are the same:

    compile 'com.android.support:design:25.3.1' compile 'com.android.support:appcompat-v7:25.3.1'

    or

    compile 'com.android.support:design:26.0.0-alpha1' compile 'com.android.support:appcompat-v7:26.0.0-alpha1'