6
apply plugin: 'kotlin-android-extensions'. 

を見つけていないIDを持つプラグインは、私にこのエラー を与える「エラー:(1、0)のプラグインでid 'kotlin-android-extensions'が見つかりませんでした。 "エラー:(1、0)私はアンドロイドスタジオプレビューでこの拡張子を追加すると「kotlin-アンドロイド-Extensionsの

私のビルドのGradle

apply plugin: 'com.android.application' 

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

dependencies { 
    implementation fileTree(dir: 'libs', include: ['*.jar']) 
    implementation 'com.android.support:appcompat-v7:26.0.2' 
    implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
    testImplementation 'junit:junit:4.12' 
    androidTestImplementation 'com.android.support.test:runner:1.0.1' 
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 
} 
+0

あなたのbuild.gradleを表示します。 – jdv

答えて

8

build.gradleは、アプリモジュール内部の設定のようなルックスを掲載スニペット。プロジェクトのルートディレクトリにあるbuild.gradleはどのようなものですか?

buildscript { 
    ext.kotlin_version = '1.1.50' 
    repositories { 
     jcenter() 
     google() 

    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:3.0.0-beta6' 
     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 { 
     jcenter() 
     google() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

重要な部分はkotlinプラグインを追加する行classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"さ:kotlinプラグインの依存関係を追加するためには、次のようになります。

+0

が私のために働いたが、その後にsdkを26に更新するように頼んだ。 – Leon

6

To use the plugin, you have to add it in your root build.gradle file

buildscript { 
ext.kotlin_version = '1.1.60' 
    repositories { 
     jcenter() 
     maven { 
      url 'https://maven.google.com' 
     } 
    } 

    dependencies { 
     classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 
    } 
} 
関連する問題