问题
I wan to use geotools in my project so i've added geotools lib in my repositories project gradle :
allprojects {
repositories {
maven { url "http://repo.boundlessgeo.com/main" }
maven { url "http://download.osgeo.org/webdav/geotools/" }
jcenter()
google()
}
}
I have a module called map and i haved added this dependencies to this gradle:
dependencies {
api 'com.google.android.gms:play-services-maps:15.0.1'
api 'org.osmdroid:osmdroid-android:5.6.5'
api 'com.github.MKergall:osmbonuspack:6.4'
api 'com.vividsolutions:jts-core:1.14.0'
api 'com.vividsolutions:jts-io:1.14.0'
api 'org.orbisgis:cts:1.5.1', {
exclude group: 'org.slf4j'
}
api 'org.jdom:jdom:1.1.3'
api 'org.geotools:gt-metadata:19.0'
}
When i make this project i got this error:
Execution failed for task ':commision12:transformClassesWithDexBuilderForRelease'.
> com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\User
s\TazikA\.gradle\caches\modules-2\files-2.1\org.geotools\gt-opengis\19.0\f5a2e7f75e0883bfd319c57d935fb65a5c42e232\gt-opengis-19.0.jar
I have added multiDexEnabled true
in defultConfig and api 'com.android.support:multidex:1.0.3'
to my module gradle.
Someone have any idea that where is my mistake?
来源:https://stackoverflow.com/questions/50323013/how-to-install-geotools-by-gradle-in-android-studio-3-1-2