【问题标题】:Add github project to existing Android Studio project将 github 项目添加到现有的 Android Studio 项目中
【发布时间】:2021-04-04 11:25:55
【问题描述】:

我是 Android 新手。 如何将此(gradle)https://github.com/hakobast/DropdownTextView 导入我现有的 Android Studio 项目。 我需要添加什么才能在我当前的项目中使用这个下拉列表。 请告诉我我需要向您展示什么,以建议我如何正确地做到这一点。 我已经尝试下载项目并将导入添加为模块。

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = "1.4.30"
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.1.2"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle(:app)

plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example.tiara_przydziau"
        minSdkVersion 26
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.3.2'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation "androidx.constraintlayout:constraintlayout:2.0.4"
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.android.volley:volley:1.2.0'
}

【问题讨论】:

    标签: android github gradle add


    【解决方案1】:

    你必须添加这个: implementation 'com.github.hakobast:dropdown-textview:0.3.1'dependencies 选择中的build.gradle(:app)

    【讨论】:

    • 不应该是implementation 'com.github.hakobast:dropdown-textview:0.3.1'吗?
    • 你用过这个dropdowtextview吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-05
    • 2020-12-22
    • 2019-04-18
    • 1970-01-01
    • 2016-09-02
    相关资源
    最近更新 更多