Updating play-services gives repeated resources error - android

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.

Related

Attribute "tint" already defined with incompatible format

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

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'

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

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