Plugin version is not the same as library version
                                            
                                                
                                                
                                                
                                                
                                                
                                                 4785 단어  AndroidStudioKotlingradle
                    
개요
kotlin-gradle-plugin을 사용하면 플러그인과 라이브러리 버전이 다르다는 내용의 경고가 나올 수 있습니다.
Gradle 플러그인과 라이브러리 버전이 동일하지 않아도 되므로 잘못된 탐지입니다.
다음은 현상과 해결 방법을 보여줍니다.
 현상
 ◆ 경고 내용
Plugin version (プラグインのバージョン) is not the same as library version (ライブラリのバージョン) 라는 내용의 경고가 표시됩니다.
예:
Plugin version (1.3.72) is not the same as library version (jdk8-1.3.72)
 
 ◆ 사례
다음은 실제로 발생한 사례입니다.
 ☆ Root project 의 build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = "1.3.72"
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"
        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
}
 ☆ Sub project 의 build.gradle
apply plugin: 'java-library'
apply plugin: 'kotlin'
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
 ☆ 경고 표시
Plugin version (1.3.72) is not the same as library version (jdk8-1.3.72)
 
 해결 방법
오검지이므로 대처할 필요가 없습니다.
경고의 억제는 다음과 같이 할 수 있습니다. 1
// https://youtrack.jetbrains.com/issue/KT-33248
// noinspection DifferentStdlibGradleVersion
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
 참고
 h tps : // t 등 ck. 지 tb 라이언 s. 코 m / 이스에 / KT-23744
 h tps : // t 등 ck. 지 tb 라이언 s. 코 m / 이스에 / KT-33248
링크의 코멘트는 불필요합니다만, 의도를 남겨 두는 쪽이 보수자는 행복하게 될 수 있다고 생각합니다. ↩
 
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(Plugin version is not the same as library version), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/beyondseeker/items/d32f6951cd7115f00229
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
◆ 경고 내용
Plugin version (プラグインのバージョン) is not the same as library version (ライブラリのバージョン) 라는 내용의 경고가 표시됩니다.예:
Plugin version (1.3.72) is not the same as library version (jdk8-1.3.72)

◆ 사례
다음은 실제로 발생한 사례입니다.
☆ Root project 의 build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = "1.3.72"
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"
        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
}
☆ Sub project 의 build.gradle
apply plugin: 'java-library'
apply plugin: 'kotlin'
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
☆ 경고 표시
Plugin version (1.3.72) is not the same as library version (jdk8-1.3.72)

해결 방법
오검지이므로 대처할 필요가 없습니다.
경고의 억제는 다음과 같이 할 수 있습니다. 1
// https://youtrack.jetbrains.com/issue/KT-33248
// noinspection DifferentStdlibGradleVersion
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
 참고
 h tps : // t 등 ck. 지 tb 라이언 s. 코 m / 이스에 / KT-23744
 h tps : // t 등 ck. 지 tb 라이언 s. 코 m / 이스에 / KT-33248
링크의 코멘트는 불필요합니다만, 의도를 남겨 두는 쪽이 보수자는 행복하게 될 수 있다고 생각합니다. ↩
 
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(Plugin version is not the same as library version), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/beyondseeker/items/d32f6951cd7115f00229
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
// https://youtrack.jetbrains.com/issue/KT-33248
// noinspection DifferentStdlibGradleVersion
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
h tps : // t 등 ck. 지 tb 라이언 s. 코 m / 이스에 / KT-23744
h tps : // t 등 ck. 지 tb 라이언 s. 코 m / 이스에 / KT-33248
링크의 코멘트는 불필요합니다만, 의도를 남겨 두는 쪽이 보수자는 행복하게 될 수 있다고 생각합니다. ↩
Reference
이 문제에 관하여(Plugin version is not the same as library version), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/beyondseeker/items/d32f6951cd7115f00229텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)