마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

깃허브 오픈소스 import module Plugin with id '...' not found

0 추천

https://github.com/lopspower/CircularFillableLoaders

zip으로 받아서 압축 해제 후 import module로 넣었는데 

build.gradle (module)의

apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

두줄 모두 에러입니다.

Error:(2,0) Plugin with id 'com.github.dcendents.android-maven' not found.

찾다보니 maven은 라이브러리 배포때 필요한 것 같아서 아예 지워 보았습니다.

 

저 두줄을 지우고 리빌드 하게 되면

Could not find method install() for arguments [..................]on project'.circularfillableloaders'of type org.gradle.api.Project. 

라고 나오네요... 웃긴게 example 소스는 작동합니다. 제가 뭘 잘못 적었는지..ㅠ

정말 이틀동안 삽질만 하다 지푸라기라도 잡는 심정으로 글 써봅니다...

읽어주신 분들 감사합니다...

clcell3 (200 포인트) 님이 2016년 11월 16일 질문
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

// This is the library version used when deploying the artifact
version = "1.2.0"

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 3
        versionName version
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

def siteUrl = 'https://github.com/lopspower/CircularFillableLoaders'      // Homepage URL of the library
def gitUrl = 'https://github.com/lopspower/CircularFillableLoaders.git'   // Git repository URL
group = "com.mikhaellopez"                                                // Maven Group ID for the artifact

install {
    repositories.mavenInstaller {
        // This generates POM.xml with proper parameters
        pom {
            project {
                packaging 'aar'

                // Add your description here
                name 'com.mikhaellopez:circularfillableloaders'
                description = 'This is an Android project allowing to realize a beautiful circular fillable loaders to be used for splashscreen for example.'
                url siteUrl

                // Set your license
                licenses {
                    license {
                        name 'The Apache Software License, Version 2.0'
                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }
                developers {
                    developer {
                        id 'lopspower'
                        name 'Mikhael Lopez'
                        email 'lopez.mikhael@gmail.com'
                    }
                }
                scm {
                    connection gitUrl
                    developerConnection gitUrl
                    url siteUrl

                }
            }
        }
    }
}

task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

task javadoc(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives javadocJar
    archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

// https://github.com/bintray/gradle-bintray-plugin
bintray {
    user = properties.getProperty("bintray.user")
    key = properties.getProperty("bintray.apikey")

    configurations = ['archives']
    pkg {
        repo = "maven"
        // it is the name that appears in bintray when logged
        name = "com.mikhaellopez:circularfillableloaders"
        websiteUrl = siteUrl
        vcsUrl = gitUrl
        licenses = ["Apache-2.0"]
        publish = true
        version {
            gpg {
                sign = true //Determines whether to GPG sign the files. The default is false
                passphrase = properties.getProperty("bintray.gpg.password") //Optional. The passphrase for GPG signing'
            }
        }
    }
}

제거전 소스입니다.

compile 'com.mikhaellopez:circularfillableloaders:1.2.0'는 이런식으로 추가했습니다

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"
    defaultConfig {
        applicationId "com.circular.clcell3.myapplication"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.mikhaellopez:circularfillableloaders:1.2.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    testCompile 'junit:junit:4.12'
}

1개의 답변

0 추천
안드로이드 스튜디오 프로젝트시라면 import 하지말고

Gradle Scripts/build.gradle(Module:app)

이걸 열어서

dependencies 에다가

compile 'com.mikhaellopez:circularfillableloaders:1.2.0'

한줄 추가해주시고

저 파일이 조금이라도 변경되면 에디터 상단에 싱크하라고 알림이 뜨는데 그거 눌러보시면

저 깃허브에서 제공하는 클래스들을 사용할수있습니다.

해보니까 잘되네요
안드잘하고싶 (3,310 포인트) 님이 2016년 11월 16일 답변
정말 감사합니다. 채택을 해드리고 싶은데 여긴 채택 기능이 없나요...?
정말 감사합니다ㅠㅠㅠㅠ 덕분에 저도 해결했습니다
...