gpt4 book ai didi

java - Graphhopper 演示项目无法在 Android Studio 上运行

转载 作者:行者123 更新时间:2023-12-02 04:24:07 25 4
gpt4 key购买 nike

我尝试在 Android Studio 上开发 Graphhopper 演示项目,我在这里找到了它:https://github.com/graphhopper/graphhopper/tree/master/android

Gradle 构建后我收到此错误:错误:无法解析:com.graphhopper:graphhopper:0.6-SNAPSHOT

现在 Android Studio 无法解析 Graphhopper 类的符号。

这是我的 build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 19
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "com.graphhopper.android"
minSdkVersion 10
targetSdkVersion 22
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}

lintOptions {
/* CGIARProvider refers to java.awt
* Helper7 refers to java.lang.management
* HeightTile refers to javax.imageio and java.awt
* OSMElement refers to javax.xml.stream
*/
disable 'InvalidPackage'
}
}

/** only necessary if you need to use latest SNAPSHOT
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
**/

dependencies {
compile(group: 'com.graphhopper', name: 'graphhopper', version: '0.6-SNAPSHOT') {
exclude group: 'com.google.protobuf', module: 'protobuf-java'
exclude group: 'org.openstreetmap.osmosis', module: 'osmosis-osm-binary'
exclude group: 'org.apache.xmlgraphics', module: 'xmlgraphics-commons'
}

compile group: 'org.mapsforge', name: 'mapsforge-core', version: '0.5.2'
compile group: 'org.mapsforge', name: 'mapsforge-map', version: '0.5.2'
compile group: 'org.mapsforge', name: 'mapsforge-map-android', version: '0.5.2'
compile group: 'org.mapsforge', name: 'mapsforge-map-reader', version: '0.5.2'

compile group: 'org.slf4j', name: 'slf4j-android', version: '1.7.12'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.12'

}

最佳答案

发生这种情况是因为com.graphhopper:graphhopper:0.6-SNAPSHOT不在中央maven(或jcenter)中。

您可以查看所有版本here .

最后一个稳定版本是0.5.0

如果您想使用快照版本,您必须在build.gradle中添加存储库

repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

这里是snapshot versions.

关于java - Graphhopper 演示项目无法在 Android Studio 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32401528/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com