导入项目Plugin with id 'com.github.dcendents.android-maven' not found.错误

今天开发项目是引用了开源的MPChart的Library,出现了报错Plugin with id 'com.github.dcendents.android-maven' not found.java

其实这是缺乏工程以来的配置信息android

在Project下那个build.grade里面的ios

dependencies {
}

添加全局依赖git

classpath "com.github.dcendents:android-maven-gradle-plugin:1.5"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0"

搞定,收工!github

 

正常导入第三方框架步骤app

1、下载第三方开源框架/项目
下载地址:[xUtils3](https://github.com/wyouflf/xUtils3)
1
2、把第三方开源框架/项目的library文件考到项目文件夹中与app文件夹同级
3、在settings.gradle文件中添加框架/项目
include ':app',"xUtils"
1
2
4、在build.gradle(Module:app)中添加依赖框架

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation project(':xUtils')// 新添加的
}

5、第四布后机会提示一些相关错误,根据相关错误进行修改
在这里,我添加xUtils3的时候,提示了一个错误maven

Error:(2, 0) Plugin with id 'com.github.dcendents.Android-maven' not found
1
解决方法:在项目的build.gradle文件中添加两句代码gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.1'
    classpath "com.github.dcendents:android-maven-gradle-plugin:1.5"// 新添加的
    classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0"// 新添加的
}

6、若是加入的第三方开源框架/项目根目录中没有build.gradle,新建一个
参考:ui

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        minSdkVersion 4
        targetSdkVersion 23
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
        }
    }
}

dependencies {
    //compile 'com.android.support:appcompat-v7:19.1.0'
    //compile 'com.android.support:support-v4:19.1.0'
    compile files('libs/android-support-v4.jar')
}

7、Build/Make Project(到这一步,就已经添加成功了)
注:在这里说明一下,android stdios添加xUtils3,能够直接在在build.gradle(Module:app)中添加依赖便可使用,方法以下:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile project(':SlidingMenu')
    compile 'org.xutils:xutils:3.3.34'   // 新添加的
    //compile project(':xUtils')
}

导入第三方Jar包:
直接将jar包拷贝到app/libs下,而后在app下的build.gradle中添加此jar的依赖。以下:

dependencies {     compile fileTree(dir: 'libs', include: ['*.jar']) // 若是有这一句,下面一句能够不用添加,这里添加将libs目录下的全部jar文件依赖     compile files('libs/umeng-analytics-v6.0.1.jar') // 新添加的     testCompile 'junit:junit:4.12'     compile 'com.android.support:appcompat-v7:23.4.0' } ---------------------  原文:https://blog.csdn.net/zhengweilxl/article/details/51541786   

相关文章
相关标签/搜索