im building an app with mapsforge, im adding to my map proyect the 'org.mapsforge:mapsforge-map-android-extras:0.6.1' library, but gradle cant sync.
this is my gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "safeapp.safe"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.5.2'
compile 'org.mapsforge:mapsforge-core:0.6.1'
compile 'org.mapsforge:mapsforge-map-android:0.6.1'
compile 'org.mapsforge:mapsforge-map-android-extras:0.6.1'
compile 'org.mapsforge:mapsforge-map-awt:0.6.1'
compile 'org.mapsforge:mapsforge-map-reader:0.6.1'
compile 'org.mapsforge:mapsforge-map-writer:0.6.1'
compile 'org.mapsforge:mapsforge-map:0.6.1'
compile 'com.caverock:androidsvg:1.2.2-beta-1'
compile 'com.kitfox.svg:svg-salamander:1.0'
compile 'net.sf.kxml:kxml2:2.3.0'
}
and this is the gradle error
Error:Failed to resolve: android.support:compatibility-v4:23.2.1
I have solved my problem
The problem arises from the mapsforge-map-android-extras dependencies in Maven / jCenter centrals (where is declared differently as jar vs aar).
To overcome that annoyance you can declare it in Gradle as a non transitive dependency:
compile('org.mapsforge:mapsforge-map-android-extras:0.6.0') {
transitive = false
}
there is the link
https://groups.google.com/d/msg/mapsforge-dev/d39AA3SJuQE/TtMPUbWcCwAJ