如何在android项目中集成GeoTools库

问题描述 投票:0回答:1

我正在尝试集成geotools库,但我收到错误,请帮助集成我已经完成了以下集成步骤。

我收到错误:无法解析配置“:app:debugRuntimeClasspath”的所有文件。

找不到 org.geotools:geotools:29.2。

请帮我整合

项目级别build.gradle

plugins {
    id 'com.android.application' version '8.0.2' apply false
    id 'com.android.library' version '8.0.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
}

应用程序级别的build.gradle依赖项

dependencies {
    implementation 'androidx.core:core-ktx:1.8.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'io.oss84.geotools:geotools:24.2-oss84-1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    implementation 'org.geotools:geotools:29.2'
}

设置.gradle

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        maven { url 'https://jitpack.io' } // Add GeoTools repository
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}
rootProject.name = "GeoToolsAndroid"
include ':app'
java android geotools
1个回答
0
投票

正如手册所说,GeoTools 将其发布 jar 存储在 https://repo.osgeo.org/repository/release/

此外,GeoTools 的大部分依赖于 SPI 工具来加载数据存储和其他插件,因此除非您重写加载器,否则它无法在 Android 上运行。

© www.soinside.com 2019 - 2024. All rights reserved.