2016-07-26 95 views
0

即時建立一個mapforge應用程序,即時添加到我的地圖項目'org.mapsforge:mapsforge-map-android-extras :0.6.1'庫,但gradle不能同步。Gradle error with compile'org.mapsforge:mapsforge-map-android-extras:0.6.1'

這是我的gradle這個代碼

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

,這是gradle這個錯誤

Error:Failed to resolve: android.support:compatibility-v4:23.2.1 

回答

0

我已經解決了我的問題

問題從mapsforge-地圖Android的演員出現Maven/jCenter中心中的依賴關係(其中jar和aar的聲明不同)。

爲了克服這種煩惱,你可以在搖籃聲明它作爲一個非傳遞依賴:

compile('org.mapsforge:mapsforge-map-android-extras:0.6.0') { 
    transitive = false 
} 

有鏈接

https://groups.google.com/d/msg/mapsforge-dev/d39AA3SJuQE/TtMPUbWcCwAJ