androidgradlejunitbuild

Could not find method testImplementation() for arguments [junit:junit:4.12]


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha06'
    implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha06'
    implementation 'android.arch.navigation:navigation-fragment-ktx:1.0.0-alpha06'
    implementation 'android.arch.navigation:navigation-ui-ktx:1.0.0-alpha06'
    implementation 'com.android.support:design: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'
}

This is my build.gradle file and I tried many ways but I can't fix this, when I start Android Studio and gradle starts build the project Android Studio throw this error how can I fix it?( I am new in Android)

Could not find method testImplementation() for arguments [junit:junit:4.12] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.


Solution

  • It is Google's fault.You need to use your countries letters.So use 'İ' instead 'I'.

    testİmplementation  'junit:junit:4.12'
    androidTestİmplementation  'androidx.test:runner:1.1.1'
    androidTestİmplementation  'androidx.test.espresso:espresso-core:3.1.1'