Already Defined Error when building with gradle - android

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 :)

Related

Error:(155) Original attribute defined here, in Android Studio 2.3.1

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:preference-v7:25.3.1'
compile 'com.google.code.findbugs:jsr305:3.0.0'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'ch.acra:acra:4.9.2'
compile 'com.github.yukuku:ambilwarna:2.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
}
This is gradle dependencies code. I am getting such type of errors.
When i click on this error then code is showing .cannot find decleration of element 'recources'.
D:\AndroidProjects\Tech\app\build\intermediates\res\merged\debug\values\values.xml
Error:(360) Attribute "navigationMode" already defined with incompatible format.
Error:(155) Original attribute defined here.
Error:(367) Attribute "displayOptions" already defined with incompatible format.
Error:(687) Attribute "backgroundTintMode" already defined with incompatible format.
Error:(367) Attribute "displayOptions" already defined with incompatible format.
Error:(360) Attribute "navigationMode" already defined with incompatible format.
Error:(419) Attribute "actionBarSize" already defined with incompatible format.
Error:(70) Original attribute defined here.
Error:(482) Attribute "buttonTintMode" already defined with incompatible format.
Error:(7) Original attribute defined here.
Error:(102) Original attribute defined here.
Error:(576) Attribute "showDividers" already defined with incompatible format.
Error:(360) Attribute "navigationMode" already defined with incompatible format.
Error:(184) Original attribute defined here.
Error:(601) Attribute "showAsAction" already defined with incompatible format.
Error:(191) Original attribute defined here.
Error:(52) Original attribute defined here.
Error:(155) Original attribute defined here.
Error:(102) Original attribute defined here.
Error:(419) Attribute "actionBarSize" already defined with incompatible format.
Error:(7) Original attribute defined here.
Error:(482) Attribute "buttonTintMode" already defined with incompatible format.
Error:(70) Original attribute defined here.
Error:(576) Attribute "showDividers" already defined with incompatible format.
Error:(191) Original attribute defined here.
Error:(601) Attribute "showAsAction" already defined with incompatible format.
Error:(184) Original attribute defined here.
Error:(687) Attribute "backgroundTintMode" already defined with incompatible format.
Error:(52) Original attribute defined here.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
You have the same property name as the other controls, and modify the name of the property of your custom control.

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.

Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'

Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
The above error pops up everywhere when I add a Google Maps Activity to a basic Parse.com Note App.
Set your compile and target version to 19 and your min SDK to whatever version you need.
Next you have to adjust your imports to the version that is compatible with the SDKs that you have chosen to compile for. For example if you want to use the v7 support library on sdk 19 you must import it like this: compile compile 'com.android.support:appcompat-v7:20.+'
The Google Map Activity updated the build.gradle file. The following dependencies fixed the issue:
dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile files('libs/Parse-1.5.1.jar')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.google.android.gms:play-services:7.3.0'
}

Integrating ASNE adding to build.gradle

I am new with Android Studio and gradle. I am trying to integrate ASNE via gradle adding in build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.github.asne:asne-facebook:0.2.1'
compile 'com.github.asne:asne-twitter:0.2.0'
compile 'com.github.asne:asne-googleplus:0.2.1'
compile 'com.github.asne:asne-linkedin:0.2.1'
compile 'com.github.asne:asne-instagram:0.2.1'
compile 'com.github.asne:asne-vk:0.2.1'
compile 'com.github.asne:asne-odnoklassniki:0.2.1'
}
but when I build the proyect I get this error:
Error:Execution failed for task ':ap:processDebugManifest'.
> Manifest merging failed. See console for more info.
/Users/moskis/AndroidStudioProjects/Manager/Manager/build/exploded-aar/com.google.android.gms/play-services/4.3.23/AndroidManifest.xml
Error:(1) Could not find element /manifest/application.
Error:(1) Could not find element /manifest/application.
Error:(1) Could not find element /manifest/application.
Error:(1) Could not find element /manifest/application.
Error:(1) Could not find element /manifest/application.
Error:(1) Could not find element /manifest/application.
Error:(1) Could not find element /manifest/application.
How can I fix this? Thx
The problem was fixed importing the version 0.3.3
compile 'com.github.asne:asne-facebook:0.3.3'
compile 'com.github.asne:asne-twitter:0.3.3'
compile 'com.github.asne:asne-googleplus:0.3.3'
compile 'com.github.asne:asne-linkedin:0.3.3'
compile 'com.github.asne:asne-instagram:0.3.3'
compile 'com.github.asne:asne-vk:0.3.3'
compile 'com.github.asne:asne-odnoklassniki:0.3.3'

Categories

Resources