Android更改build.gradle以导入外部库

Android更改build.gradle以导入外部库,android,android-gradle-plugin,Android,Android Gradle Plugin,我正在尝试在我的项目中使用,但是这个库不支持我的从右到左的语言,我必须编辑它。下载项目并将其导入当前项目后,在生成项目时出现以下错误: Error:(2, 0) Plugin with id 'com.novoda.bintray-release' not found. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.

我正在尝试在我的项目中使用,但是这个库不支持我的从右到左的语言,我必须编辑它。下载项目并将其导入当前项目后,在生成项目时出现以下错误:

Error:(2, 0) Plugin with id 'com.novoda.bintray-release' not found.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        /* I'm adding this below line */
        classpath 'com.novoda:bintray-release:0.2.7'
    }
}
allprojects {
    repositories {
        jcenter()
    }
}
在网上搜索了很多次之后,我找到了解决这个问题的方法。但这对我的项目不起作用:

Error:(2, 0) Plugin with id 'com.novoda.bintray-release' not found.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        /* I'm adding this below line */
        classpath 'com.novoda:bintray-release:0.2.7'
    }
}
allprojects {
    repositories {
        jcenter()
    }
}

如果您下载了实际的库,并将其导入Android studio并对其进行了修改,那么您需要在gradle.build(模块:app)中添加依赖项。您显示的代码来自gradle.build(Project:NameOfYourProject),因此我将删除您在其中添加的那一行

转到build.gradle(Module:app)文件,该文件将如下图所示,并添加库,如图所示

android {
compileSdkVersion 22
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.yourappname"
    minSdkVersion 22
    targetSdkVersion 22
    versionCode 1
    versionName "1"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-project.txt'), 'proguard-rules.pro'
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile project(':nameOfTheLibrary')
}

如果您下载了实际的库,并将其导入Android studio并对其进行了修改,那么您需要在gradle.build(模块:app)中添加依赖项。您显示的代码来自gradle.build(Project:NameOfYourProject),因此我将删除您在其中添加的那一行

转到build.gradle(Module:app)文件,该文件将如下图所示,并添加库,如图所示

android {
compileSdkVersion 22
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.yourappname"
    minSdkVersion 22
    targetSdkVersion 22
    versionCode 1
    versionName "1"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-project.txt'), 'proguard-rules.pro'
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile project(':nameOfTheLibrary')
}

然后按同步按钮。

添加


然后按同步按钮。

我说这个库不支持从右向左的语言,我必须从源代码编辑它。我说这个库不支持从右向左的语言,我必须从源代码编辑它