【问题标题】:How to use module as library in android如何在android中使用模块作为库
【发布时间】:2015-12-18 05:30:59
【问题描述】:

我将在我的应用程序中使用 cognalys(第三方库)进行移动验证。我从 git hub 克隆了它,并将该 cognalys 作为模块导入到我的应用程序中。如何在我的项目中使用该模块作为库(如何将其转换为库)..我不知道如何使用它..通过使用它,我只能创建一个用于用户移动验证的类...

请帮我找出解决办法

这是我的 cognalys 项目的 build.gradle

apply plugin: 'com.android.library'

android {
    compileSdkVersion 10
    buildToolsVersion "21.1.2"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19
    }

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

dependencies {
    compile 'com.android.support:support-v4:19.0.0'
}

【问题讨论】:

标签: android github verification


【解决方案1】:

首先将库项目添加为模块。

文件->新建->导入模块

然后将此行添加到您在 gradle 中的依赖项

compile project(':yourmodule')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-26
    • 1970-01-01
    • 2017-12-10
    相关资源
    最近更新 更多