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.
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'
Well, I know that's not the nicest solution for this but this is what worked. I simply commented these lines out:
//testImplementation "junit:junit:4.12"
//testImplementation "org.robolectric:robolectric:3.1.2"
Hope it helps =)
Can you provide your Gradle version and complete build.gradle ?
Possible issues:
apply plugin: 'com.android.application'
or any plugin that implicitly uses the Java Plugin ? That's where the testImplementation
comes from.
Ensure you are using Gradle 3.x+ and that the top level build.gradle has Android Gradle Plugin 3.x+ defined in it : https://developer.android.com/studio/releases/gradle-plugin#updating-plugin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With