-1

I have coded an test class in my app and it is written correctly because I checked it by ChatGPT. but when I run it I get the error: Could not find androidx.test.runner:1.4.0:. I have this line in my dependencies though. I have checked newer versions of the runner but I get the same error.

Here are my dependencies:

implementation 'androidx.core:core-ktx:1.9.0'
androidTestImplementation 'androidx.test:rules:1.5.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation platform('com.google.firebase:firebase-bom:31.2.3')
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
androidTestImplementation 'androidx.test.runner:1.4.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
implementation 'androidx.test.ext:junit-ktx:1.1.5'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'com.google.firebase:firebase-database-ktx'

I asked ChatGPT but he dosen't know the cause.

1 Answers1

0

I have issues with my manifest error by running the instruments test too when adding android unitest to my old project.

You can just try to update your Gradle everything will be solved. at first, my Gradle version was 3.3.2 and I update it to 3.3.3.

Checkout It

solution

Chirag Thummar
  • 665
  • 6
  • 16
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Muhtar Aug 19 '23 at 14:08