java - Error: more than one library with package name 'com.google.maps.android' -
i added library in project encounter error :
error:execution failed task ':app:processdebugresources'. > error: more 1 library package name 'com.google.maps.android' can temporarily disable error android.enforceuniquepackagename=false however, temporary , enforced in 1.0
how avoid error? tried solution found on internet :
add android.enforceuniquepackagename=false
eclude group {com.google.maps.android}
but no success.
here app build.gradle :
apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.0" defaultconfig { applicationid "me.eazypark.eazypark" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile project(':library') compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' repositories { mavencentral() } compile 'com.android.support:appcompat-v7:24.0.0-alpha1' compile 'com.google.android.gms:play-services-maps:8.4.0' compile 'com.google.maps.android:android-maps-utils:0.3.+' compile 'com.android.support:design:24.0.0-alpha1' compile 'com.google.android.gms:play-services:8.4.0' compile 'com.mcxiaoke.volley:library-aar:1.0.0' compile 'com.sothree.slidinguppanel:library:3.0.0' }
here library build.gradle:
apply plugin: 'com.android.library' apply plugin: 'maven' apply plugin: 'signing' archivesbasename = 'android-maps-utils' group = 'com.google.maps.android' dependencies { compile 'com.google.android.gms:play-services-maps:8.4.0' } android { compilesdkversion 23 buildtoolsversion "23.0.2" resourceprefix 'amu_' sourcesets { main { manifest.srcfile 'androidmanifest.xml' java.srcdirs = ['src'] res.srcdirs = ['res'] } androidtest { java.srcdirs = ['tests/src'] } } // enables long timeouts required on slow environments, e.g. travis adboptions { timeoutinms 10 * 60 * 1000 // 10 minutes installoptions "-d","-t" } } task instrumenttest(dependson: connectedcheck) task apklib(type: zip) { dependson 'check' appendix = extension = 'apklib' 'androidmanifest.xml' into('res') { 'res' } into('src') { 'src' } } artifacts { archives apklib } task sourcesjar(type: jar) { android.sourcesets.main.java.srcdirs classifier = 'sources' } signing { sign configurations.archives } if (!hasproperty("sonatypeusername")) { sonatypeusername = "" } if (!hasproperty("sonatypepassword")) { sonatypepassword = "" } uploadarchives { repositories { mavendeployer { beforedeployment { mavendeployment deployment -> signing.signpom(deployment) } repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') { authentication(username: sonatypeusername, password: sonatypepassword) } snapshotrepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') { authentication(username: sonatypeusername, password: sonatypepassword) } modifypom(addfilter('aar') { artifact, file -> artifact.name == 'android-maps-utils' }) modifypom(addfilter('apklib') { artifact, file -> artifact.name == 'android-maps-utils-apklib' }) // there's no official apklib google play services, // can't maintain dependency apklib packaging. pom('apklib').whenconfigured { pom -> pom.dependencies = [] } } } } def modifypom(pom) { pom.project { name 'google maps android api utility library' description 'handy extensions google maps android api.' url 'https://github.com/googlemaps/android-maps-utils' scm { url 'scm:git@github.com:googlemaps/android-maps-utils.git' connection 'scm:git@github.com:googlemaps/android-maps-utils.git' developerconnection 'scm:git@github.com:googlemaps/android-maps-utils.git' } licenses { license { name 'the apache software license, version 2.0' url 'http://www.apache.org/licenses/license-2.0.txt' distribution 'repo' } } organization { name 'google inc' url 'http://developers.google.com/maps' } developers { developer { id 'broady' name 'chris broadfoot' url 'http://google.com/+christopherbroadfoot' } } } }
tanks!
in build.gradle
, dont need add both compile 'com.google.android.gms:play-services:8.4.0'
, compile 'com.google.android.gms:play-services-**:8.4.0'
. either should define play-services using , or need add compile 'com.google.android.gms:play-services:8.4.0'
only..
Comments
Post a Comment