I want to connect the compile 'me.grantland library: autofittextview: 0.2. +' In the project for the phone and for the clock. Accordingly, I in the gradle (phone) I connect this library and in the gradle (wear) I also connect and get an error

Error:(148) Attribute "minTextSize" has already been defined 

Those. the same attribute is duplicated. How can this duplication be avoided?

wear.gradle

 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.project" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.support:wearable:1.3.0' compile 'com.google.android.gms:play-services-wearable:8.4.0' compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1' } 

phone.gradle

 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.project" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.google.android.gms:play-services:8.4.0' //facebook sdk compile 'com.facebook.android:facebook-android-sdk:4.6.0' //MY DEPENDENCIES: //Profress bar's compile 'com.github.lzyzsd:circleprogress:1.1.0@aar' //Auto resize text in TextView compile 'me.grantland:autofittextview:0.2.+' } 

project.gradle

 buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.5.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 
  • Is the project compiled? show the part of the class code where you define minTextSize - miha_dev
  • @miha_dev I’m not defining it anywhere, no, it doesn’t compile because when I connect, it gives an error and the project is not going to! - Kirill Stoianov
  • Try to remove the wear file. Do you use this library in the xml markup file? - miha_dev
  • @miha_dev in the sense of clean? I want to add it back there. Yes, I want to use it in xml! - Kirill Stoianov
  • one
    I would write my class a successor to TextView , in it I redefined the onMeasure method. from there would take the width of the container. would get the text getText() and measure its length with Paint mTextPaint = new Paint(); ... mTextPaint.measureText(mText); Paint mTextPaint = new Paint(); ... mTextPaint.measureText(mText); and already if the width is less than the length of the text consistently reduced the size of the font mTextPaint.setTextSize(float newValue) - miha_dev

0