首页 > 解决方案 > Android工作室:无法从gitlab找到包

问题描述

我正在尝试启动 owncloud android 库的 sample_client 应用程序。

你可以在这里找到图书馆:

https://github.com/owncloud/android-library#:~:text=%20ownCloud%20Android%20Library%20%201%20Introduction.%20Using,code%20of%20HEAD...%204%20Compatibility.%20 %20更多

我更改了 gradle 文件以获取软件包。我的问题如下:

任务 ':owncloudComLibrary:generateDebugRFile' 执行失败。

无法解析配置 ':owncloudComLibrary:debugCompileClasspath' 的所有文件。找不到 com.gitlab.ownclouders:dav4android:oc_support_2.1.5。要求:项目:owncloudComLibrary 找不到 com.github.AppDevNext.Logcat:LogcatCore:2.2.2。要求:项目:owncloudComLibrary

Simple_client 应用程序 build.gradle :

apply plugin: 'com.android.application'
buildscript{
    repositories{
        jcenter()
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }

    dependencies{
        classpath 'com.android.tools.build:gradle:4.1.2'
    }
}
repositories{
    jcenter()
    google()
    mavenCentral()
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation project(':owncloudComLibrary')
}

android {
    compileSdkVersion 30

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 30

        // This is pretty ugly but manifest placeholders don't seem to work very well when using different modules
        // See https://github.com/openid/AppAuth-Android/issues/325
        manifestPlaceholders = [appAuthRedirectScheme: '']
    }

    lintOptions {
        abortOnError false
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

库 build.gradle :

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
buildscript {
    ext {
        kotlinVersion = "1.3.31"
    }
    repositories{
        jcenter()
        google()
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    }
}
repositories {
    mavenCentral()
    google()
    jcenter()
}
dependencies {

    api 'com.squareup.okhttp3:okhttp:4.6.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31"
    api 'com.gitlab.ownclouders:dav4android:oc_support_2.1.5'
    api 'com.github.AppDevNext.Logcat:LogcatCore:2.2.2'

    // Moshi
    implementation ("com.squareup.moshi:moshi-kotlin:1.11.0") {
        exclude module: "kotlin-reflect"
    }
    kapt "com.squareup.moshi:moshi-kotlin-codegen:1.11.0"

    testImplementation 'junit:junit:4.13.1'
}

android {
    compileSdkVersion 29

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 29

        versionCode = 10000900
        versionName = "1.0.9"
    }

    lintOptions {
        abortOnError false
        ignoreWarnings true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

谢谢您的帮助

标签: android-studio

解决方案


推荐阅读