Android Studio - Cannot compile project with android-maps-utils -


the rest of team using eclipse , maps added our project. error i'm getting there duplicate of android.gms library, i'm guessing because google play services , map-utils-library both feature package.

error:execution failed task ':projectname:processdebugresources'.

error: more 1 library package name 'com.google.android.gms' can temporarily disable error android.enforceuniquepackagename=false however, temporary , enforced in 1.0

here current build.gradle:

apply plugin: 'com.android.application'  dependencies {     compile filetree(dir: 'libs', include: '*.jar')     compile project(':third_party:sdk:extras:google:google_play_services')     compile project(':third_party:facebook-android-sdk-3.17.1:facebook')     compile project(':third_party:android-maps-utils:map-utils-library') }  android {     compilesdkversion 19     buildtoolsversion "20.0.0"      packagingoptions {         exclude 'meta-inf/dependencies.txt'         exclude 'meta-inf/license.txt'         exclude 'meta-inf/notice.txt'         exclude 'meta-inf/notice'         exclude 'meta-inf/license'         exclude 'meta-inf/dependencies'         exclude 'meta-inf/notice.txt'         exclude 'meta-inf/license.txt'         exclude 'meta-inf/dependencies.txt'         exclude 'meta-inf/lgpl2.1'     }      sourcesets {         main {             manifest.srcfile 'androidmanifest.xml'             java.srcdirs = ['src']             resources.srcdirs = ['src']             aidl.srcdirs = ['src']             renderscript.srcdirs = ['src']             res.srcdirs = ['res']             assets.srcdirs = ['assets']         }          // move tests tests/java, tests/res, etc...         instrumenttest.setroot('projectname')          // move build types build-types/<type>         // instance, build-types/debug/java, build-types/debug/androidmanifest.xml, ...         // moves them out of them default location under src/<type>/...         // conflict src/ being used main source set.         // adding new build types or product flavors should accompanied         // similar customization.         debug.setroot('build-types/debug')         release.setroot('build-types/release')     } } 

i have tried removing separate google play services (to try , use whatever comes android-maps-utils), other compiler errors such not being able locate manifest:

 <meta-data             android:name="com.google.android.gms.version"             android:value="@integer/google_play_services_version" /> 

so should in situation?

edit:

okay i've come realisation answer lies in build.gradle of map-utils-library. featured following line bring in play services:

dependencies {     compile 'com.google.android.gms:play-services:3+' } 

so figure should replace line local copy of play services:

dependencies {     compile project(':third_party:sdk:extras:google:google_play_services') } 

the problem i think support library not integrated properly, moment i've added so:

dependencies {     compile 'com.android.support:support-v4:20.0.0'     compile project(':third_party:sdk:extras:google:google_play_services') } 

although not ideal solution, attempt fix properties correctly soon!

in android studio, avoid including libraries via library projects or jar files if @ possible. can include map-utils-library , google play services via in app's build file:

dependencies {     compile filetree(dir: 'libs', include: '*.jar')     compile project(':third_party:facebook-android-sdk-3.17.1:facebook')     compile 'com.google.maps.android:android-maps-utils:0.3+'     compile 'com.google.android.gms:play-services:3+' } 

note isn't latest version of play services library; should use whatever version works right eclipse build of app , maps-utils library.

also, it's better not use + notation in version numbers in builds, instead find explicit version number , stick that. using + make build hit network new versions of libraries, can cause problems developers, , can make build unexpectedly change , break if 1 of versions gets updated underneath you.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -