Attribute "tint" already defined with incompatible format - android

While build project it shows an error
Error:(676) Attribute "tint" already defined with incompatible format.
Error:(329) Original attribute defined here.
refering to values.xml file
" declare-styleable name="TintableImageView">attr format="reference|color" name="tint"/>/declare-styleable>" in "..\app\build\intermediates\res\merged\debug\values\values.xml" location
also in build.gradle showing
All com.android.support libraries must use the exact same version specification. Found version 27.0.2, 25.3.1. Examples include com.android.support:animated-vector-deawable:27.0.2 and com.android.support:customtabs:25.3.1
I am including 5 modules in my app as
compile project(path: ':RippleEffectlibrary')
compile project(path: ':crop_lib')
compile project(path: ':rangeseekbar')
compile project(path: ':simple-crop-image-lib')
compile project(path: ':infiniteviewpager')

Related

Attribute "background" already defined with incompatible format in Android Studio

I imported my project from Eclipse to Android Studio. As it is merging all the files, I am getting error : Attribute "background" already defined with incompatible format.Check my below libraries :
compile project(':staggeredGrid')
compile project(':mobikwikSDK')
compile 'com.android.support:support-v4:24.1.1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
I am new to Android Studio so I don't have any idea about how can I solved this. I tried to change that attribute name but there are many same names so I am unable to go ahead.Please help me to solve this.
ActionBarSherlock is deprecated so migrate to AppCompat
Remove
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
Add
compile 'com.android.support:appcompat-v7:24.1.1'

Attribute "title" has already been define when have android plot dependencies 1.0.0

every time i sync the gradle with compile 'com.androidplot:androidplot-core:1.0.0' i have an error of has already defined
The Error
Error:(309) Attribute "title" has already been defined
Error:(316) Attribute "titleTextColor" has already been defined
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Guren\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1
My Dependencies
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
// compile 'com.android.support:recyclerview-v7:23.4.0'
// compile 'com.android.support:cardview-v7:23.4.0'
//Material Acr Menu
compile 'com.androidplot:androidplot-core:1.0.0'
// ListView
// compile 'com.baoyz.swipemenulistview:library:1.3.0'
// MathView
compile 'io.github.kexanie.library:MathView:0.0.6'
// Tesseract - OCR
compile project(':libraries:tess-two')
// GraphView
// compile files('libs/GraphView-4.1.0.jar')
}
I was able to reproduce the problem by first creating a sample project that uses Androidplot and then creating my own attrs.xml that defines a styleable with a title attribute. This issue report provides some context on what's happening.
Most likely either your app or one of your other dependencies defines styleables in it's attrs.xml that reuse some one or more of the same attr names as androidplot.
There appears to be at least two solutions:
1 - Remove one of the dependencies that defines the duplicate attribute. (Not a very great solution)
-or-
2 - Update your build tools to 24.0.2:
android {
buildToolsVersion '24.0.2'
...
}
It's unfortunate that this is an issue at all given how styleable namespaces are applied, but at least it seems to be resolved in the latest build tools.

No resource found that matches the given name android studio

I don't have support library in my gradle, nor i used it anywhere in my app
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// testCompile 'junit:junit:4.12'
// compile 'com.android.support:appcompat-v7:23.3.0'
so why is it not letting me build? and generating this values.xml for no reason? i have tried restarting android studio already
Error:(7) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
uncomment this line
compile 'com.android.support:appcompat-v7:23.3.0'
It used in our project keep refernce to android internal stuff to support pervious version with new features.
Because when you create an new Project, it creates a new Theme under
res > value > styles.xml
that inherits from Theme.AppCompat.Light.DarkActionBar.
So, basically, you need to leave that import in your gradle file, or just remove your theme from the style.xmlfile and from yor Manifest.xml too

Updating play-services gives repeated resources error

I want to use the new Google Cloud Messaging's InstanceID from Google Play Services, and for that I need to update my play-services library.
This is my dependencies from build.dragle from the current version:
dependencies {
compile 'com.google.android.gms:play-services:6.1.+'
compile 'com.android.support:support-v4:23.1.+'
compile project(':slidingMenuLibrary')
compile 'joda-time:joda-time:2.6'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile files('libs/GraphView-3.1.1.jar')
compile files('libs/ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar')
compile files('libs/libphonenumber-7.0.1.jar')
compile files('libs/opencsv-2.4.jar')
compile files('libs/ormlite-android-4.46.jar')
compile files('libs/ormlite-core-4.46.jar')
compile files('libs/ormlite-jdbc-4.46.jar')
}
And heres is build.dragle from slidingMenuLibrary:
dependencies {
compile 'com.android.support:support-v4:23.1.+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
}
I updated my Google Play Services on Android SDK Manager to the last version. But when I change compile 'com.google.android.gms:play-services:6.1.+' to compile 'com.google.android.gms:play-services:8.1.0', Android Studio give a list of errors:
Error:(1) Attribute "titleTextStyle" has already been defined
C:\Users\Rui\AndroidStudioProjects\tk-main- repository\tkAndroid\src\main\res\values\colors.xml
Error:(1) Attribute "subtitleTextStyle" has already been defined
Error:(1) Attribute "divider" has already been defined
Error:(1) Attribute "background" has already been defined
Error:(1) Attribute "backgroundSplit" has already been defined
...
When I change back to play-services:6.1.+', all errors disappear.
I know that I have repeated attributes, but I can't understand where can I change them, or what to do to solve this...
any sugestions?
It is no longer recommended to use the full play-services dependency. Rather you should use the individual dependency that you require.
For GCM use:
compile 'com.google.android.gms:play-services-gcm:8.1.0'
See Table 1 in this document for the full list.

Already Defined Error when building with gradle

I imported an old project from ANT to Gradle. I included all libraries and tride build but i have problem:
E:\gradle\DriverClient\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-wallet\7.8.0\res\values\wallet_colors.xml
Error:(2) Attribute "titleTextStyle" has already been defined
Error:(2) Attribute "subtitleTextStyle" has already been defined
Error:(2) Attribute "divider" has already been defined
Error:(2) Attribute "background" has already been defined
Error:(2) Attribute "backgroundSplit" has already been defined
Error:(2) Attribute "navigationMode" has already been defined
Error:(2) Attribute "displayOptions" has already been defined
.............................
I do not understand what is wrong. Here are my Gradle dependencies -
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile 'com.larswerkman:HoloColorPicker:1.5'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
}
You can't use appcompat library and ActionBarSherlock together because they are using the same attrs.
I suggest you using the appcompat library since abs was deprecated about two years ago,not updated and out of mantenaince.
Try to remove
compile 'com.google.android.gms:play-services:7.8.0'
Hope it helps :)

Categories

Resources